Skip to content

Introduction

Awaken is a production AI agent backend written in Rust. Build tools, state, and plugins once in code; tune agents, models, and prompts live through config; then serve in-process apps, production APIs, protocol frontends, and the admin console from the same runtime. Modules and plugins opt in where they own storage, secrets, or policy.

Dependency snippets on this site follow the current main-branch API. Use the git dependency shown in examples until the next crates.io release lands; use the migration guide when upgrading from the published 0.5 line.

Awaken is useful as both a library and a service. Both modes use the same AgentRuntime, RunActivation, AgentSpec, tools, plugins, and event stream; the difference is who owns IO and configuration.

ModeHow it runsUse it when
In-process runtimeYour Rust process builds AgentRuntime with AgentRuntimeBuilder, registers tools/providers/plugins in code, and calls runtime.run_to_completion(...) or runtime.run(..., EventSink) directly.CLI tools, local workers, tests, or application services that already own their IO boundary.
Server control planeawaken-server stores an Arc<AgentRuntime>, queues work through mailbox-backed run dispatch, and exposes HTTP/SSE plus AI SDK, AG-UI, A2A, MCP, and ACP adapters. Normal /v1/config/* writes validate config, compile a candidate registry, and hot-swap the published snapshot for later runs.Shared agent backends, browser frontends, managed providers/models/agents, auditability, HITL, eval, and operator control.

In-process runtime mode is still a standard Rust async library mode, not a no_std or Tokio-free embedded-device target. awaken-runtime currently depends on Tokio for timers, timeouts, async coordination, and HTTP/provider execution.

Current IO/runtime boundary:

ComponentTokio / IO profile
awaken-runtimeRequires Tokio. The phase loop is in-process, but the crate includes genai / reqwest provider paths and Tokio-based timeout/retry/background-task machinery.
awaken-runtime-contract / awaken-server-contractContract/type surfaces only; useful for API boundaries, but still target std Rust crates, not no_std embedded targets.
Permission, Reminder, Deferred Tools, Generative UIMostly in-process policy/state/event logic, but they depend on the runtime contract/runtime stack and therefore inherit the Tokio/std assumption.
MCP and SkillsIO-capable: MCP uses network/stdio/process transports; Skills can read skill packages from disk, spawn configured commands, and optionally register MCP tools.
ObservabilityIn-memory recording is local; OTLP/file/metrics exporters introduce external IO.
Stores and ServerExplicit IO layers: memory/file/PostgreSQL/SQLite/NATS stores, HTTP routes, SSE, mailbox workers, and protocol replay.

In both modes, Rust code supplies executable capabilities: Tool implementations, plugins, provider factories, stores, and backend factories. Managed config supplies agent behavior: prompts, tool description overrides, system reminders, model_id, model pools, allowed/excluded tools, plugin sections, MCP servers, skills, delegates, and permission rules. The admin console is the browser UI over the server mode; it does not replace the runtime.

Server mode adds the pieces that a direct runtime caller otherwise has to build: HTTP/SSE, protocol adapters, mailbox dispatch, resumable background runs, managed config publication, version restore, audit trails, scoped stores, and admin-console tuning. Runtime mode is the developer library; server mode is the operational product surface around that library.

Three design rules drive everything else:

1 — Tools live in code, prompts live in config

Section titled “1 — Tools live in code, prompts live in config”

Code defines tools (typed schemas, state writes, deferred loading). Spec/config holds agent system prompts, tool descriptions, reminders, ToolSearch policy, skill catalogs, explicit delegates, and permission rules.

Editing config takes effect on the next run. No restart, no redeploy, no schema migration. MCP servers refresh automatically via the tools/list_changed notification; on-disk skill packages refresh via a PeriodicRefresher you start once at bootstrap. The runtime re-resolves from the latest published config snapshot on each new run.

With audit and versioned-registry stores enabled, those edits are traceable through record revisions and audit restore; published runtime snapshots are immutable, and durable runs carry a resolution_id to reselect the same graph for resume or replay.

/v1/config/* is the single mutation surface for agents, models, providers, model pools, MCP servers, skills, and plugin-backed policy sections. The bundled admin console is one consumer; your CI can be another.

What the console writes, the runtime reads. There is no separate ops project to maintain.

3 — Observability/eval/HITL are runtime modules

Section titled “3 — Observability/eval/HITL are runtime modules”

Started services can attach:

  • OpenTelemetry GenAI traces on every phase, tool, and LLM call (awaken-ext-observability).
  • A persistent trace store the admin console queries directly; trace HTTP routes are opt-in.
  • An eval framework with fixture replay, scoring, and baseline diffing (awaken-eval).
  • Permission-gated HITL via mailbox suspend/resume.

These are first-class runtime and server modules, not separate sidecars.

The above three rules combine to give four properties most agent frameworks lack:

  • Snapshot isolation + deterministic replay. Each phase reads an immutable Snapshot, emits a MutationBatch; commit applies atomically. Saved snapshots replay byte-for-byte — debug, regression-test, or re-run eval over past traffic without re-paying LLM cost.
  • One backend, multiple protocol adapters. One runtime serves AI SDK v6, AG-UI (CopilotKit), A2A, MCP HTTP, and ACP stdio from one process. Client protocol choice does not propagate to agent code.
  • Permission gates as runtime primitives. Gate phase runs between tool decision and tool execution; Allow / Deny / Ask rules match on name + arguments; Ask suspends through mailbox and resumes when answered.
  • Generative UI as streamed primitive. Agents emit A2UI / JSON Render / OpenUI Lang documents on the same event stream as text. Frontend renders without per-tool glue.
CrateDescription
awaken-runtime-contractRuntime-facing contracts: specs, tools, events, state, commit coordinator
awaken-server-contractServer/store-facing contracts: queries, scoped stores, mailbox/outbox, staged commits
awaken-runtimePhase loop, plugin system, agent loop, builder
awaken-serverHTTP/SSE gateway + protocol adapters
awaken-storesStorage backends: memory, file, Postgres, SQLite mailbox
awaken-tool-patternGlob/regex tool matching for permission and reminder rules
awaken-ext-permissionPermission plugin (allow/deny/ask)
awaken-ext-observabilityOpenTelemetry traces + metrics
awaken-evalFixture replay, scoring, and baseline diffing
awaken-ext-mcpMCP client integration
awaken-ext-skillsSkill package discovery and activation
awaken-ext-reminderDeclarative reminder rules
awaken-ext-generative-uiA2UI / JSON Render / OpenUI Lang
awaken-ext-deferred-toolsDeferred tool loading with probabilistic promotion
awakenFacade crate re-exporting core modules
  1. Get StartedFirst Agent.
  2. Develop Agents — implement tools, plugins, state, sub-agent calls, and UI streams in Rust.
  3. Tune & Operate — use the Admin Console or config API to manage prompts, models, MCP, skills, policies, traces, datasets, and evals.
  4. Serve & Integrate — AI SDK / CopilotKit / A2A / MCP / ACP clients.
  5. State & Storage — persistence and durable state.
  6. Design Philosophy — the “why” behind the three rules.