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
- Without real-time context
- With real-time context
📋 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.
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
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
- 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. - 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.