agentlib-core
The foundational crate for the AgentLib framework. It defines the core traits, types, and runtime logic required to build and execute AI agents.
Core Components
- AgentInstance: The primary runtime for an agent, managing state, tools, and middleware.
- Traits:
Agent: Define the identity and tool registration for your agent.ModelProvider: Interface for integrating any LLM.MemoryProvider: Interface for persistent or ephemeral conversation storage.ReasoningEngine: Abstraction for different thinking strategies.Tool: Contract for extending agent capabilities.
- Middleware System: Intercept and modify execution at different scopes (Run, Step, Tool).
Usage
use ;
use Arc;
;
let agent = create_agent;
Features
- Type-safe execution context.
- Modular provider-based architecture.
- Built-in token usage tracking.
- Context-aware tool execution.