Skip to main content

bob_adapters/
lib.rs

1//! # Bob Adapters
2//!
3//! Adapter implementations for the [Bob Agent Framework](https://github.com/longcipher/bob) ports.
4//!
5//! ## Overview
6//!
7//! This crate provides concrete implementations of the port traits defined in [`bob_core`]:
8//!
9//! - **LLM Adapters**: Connect to language models via various providers
10//! - **Tool Adapters**: Integrate with external tools and MCP servers
11//! - **Storage Adapters**: Persist session state
12//! - **Observability Adapters**: Log and monitor agent events
13//!
14//! ## Features
15//!
16//! All adapters are feature-gated to minimize dependencies:
17//!
18//! - **`llm-genai`** (default): LLM adapter using the [`genai`](https://crates.io/crates/genai)
19//!   crate
20//! - **`mcp-rmcp`** (default): Tool adapter for MCP servers via [`rmcp`](https://crates.io/crates/rmcp)
21//! - **`skills-agent`** (default): Skill loading and composition via [`agent-skills`](https://crates.io/crates/agent-skills)
22//! - **`store-memory`** (default): In-memory session storage
23//! - **`observe-tracing`** (default): Event sink using [`tracing`](https://crates.io/crates/tracing)
24//!
25//! ## Example
26//!
27//! ```rust,ignore
28//! use bob_adapters::{
29//!     llm_genai::GenAiLlmAdapter,
30//!     mcp_rmcp::McpToolAdapter,
31//!     store_memory::InMemorySessionStore,
32//!     observe::TracingEventSink,
33//! };
34//! use genai::Client;
35//!
36//! // LLM adapter
37//! let client = Client::default();
38//! let llm = GenAiLlmAdapter::new(client);
39//!
40//! // Tool adapter (MCP server)
41//! let tools = McpToolAdapter::connect_stdio(
42//!     "filesystem",
43//!     "npx",
44//!     &["-y", "@modelcontextprotocol/server-filesystem", "/tmp"],
45//!     &[],
46//! ).await?;
47//!
48//! // Session store
49//! let store = InMemorySessionStore::new();
50//!
51//! // Event sink
52//! let events = TracingEventSink::new();
53//! ```
54//!
55//! ## Adapters
56//!
57//! ### LLM Adapters (`llm-genai`)
58//!
59//! Connects to LLM providers through the `genai` crate, supporting:
60//! - OpenAI (GPT-4, GPT-4o-mini, etc.)
61//! - Anthropic (Claude)
62//! - Google (Gemini)
63//! - Groq
64//! - And more...
65//!
66//! ### Tool Adapters (`mcp-rmcp`)
67//!
68//! Connects to [MCP (Model Context Protocol)](https://modelcontextprotocol.io/) servers:
69//! - Filesystem operations
70//! - Shell commands
71//! - Database queries
72//! - Custom tools
73//!
74//! ### Storage Adapters (`store-memory`)
75//!
76//! In-memory session storage for development and testing:
77//! - Fast in-process storage
78//! - No external dependencies
79//! - Suitable for single-instance deployments
80//!
81//! ### Observability (`observe-tracing`)
82//!
83//! Event sink using the `tracing` ecosystem:
84//! - Structured logging
85//! - Integration with observability tools
86//! - Configurable log levels
87//!
88//! ## Related Crates
89//!
90//! - [`bob_core`] - Domain types and ports
91//! - [`bob_runtime`] - Runtime orchestration
92//!
93//! [`bob_core`]: https://docs.rs/bob-core
94//! [`bob_runtime`]: https://docs.rs/bob-runtime
95
96pub use bob_core as core;
97
98#[cfg(feature = "llm-genai")]
99pub mod llm_genai;
100
101#[cfg(feature = "mcp-rmcp")]
102pub mod mcp_rmcp;
103
104#[cfg(feature = "skills-agent")]
105pub mod skills_agent;
106
107pub mod approval_static;
108pub mod artifact_memory;
109pub mod checkpoint_memory;
110pub mod cost_simple;
111pub mod policy_static;
112pub mod store_memory;
113
114#[cfg(feature = "observe-tracing")]
115pub mod observe;