Search documentation

Browse Awaken Agents docs
Docs/Awaken Agentsv1.0.0-dev/Internal mechanisms/UnderstandExtend Awaken Agents internals
Note·You're reading pre-release documentation (v1.0.0-dev). Interfaces and behavior may change before a stable release.

Internal mechanisms · Understand

Extend Awaken Agents internals

What this page covers

Choose the Rust extension point you need, run one Agent, and preserve Awaken Agents capability, state, and step-commit boundaries.

Use this section only when you need to embed the Rust Runtime or implement a Rust Tool, provider, Plugin, Sandbox backend, or kernel invariant. If you only need to configure, publish, or operate an Agent, start with Awaken Agents. The execution core described here is part of Awaken Agents, not a second product.

Begin by running one immutable ExecutableAgentSnapshot with one model binding and one Tool. The smallest shape is:

let runtime = Runtime::new()
    .with_llm(Arc::new(my_llm))
    .with_tool(Arc::new(search));

let config = ExecutableAgentSnapshot::builder("assistant")
    .instructions("Answer from cited sources.")
    .model(ModelBinding::new("demo", "model", "awaken"))
    .build();

let state = runtime
    .run(&config, "Find the release notes.", RuntimeRunContext::new())
    .await?;

When this returns, one Agent has completed a Runtime run in your Rust process. Next, replace my_llm or search with the capability you are adding and keep the same state and commit path.

Your Rust process owns invocation, IO, scheduling, capability implementations, and deployment. The Awaken Agents execution core owns what happens inside a run: resolve the immutable snapshot, discover and activate Skills, execute the model/tool loop, apply hooks and gates, stage state changes, and commit the step.

Choose the Runtime boundary you need to change

GoalStart hereDo not do this here
Add product capabilityAdd a ToolDo not duplicate tool implementation in a frontend or prompt.
Add lifecycle constraintsAdd a PluginDo not leave permission or state invariants as prompt text alone.
Add a model or external-Agent connectionConfiguration resolution and Agent delegationDo not let an application protocol own runtime state.
Add an isolation or execution backendRuntime–service architectureDo not bypass Agents placement, permission, or commit boundaries.
Change the Runtime kernelArchitecture invariantsDo not create a second state or commit authority.

Application teams usually configure and bind these capabilities in Awaken Agents. Enter this path only to implement a new Rust capability or change Runtime semantics.

One behavior, different capability bindings

Awaken Agents does not pretend local and hosted environments are identical. It makes their differences explicit without forcing agent behavior to fork.

Stable agent contractLocal bindingGoverned binding
SKILL.md discovery and activationLive workspace Skill directoryDelivered catalog or workspace mounted into a sandbox
Neutral tool ids and schemasIn-process read, write, edit, glob, grep, bashScoped in-process, sandbox, MCP, or remote-hand executors
Permission and capability rulesCaller approval in a CLI or applicationCentral policy, approval, credential, and placement decisions
Staged state and step commitApplication-owned coordinator/storeAwaken Agents durable coordinator and recovery

The promise is portable behavior, not identical authority. A Skill’s allowed-tools may narrow the capabilities its host granted, but can never grant filesystem, shell, network, or credential access by itself.

What happens inside one run

  1. The Runtime resolves the immutable snapshot and the capabilities supplied by the host.
  2. It discovers and activates eligible Skills, then calls the model with the current messages and typed state.
  3. A requested Tool passes through capability checks, policy, and any approval gate before execution.
  4. Tool output, messages, events, run state, and state commands remain staged until the step can commit together.
  5. A rejection returns a typed waiting or failure outcome. A process crash leaves the previous commit as the recovery point.

This sequence is the reason to enter Runtime internals. It lets a new capability join the existing loop without creating another state store, permission path, or commit boundary.

When this mattersCommon SDK or graph-runtime baselineAwaken Agents guarantee
A plugin gains accessApplication conventions constrain what it usesUndeclared tool, state, hook, action, guard, or gate access fails closed
The run moves from a laptop to a governed hostRewrite tool wrappers, Skill loading, and prompts for the new environmentKeep Skill and loop semantics; bind a different capability implementation at the host boundary
Parallel tools write stateA reducer or application code resolves conflictsDisjoint, Commutative, and Exclusive merge policy is explicit before commit
A tool needs approvalMiddleware or application state coordinates the pauseA permission verdict produces a typed, resumable waiting outcome on the same path
A process crashesCheckpoints, messages, effects, and logs may use different boundariesMessages, state commands, audit, run state, and disposition share one step commit boundary

Choose a lightweight SDK for minimum setup, LangGraph for graph-centric orchestration, or Rig for broad Rust provider integrations. Extend Awaken Agents when a Tool call has consequences and these execution invariants must stay intact.

The internal boundary

The execution core is not the HTTP service. Public protocols, managed configuration, credentials, durable dispatch, workers, sandboxes, tenancy, and operational endpoints belong to Awaken Agents. Awaken Agents connects these responsibilities through typed, data-only ports; the execution core never depends back on the service plane.

The current durable Skill store persists SKILL.md content. Do not assume a complete local Skill directory, including arbitrary scripts, references, and assets, is automatically packaged and reproduced in every remote sandbox; full bundle materialization is a separate deployment capability.

See the Awaken Agents execution ownership diagram before choosing crates or deployment components.

Continue with the change you need