bob-core
Core domain types and port traits for the Bob Agent Framework.
Overview
bob-core defines the hexagonal boundary of the Bob Agent Framework using the ports and adapters architecture pattern. This crate contains:
- Domain Types: Core data structures used throughout the framework
- Port Traits: Abstract interfaces that adapters must implement
- Error Types: Comprehensive error definitions for all components
This crate intentionally contains no concrete implementations — only contracts.
Architecture
The crate defines four primary port traits:
LlmPort- Interface for language model interactionsToolPort- Interface for tool/system operationsSessionStore- Interface for session state persistenceEventSink- Interface for event observation and logging
Usage
Add this to your Cargo.toml:
[]
= "0.1"
Example: Implementing a Custom LLM Adapter
use ;
use async_trait;
;
Features
- Zero-cost abstractions: All traits use
async_traitfor async support - Type-safe: Strong typing throughout with comprehensive error handling
- Serializable: All domain types implement
serde::SerializeandDeserialize - Thread-safe: All traits require
Send + Sync
Documentation
Full API documentation is available at docs.rs/bob-core.
Related Crates
- bob-runtime - Runtime orchestration layer
- bob-adapters - Concrete adapter implementations
- bob-cli - CLI application
License
Licensed under the Apache License, Version 2.0. See LICENSE for details.