A session is a durable thread for one agent. A turn is one piece of submitted work inside that session. This model keeps long-running work understandable: users can reopen a session, inspect previous turns, stream current events, and see what the agent is waiting for.Documentation Index
Fetch the complete documentation index at: https://docs.akua.dev/llms.txt
Use this file to discover all available pages before exploring further.
Lifecycle
Create or reuse a session
A dashboard chat, API client, or ambient trigger creates a session for an agent. Existing sessions can be reused when the work is a continuation.
Submit a turn
A user or system signal sends an instruction. The turn starts in a queued or running state.
Stream events
The agent emits messages, tool calls, interactive UI outputs, approval requests, artifacts, and status updates.
Resolve approvals
If the agent requests a gated action, a user approves or rejects the approval request.
Session states
| State | Meaning |
|---|---|
CREATED | The session exists but has not started work. |
ACTIVE | The session can accept turns. |
WAITING_FOR_INPUT | The agent is done for now and waiting for the next instruction. |
WAITING_FOR_PERMISSION | The agent needs a human decision before continuing. |
COMPLETED | The session reached a terminal outcome. |
FAILED | The session failed and may need review. |
CANCELLED | Work was cancelled. |
ARCHIVED | The session is hidden from active views but retained according to policy. |
Event stream
Events are normalized across agent runners, so UI and API clients do not need to understand each internal tool.| Event | What users see |
|---|---|
message.created | A user, assistant, or system message. |
tool_call.started / tool_call.completed | A platform, git, shell, browser, or repository action. |
widget.created | A typed approval card, choice card, form, status card, documentation card, diagram, or navigation helper. |
approval_request.created | The agent needs approval. |
execution_environment.started | A retained runtime started or resumed. |
artifact.created | A repository change request, diff, summary, log bundle, or file was produced. |
turn.completed | The turn finished successfully. |
Retention
Session history, artifacts, and filesystems have different retention policies. Text summaries and repository change requests are cheap to keep. Retained filesystems cost more and should expire unless pinned. Pinned sessions are useful for long investigations, customer escalations, or repository change work that should remain resumable.Related topics
Permissions and security
Learn how approvals work.
Agents API
Create sessions, submit turns, and stream events programmatically.