astrid-runtime
Agent orchestration and session management for Astrid.
Overview
This crate provides the core runtime that coordinates all Astrid components:
- LLM Provider - Language model interactions
- MCP Client - Tool execution via Model Context Protocol
- Capability Store - Authorization and access control
- Audit Log - Security logging with cryptographic proofs
Features
- Agent Runtime - Unified orchestration of LLM, MCP, and security layers
- Session Management - Persistent sessions with metadata tracking
- Context Management - Auto-summarization to stay within token limits
- Streaming Support - Real-time response streaming via Frontend trait
Usage
use ;
use ClaudeProvider;
use McpClient;
use AuditLog;
use KeyPair;
// Create components
let llm = from_env?;
let mcp = from_default_config?;
let audit_key = generate;
let runtime_key = generate;
let audit = in_memory?;
let sessions = default_dir?;
// Create runtime
let runtime = new;
// Create a session
let mut session = runtime.create_session;
// Run a turn (requires a Frontend implementation)
// runtime.run_turn_streaming(&mut session, "Hello!", &frontend).await?;
Key Types
| Type | Description |
|---|---|
AgentRuntime |
Main orchestrator coordinating all components |
RuntimeConfig |
Configuration for runtime behavior |
AgentSession |
Active session with conversation state |
SessionStore |
Persistent storage for sessions |
ContextManager |
Manages context window and summarization |
License
This crate is licensed under the MIT license.