Optional: Personalize the AI agent
You'll now optionally personalize a chatbot experience by integrating Signals with an AI agent that uses OpenAI as the backend. The chatbot fetches user attributes via a tool call, allowing it to provide contextual, personalized responses based on the user's browsing behavior.
The demo site includes all necessary tools and SDKs, so you'll only need an OpenAI API key to implement this feature.
How it works
When a user asks the agent a question, the system fetches the attribute values for the user using the Signals API and uses these to modify the prompt sent to OpenAI. This allows personalized responses based on the user's preferences and behavior.
A toggle button on the chat widget allows you to enable or disable the tool call so you can see the difference in responses with and without Signals personalization.
Data flow
Configure the agent
Add these variables to your .env file in the snowplow-local directory:
AI_MODEL_PROVIDER=openai
AI_MODEL_NAME=gpt-4o-mini
OPENAI_API_KEY=your_openai_api_key
Generate personalization data
You'll need some attribute data to personalize the agent responses. Browse different filters, destinations, and blog pages to generate additional attribute values.
Check your attribute values using the Snowplow Inspector Attributes tab. You should see values under the travel_view label.
Test the agent
Start chatting with the agent by selecting the chat icon in the lower right portion of the screen.
First, test without personalization:
- Turn the toggle switch off (gray means off, green means on)
- Ask a question like "What are some good destinations for me in Southeast Asia?"
- Note the generic response

Then test with personalization:
- Turn the toggle switch on (green)
- Ask the same question
- Compare the response - it should now be tailored to your browsing behavior


The personalized responses should provide destination suggestions and justifications that align with the preferences you've demonstrated through your behavior on the site.