Skip to content

Develop Agents

This path is for the developer side of Awaken: implement the executable capability that a runtime can safely run. Keep code focused on tools, plugins, state, providers, stores, and explicit execution boundaries. Move behavior that operators should change later into managed config, then use Tune & Operate for the browser and REST workflows.

Build Agents explains why a capability belongs in code before it becomes operator-tunable config. This keeps expensive or security-sensitive choices in reviewed Rust while still giving operators a clear path to tune prompts, tools, permissions, and governance later.

Build Agents is the full development path before live operation:

  1. Build an Agent — make the runtime executable.
  2. State & Storage — decide what the agent remembers, resumes, shares, and persists.
  3. Serve & Integrate — expose the runtime through server, protocol, mailbox, config, and admin surfaces.
  4. Tune & Operate — adjust saved behavior after the code and storage boundaries are safe.

State/storage and server integration are therefore development concerns, not late operational cleanup. They define whether later tuning, tracing, evals, and distributed runs have durable data to work with.

NeedPut it hereWhy this is better
Long-running work that should not block the current turnBackground task or background agentThe run can wait, resume, or receive inbox events without hiding work inside an untracked thread.
Specialist work that should return a bounded resultDelegate or sub-agent toolThe parent receives a normal tool result and can decide whether to continue, retry, or summarize.
A different agent should take over the same conversationAgent handoffThe active agent changes at a safe step boundary while thread history and state remain continuous.
Agents need to talk while they remain independentsend_message / mailbox-backed communicationLive child messages and durable cross-thread messages use explicit receipts instead of ad-hoc shared memory.
A child agent needs state from its parentTyped StateKey seed/export policyState contracts are visible, persistent keys are intentional, and failed transfers surface as errors.
Threads, runs, config, or profiles need durabilityFile/Postgres/NATS stores and a commit coordinatorStorage boundaries are wired during development so later tuning has reliable config, mailbox, and history data.
A plugin needs to inject model contextPhaseContext + StateCommand + AddContextMessageHooks read snapshots and return commands; the runtime owns throttling, ordering, injection, and commits.

When documenting or implementing a code-owned capability, point readers to the executable examples or tests that pin the surface:

CapabilityDevelopment surfaceCode reference
Runtime assemblyAgentRuntimeBuilder, providers, models, tools, commit coordinatorcrates/awaken-doctest/examples/http_app_builder.rs, crates/awaken-runtime/src/builder.rs
Custom providersLlmExecutor, ProviderExecutorFactory, ModelPoolSpeccrates/awaken/tests/readme_quickstart.rs, crates/awaken-server/tests/config_api.rs
Plugin context injectionPhaseHook, PhaseContext, StateCommand, AddContextMessage, tool filterscrates/awaken-doctest/examples/plugin_registrar.rs, crates/awaken-runtime/src/agent/state/loop_actions.rs
Background workBackgroundTaskManager, BackgroundTaskPlugin, SendMessageTool, CancelTaskToolcrates/awaken-runtime/tests/background_task_lifecycle.rs, crates/awaken-runtime/src/extensions/background/
Sub-agent as a toolrun_child_agent, ChildAgentParams, BackendRunResult.state exportcrates/awaken-runtime/tests/child_agent_seed.rs, crates/awaken-runtime/src/child_agent/mod.rs
Store boundariesThreadRunStore, ConfigStore, ProfileStore, MailboxStore, VersionedRegistryStorecrates/awaken-doctest/examples/thread_store_trait.rs, crates/awaken-stores/tests/
MCP integrationMcpToolRegistryManager, custom transport, sampling handlercrates/awaken-ext-mcp/tests/mcp_tests.rs, crates/awaken-ext-mcp/src/transport.rs
Observability and evalMetricsSink, TraceStore, RuntimeReplayer, JudgeConfigcrates/awaken-ext-observability/tests/, crates/awaken-eval/tests/eval_integration.rs

Start from the task, not the whole system. Find the row that matches what you need next; each spine in the sidebar is self-contained.

I want to…Go to
Make the runtime executableBuild an Agent
Add a tool the model can callAdd a Tool
Stream progress from a long-running toolReport Tool Progress
Call an MCP or external tool serverUse MCP Tools
Load tools lazily to keep the prompt smallUse Deferred Tools
Have a tool run a controlled child agentInvoke a Sub-Agent from a Tool
Have a tool start long work that outlives the turnStart Background Work from a Tool
Inject model context or filter tools from a pluginAdd a Plugin
Stream UI documents alongside textUse Generative UI
Decide what the agent remembers, shares, and persistsState & Storage
Have one agent take over the current conversationUse Agent Handoff
Let independent agents talk or wait for a humanHITL and Mailbox
Coordinate several agentsMulti-Agent Patterns
Expose the runtime over HTTP or a protocolServe & Integrate
Gate a tool behind human approvalEnable Tool Permission HITL (in Tune & Operate)
Tune saved behavior after the code is safeConfigure Agent Behavior (in Tune & Operate)