API Reference
POST /api/chat
Chat with the agent. Supports streaming (SSE) and non-streaming responses.
Request Body
{
"messages": [{ "role": "user", "content": "Search for our deployment docs" }],
"userId": "user-123",
"chatId": "chat-456",
"model": "gpt-4o",
"temperature": 0.7,
"stream": false,
"enableMemory": true,
"tools": ["search", "file_access"]
}| Field | Type | Required | Default | Description |
|---|---|---|---|---|
messages | Array | Yes | — | Chat messages |
userId | string | Yes | — | User identifier |
chatId | string | No | auto-generated | Conversation identifier |
model | string | No | gpt-4o | LLM model |
stream | boolean | No | false | Enable SSE streaming |
enableMemory | boolean | No | true | Load/store conversation memory |
tools | string[] | No | — | Restrict available tools |
Response (Non-Streaming)
{
"message": {
"role": "assistant",
"content": "I found the deployment documentation...",
"timestamp": "2026-02-21T12:00:00Z"
},
"chatId": "chat-456",
"toolsUsed": ["search"],
"memoryUpdated": true
}Streaming Events
| Event | Data | Description |
|---|---|---|
token | string | Response token chunk |
tool_start | {tool, parameters} | Tool execution started |
tool_result | {tool, success, data, error} | Tool execution result |
done | {chatId, toolsUsed, memoryUpdated} | Stream complete |
error | {error} | Error occurred |
GET /api/chat/:chatId
Retrieve full conversation history.
Query Parameters
| Parameter | Required | Description |
|---|---|---|
userId | Yes | User identifier |
Response
{
"chatId": "chat-456",
"userId": "user-123",
"messages": [...],
"lastActivity": "2026-02-21T12:00:00Z",
"messageCount": 10
}Memory Endpoints
GET /api/memory/:userId
List memories. Query params: type (default: conversation), chatId, limit (default: 50).
POST /api/memory
Store a memory.
{
"userId": "user-123",
"type": "long_term",
"content": "User prefers Python code examples",
"importance": 8,
"tags": ["preferences", "coding"]
}POST /api/memory/:userId/search
Search memories by text query.
{ "query": "coding preferences", "type": "long_term", "limit": 10 }GET /api/memory/:userId/summary
Generate a text summary of memories. Query params: type, chatId.
DELETE /api/memory/:userId/conversation/:chatId
Delete all memories for a conversation.
DELETE /api/memory/item/:memoryId
Delete a single memory by ID.
Task Endpoints (v1 mode only)
GET /api/tasks
List tasks. Query params: userId (required), status, limit.
POST /api/tasks
Create a task.
{
"title": "Analyze competitor landscape",
"description": "Research and compare top 5 competitors",
"userId": "user-123",
"chatId": "chat-456",
"steps": [
{ "title": "Research", "description": "Find competitor info", "dependencies": [] },
{ "title": "Compare", "description": "Create comparison matrix", "dependencies": ["Research"] },
{ "title": "Report", "description": "Write final report", "dependencies": ["Compare"] }
]
}GET /api/tasks/:taskId
Full task status with agents, steps, and results.
POST /api/tasks/:taskId/execute
Start execution (returns 202 Accepted). Poll GET /api/tasks/:taskId for status.
DELETE /api/tasks/:taskId
Cancel a pending or running task.
Tool Endpoints
GET /api/tools
List all tools with their schemas and enabled status.
GET /api/tools/:toolName
Get details for a specific tool.
POST /api/tools/execute
Execute a tool directly.
{
"toolName": "search",
"parameters": { "query": "deployment guide" },
"userId": "user-123"
}PATCH /api/tools/:toolName
Enable or disable a tool.
{ "enabled": false }