Common Patterns
Sessions are created automatically when you run an agent without a session_id. To continue a conversation, pass the session_id from the start event of a previous run. Retrieve message history with GET /api/sessions/{id}/messages to display conversation context.GET /api/sessions/
Get a session by ID.Session ID
GET /api/sessions//messages
Get assembled chat messages for a session. Each assistant message includes its retrieved_context (knowledge-base chunks fetched during the run) so you can surface citations alongside replies.Session ID
GET /api/sessions//runs
List all agent runs within a session.Session ID
GET /api/sessions//runs//retrieved-context
Get the retrieved context (knowledge-base chunks fetched during retrieval) for a single run within a session. Useful for debugging RAG behavior — you can see exactly which chunks the agent saw before generating a given turn, separate from the assembled/messages view.
Session ID
Run ID (the
run_id of an agent_run belonging to this session)DELETE /api/sessions/
Delete a session and all its runs.Session ID
Error Responses
Errors return{"error": "<message>"}.
| Status | Description |
|---|---|
| 404 | No session exists with the given ID, or the session is owned by another user (returned as 404 to avoid leaking existence) |
| 404 | The given run does not exist within this session (/runs/{run_id}/retrieved-context) |