Get Started
See how Snowplow gives companies the real-time user data foundation and context layer to make better business decisions while powering the AI initiatives that will define the next era of media.
Adding real-time behavioral context to a Next.js AI agent with Snowplow Signals and Vercel AI SDK
Most AI agents respond the same way regardless of who's asking. They don't know which pages the user has visited, what they've been exploring, or how long they've been on the site. Every conversation starts from zero.
This accelerator shows you how to change that. You'll build a Next.js AI agent that uses Snowplow Signals to understand what users are doing in real time — then injects that behavioral context directly into the agent's system prompt via the Vercel AI SDK. The agent doesn't just respond to what the user types, but it responds to what the user is actually doing.
The full implementation takes approximately 30 minutes. The stack is minimal by design: Snowplow Browser Tracker for event collection, Signals for real-time attribute computation, and Vercel AI SDK with AI Gateway for model integration.
The session ID is the integration point — the front-end reads it from the Snowplow tracker cookie and sends it alongside every chat message. The /api/chat route uses it to fetch fresh attributes from Signals on each turn, so the system prompt always reflects current behavior. The tutorial uses openai/gpt-4o-mini via Vercel AI Gateway, but any model supported by the gateway works without changes to the integration pattern.
All Supported
See how Snowplow gives companies the real-time user data foundation and context layer to make better business decisions while powering the AI initiatives that will define the next era of media.