Skip to main content

Crate agent_core

Crate agent_core 

Source
Expand description

agent-core — the unified agent runtime.

It wraps the codex harness-style agent loop and guarantees the memo contract: every Agent::run first recalls context from memo (now vector/semantic recall — see agent_memo::embed), then after producing a reply memorizes both the user turn and the assistant reply. Tool execution is isolated in a Sandbox.

The LLM is accessed through ModelClient; a deterministic StubModel is the default so the runtime is runnable without an API key. Enable the openai feature to use the real OpenAI Responses/Chat API.

Structs§

ActiveHarness
Hot-swappable handle to the currently-served harness.
Agent
The unified agent. Holds the model client, memo store, sandbox, and a shared handle to the currently-served ActiveHarness (which may be hot-swapped by a self-improvement loop).
AgentConfig
Configuration for constructing an Agent. Serializable for SDK/Ffi.
Harness
The evolvable harness of an agent: system prompt plus its skills and rules. This is the unit Reef-style self-improvement evolves, versions in Git, and hot-serves back to the running agent.
ModelRequest
A single model request.
ModelResponse
A single model response.
Rule
A single named rule — a constraint the agent must obey.
Skill
A single named skill — a reusable capability the agent may draw on.
StubModel
Deterministic stand-in used when no API key / openai feature is present.

Enums§

CoreError

Traits§

ModelClient
LLM access seam. Implement this to plug in any backend.

Functions§

default_sandbox_box
Re-export the default sandbox constructor for callers that don’t need config.
in_memory_memo
Convenience: a memory-backed memo store for quick local use.