Skip to main content
Without context, your customer support chat has to ask what the user was doing and what went wrong. With Autoplay wired in, Inkeep already knows β€” and can explain the real blocker, point to the right next step, and link directly to the relevant workflow instead of giving a generic answer. This tutorial shows you how to build that flow using the Inkeep agents framework and InkeepEmbeddedChat from @inkeep/agents-ui. Your events, conversation history, and LLM keys never leave your infrastructure. Who this is for: Teams using or evaluating Inkeep who want chat to react to what users actually do β€” not just answer generic questions. Assumes comfort with Python, TypeScript/React, and a small FastAPI service. Stack: Inkeep agents framework (Docker), @inkeep/agents-ui, Next.js 14, Python 3.10+, FastAPI, uv, and Anthropic or OpenAI. https://developers.autoplay.ai/recipes/inkeep

✨ Final result

Video walkthrough β€” Open on Loom if the player does not load.

πŸ“‹ Prerequisites

Before you start, you need:
  • Node.js 18+ and Python 3.10+ on the host.
  • uv β€” the Python package manager used in this tutorial.
  • pnpm β€” the Inkeep agents monorepo uses pnpm workspaces.
  • Docker Desktop β€” for running Inkeep’s backing services (PostgreSQL, Doltgres, SpiceDB).
  • An Anthropic or OpenAI API key β€” the Inkeep agents framework calls your LLM directly; no Inkeep cloud key required.
That’s it. The tutorial covers every code file step by step β€” copy-paste runnable.
The Inkeep CDN widget (@inkeep/cxkit-js) requires a paid Inkeep cloud API key. This tutorial uses the open-source Inkeep agents framework (@inkeep/agents-ui) which you self-host with your own LLM key β€” no per-seat or per-call fee to Inkeep for the chat itself.

Architecture

Two inputs feed the context layer: the vendor profile reports the admin’s action directly to the bridge (POST /demo/actions), and the bridge pulls the vendor’s blocked status plus missing compliance-document state from the Autoplay connector the moment it’s needed. The bridge owns all context logic; Inkeep stays a clean conversational surface. The GET /context/{user_id} endpoint calls the Autoplay connector’s REST live-activity endpoint synchronously β€” a stateless, on-demand pull keyed by the admin’s stable user_id, not a session β€” and assembles a human-readable summary of their recent activity and the vendor’s compliance state. When the admin opens chat, this summary becomes the introMessage passed to InkeepEmbeddedChat β€” so the AI’s first message references the blocked vendor and missing documents, not a generic greeting. There’s no persistent connection to manage: the bridge asks the connector for β€œwhat has this user been doing” exactly once, right when the frontend needs it.

The tutorial

  1. Step 1 β€” Connect real-time events β€” Build the vendor-management frontend, wire unblock attempts and vendor context into a FastAPI bridge, run the Inkeep agents framework in Docker, and embed InkeepEmbeddedChat. At the end of this step you have a working AI chat widget on the vendor profile. ~45 minutes.
  2. Step 2 β€” Define proactive triggers β€” Add blocked-vendor detection to the bridge, wire the guidance channel to the frontend, and build the proactive handoff that opens Inkeep chat with the vendor’s missing compliance documents pre-loaded. ~45 minutes.