ABK (Agent Builder Kit)
Modular utilities for building LLM agents
ABK is a feature-gated Rust crate providing essential utilities for building LLM-based agents. Choose only the components you need via Cargo features.
Features
ABK provides three main feature modules:
config - Configuration Management
- TOML configuration file parsing
- Environment variable loading via
.envfiles - Type-safe configuration structures
- Path resolution helpers
- Validation and defaults
observability - Logging & Metrics
- Markdown-formatted logging for agent sessions
- LLM interaction tracking
- Command execution logging
- Tool execution logging
- Session lifecycle management
- Debug-level message inspection
cli - CLI Display Utilities
Coming soon - will be extracted from simpaticoder
- Panel and message box rendering
- Time formatting utilities
- Text truncation and formatting
- Color and styling helpers
Installation
Add to your Cargo.toml:
[]
# Enable only the features you need:
= { = "0.1", = ["config"] }
# Or enable multiple features:
= { = "0.1", = ["config", "observability"] }
# Or enable everything:
= { = "0.1", = ["all"] }
Usage
Configuration Feature
use ;
use Path;
// Load environment variables
let env = new;
// Load configuration from TOML
let config_loader = new.unwrap;
let config = &config_loader.config;
// Access configuration
println!;
println!;
Configuration Structure
The Configuration struct includes:
- Agent: Core agent settings (name, version, user agent)
- Templates: Template paths and settings
- Logging: Logging configuration (level, format, targets)
- Execution: Execution limits (timeout, retries, max iterations)
- Modes: Operation modes (auto-approve, dry-run, verbose)
- Tools: Tool-specific configuration (file window size, result limits)
- Search Filtering: Directory and file filtering for search operations
- LLM: LLM provider configuration (endpoint, streaming)
Environment Variables
The EnvironmentLoader handles:
.envfile loading (if provided)- System environment variable access
- Provider selection via
LLM_PROVIDER
Observability Feature
use Logger;
use HashMap;
// Create a logger with custom path and log level
let logger = new.unwrap;
// Or use default (temp directory, INFO level)
let logger = default;
// Log a session start
let config = new;
logger.log_session_start.unwrap;
// Log LLM interactions
let messages = vec!; // Your message history
logger.log_llm_interaction.unwrap;
// Log command executions
logger.log_command_execution.unwrap;
// Log tool executions
logger.log_tool_execution.unwrap;
// Log completion
logger.log_completion.unwrap;
Roadmap
ABK is part of the larger Trustee ecosystem extraction from simpaticoder.
- ✅ Phase 1:
configfeature (v0.1.0 - extracted from trustee-config) - ✅ Phase 2:
observabilityfeature (v0.1.1 - extracted from simpaticoder/src/logger) - ⏳ Phase 3:
clifeature (extracting from simpaticoder/src/cli/commands/utils.rs)
Why ABK?
Instead of maintaining separate trustee-config, trustee-observability, and trustee-cli crates, ABK unifies them under one package with feature flags. This provides:
- Unified versioning - One version number for all infrastructure utilities
- Simplified dependencies - Import one crate instead of three
- Modular builds - Only compile what you use
- Coordinated releases - Breaking changes managed together
License
Dual-licensed under MIT OR Apache-2.0