bob-adapters
Adapter implementations for the Bob Agent Framework ports.
Overview
bob-adapters provides concrete implementations of the port traits defined in bob-core:
- LLM Adapters: Connect to language models via various providers
- Tool Adapters: Integrate with external tools and MCP servers
- Storage Adapters: Persist session state
- Runtime Extension Adapters: Checkpoints, artifacts, and cost metering
- Runtime Guardrail Adapters: Tool policy and approval adapters
- Observability Adapters: Log and monitor agent events
Features
All adapters are feature-gated to minimize dependencies:
llm-genai(default): LLM adapter using thegenaicratemcp-rmcp(default): Tool adapter for MCP servers viarmcpskills-agent(default): Skill loading and composition viaagent-skillsstore-memory(default): In-memory session storageobserve-tracing(default): Event sink usingtracing
Usage
Add this to your Cargo.toml:
[]
= "0.1"
To disable default features and select specific adapters:
[]
= "0.1"
= false
= ["llm-genai", "mcp-rmcp"]
Example: Creating Adapters
use ;
use Client;
// LLM adapter
let client = default;
let llm = new;
// Tool adapter (MCP server)
let tools = connect_stdio.await?;
// Session store
let store = new;
// Event sink
let events = new;
Example: Using Skills
use ;
let sources = vec!;
let composer = from_sources?;
let rendered = composer.render_bundle_for_input;
Adapters
LLM Adapters (llm-genai)
Connects to LLM providers through the genai crate, supporting:
- OpenAI (GPT-4, GPT-4o-mini, etc.)
- Anthropic (Claude)
- Google (Gemini)
- Groq
- And more...
Tool Adapters (mcp-rmcp)
Connects to MCP (Model Context Protocol) servers:
- Filesystem operations
- Shell commands
- Database queries
- Custom tools
Storage Adapters (store-memory)
In-memory session storage for development and testing:
- Fast in-process storage
- No external dependencies
- Suitable for single-instance deployments
Runtime Extension Adapters
checkpoint_memory::InMemoryCheckpointStore: per-session turn checkpointsartifact_memory::InMemoryArtifactStore: per-session tool-result artifactscost_simple::SimpleCostMeter: optional per-session token budget enforcement
Runtime Guardrail Adapters
policy_static::StaticToolPolicyPort: merges runtime/request allow/deny listsapproval_static::StaticApprovalPort: supportsallow_allordeny_allplus tool denylist
Observability (observe-tracing)
Event sink using the tracing ecosystem:
- Structured logging
- Integration with observability tools
- Configurable log levels
Documentation
Full API documentation is available at docs.rs/bob-adapters.
Related Crates
- bob-core - Domain types and ports
- bob-runtime - Runtime orchestration
- cli-agent - CLI application
License
Licensed under the Apache License, Version 2.0. See LICENSE for details.