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.
[]
= "0.2"
When to depend on this
Most users should cargo add agnt instead — the flagship crate pulls in
agnt-core plus agnt-net, agnt-store, and agnt-tools as optional
features and gives you a working agent runtime.
Depend directly on agnt-core when:
- You want the minimum possible dependency footprint (only
serde,serde_json,tracing) - You're targeting WASM —
agnt-corehas no filesystem, TLS, or process-spawning deps that would blockwasm32-*builds - You're bringing your own backend (implementing [
LlmBackend]) and your own persistence (implementing [MessageStore]) - You're embedding the agent loop into a larger system with pre-existing HTTP and persistence layers
What it provides
- [
Agent<B: LlmBackend>] — the core loop (message → inference → parallel tool dispatch → loop) - [
AgentBuilder] — fluent construction - [
Tool] (erased) and [TypedTool] (typedArgs/Output/Error) traits, with [ErasedAdapter] bridging typed impls into the erased dispatch path - [
Registry] — name-based tool dispatch - [
Message], [ToolCall], [FunctionCall] — the internal wire format - [
LlmBackend] and [BackendError] — trait any backend implements - [
MessageStore], [StoreError], [ToolLog] — trait any store implements - [
Observer] — lifecycle hook trait for HITL approval, audit, metrics tracinginstrumentation atagnt.step,agnt.backend.chat,agnt.toolspan boundaries
Security
See the threat model.
agnt-core handles tool output envelope framing (<tool_output>) and
enforces the 64KB per-result byte cap. Filesystem sandboxing and SSRF
guards live in agnt-tools.
License
Dual-licensed under MIT OR Apache-2.0.