Skip to main content

Crate agnt_core

Crate agnt_core 

Source
Expand description

§agnt-core

The zero-I/O kernel of the agnt agent runtime. Defines the message types, tool trait, backend abstraction, persistence abstraction, observer hooks, and the synchronous agent loop itself — with no HTTP, no SQLite, and no async runtime dependencies.

Users who want a working agent typically depend on the flagship agnt meta-crate which pulls in agnt-net, agnt-store, and agnt-tools as well. Users building custom backends, custom stores, or WASM targets can depend on agnt-core alone and wire up their own implementations of LlmBackend and MessageStore.

§Architecture

agnt (flagship re-export)
  ├── agnt-core      ← you are here
  ├── agnt-net       (HTTP backend implementation)
  ├── agnt-store     (SQLite message store implementation)
  └── agnt-tools     (built-in tools: read_file, grep, fetch, etc.)

Re-exports§

pub use agent::Agent;
pub use backend_trait::BackendError;
pub use backend_trait::LlmBackend;
pub use builder::AgentBuilder;
pub use message::FunctionCall;
pub use message::Message;
pub use message::ToolCall;
pub use observer::Disposition;
pub use observer::Observer;
pub use observer::StepContext;
pub use observer::ToolResult;
pub use store_trait::MessageStore;
pub use store_trait::StoreError;
pub use store_trait::ToolLog;
pub use tool::ErasedAdapter;
pub use tool::Registry;
pub use tool::Tool;
pub use tool::TypedTool;

Modules§

agent
The agent loop — message → inference → parallel tool dispatch → loop.
backend_trait
The LlmBackend trait — abstract LLM inference provider.
builder
Builder pattern for Agent and backend construction.
message
Message types shared between backend, agent loop, and store.
observer
The Observer trait — single extension point for lifecycle hooks.
store_trait
The MessageStore trait — abstract session persistence.
tool
The Tool trait — agent-callable capabilities.