Updated · May 18, 2026Tags · agents, planningStack · Agent SDK + Agent Server + Chat UI
Overview
Autonomous AI agents can plan multi-step tasks, use tools, and deliver structured results without constant human supervision. With Cognipeer, you get a deterministic runtime that keeps you in full control — no black-box graphs, just a transparent message-driven loop.
This use case walks you through building a research assistant agent that can search, analyse, and synthesise information using the Cognipeer ecosystem.
When to reach for this recipe
If your team needs the capabilities described above and you'd rather build on proven primitives than wire one from scratch — this is the shape to start from.
Architecture
Agent SDK provides the deterministic runtime that drives agent reasoning. It handles the core loop: resolve state → summarise context → call LLM → execute tools.
Agent Server exposes your agent as a production REST API with streaming, auth, and storage.
Chat UI gives users a conversational interface to interact with the agent in real time.
1. Define Tools with Agent SDK
Start by creating the tools your agent will use. Each tool has a name, description, Zod schema, and an async function.
13systemPrompt:"You are a research assistant. Break down complex research questions into steps, search for information, and provide synthesised answers.",
14useTodoList:true,
15limits:{maxToolCalls:10,maxToken:16000},
16summarisation:{enabled:true,threshold:12000},
17tracing:{enabled:true},
18});
3. Serve with Agent Server
Register the agent and expose it as a REST API with streaming support, persistent storage, and auto-generated Swagger docs.
21description:"A research assistant that searches and synthesises",
22version:"1.0.0",
23});
24
25constapp=express();
26app.use(express.json());
27await storage.connect();
28app.use(createExpressMiddleware(server));
29app.listen(3000,()=> console.log("Agent server on :3000"));
4. Connect Chat UI
Add a conversational interface with real-time streaming, tool visibility, and conversation history.
1import{Chat}from"@cognipeer/chat-ui";
2import"@cognipeer/chat-ui/styles.css";
3
4functionResearchApp(){
5return(
6<divstyle={{height:"100vh"}}>
7<Chat
8baseUrl="http://localhost:3000/api/agents"
9agentId="research-assistant"
10authorization="Bearer your-token"
11theme="dark"
12enableFileUpload={true}
13/>
14</div>
15);
16}
Result
You now have a complete autonomous research agent that:
- Plans complex tasks using a TODO list
- Executes web searches and summarisation tools
- Streams real-time responses to the user
- Persists conversations in PostgreSQL
- Traces every step for observability
- Exposes interactive API docs at /docs