In-Product Agents
In-product agents are AI assistants embedded directly in your application, typically as a sidebar, panel, or full-page chat. Unlike simple Q&A chatbots, they can execute tools, take actions, and reason through multi-step tasks on behalf of your users.
Common patterns include:
- Product help: Answer "How do I...?" questions using your documentation
- Data and operations: Run queries, inspect entities, or pull recent activity using your APIs
- Guided workflows: Walk users through configuration, setup, or debugging steps
- Actions with approval: Create resources, update settings, or trigger jobs with user confirmation
Kapa supports two approaches: building your agent end-to-end with the Kapa Agent SDK, or adding Kapa as a retrieval tool to an agent you have already built with your own framework.
Kapa Agent SDK
The Kapa Agent SDK gives you an end-to-end solution: agent orchestration, streaming chat UI, knowledge base search, and custom tools in a single package. It is the fastest way to ship an in-product agent.
- Streaming chat UI: Ready-made React components (AgentChat, AgentPanel) or headless hooks for a fully custom UI
- Custom tools: Define tools with Zod schemas for type-safe argument inference. Tools execute client-side using the user's auth context.
- Human-in-the-loop: Tools can require user approval before execution
- Knowledge base search: Built-in access to your Kapa knowledge sources, no extra setup needed
- Theming: Accent color, dark/light mode, font, and border radius customization
- Framework-agnostic core:
@kapaai/agent-coreworks with any JS framework or none at all
import { AgentProvider, AgentChat } from "@kapaai/agent-react";
<AgentProvider
getSessionToken={async () => {
const res = await fetch("/api/session", { method: "POST" });
return res.json();
}}
projectId="your-project-id"
integrationId="your-integration-id"
model="kapa-agent-1.0"
tools={myTools}
>
<AgentChat branding={{ title: "AI Assistant" }} />
</AgentProvider>
See the Agent SDK documentation to get started, explore the example apps, or read best practices for building an in-product agent for lessons from building our own analytics agent.
Bring your own agent framework
If you already have an agent built with a framework like LangGraph, OpenAI Agents, or a custom orchestration layer, you can add Kapa as a retrieval tool via a Hosted MCP server. Your agent keeps its existing stack and tools. Kapa provides semantic retrieval over your documentation and other knowledge sources.
In practice, agents exposed to customers inside products receive a significant share of questions that native tools cannot answer, such as how to set something up or how a feature works. Documentation context also helps agents make better use of their native tools by giving them an understanding of your product. See our research on knowledge base search in agents for more on this.
You can connect your agent to Kapa's retrieval via a Hosted MCP server or the HTTP API retrieval endpoint. Both provide the same search over your knowledge sources. MCP is the standard if your framework supports tool calling over MCP. The HTTP API gives you direct control if you prefer a simple REST call.
See the tutorial for a full walkthrough using MCP, and Tuning knowledge base search for guidance on tuning retrieval size (max_chars), context management, and prompting.