| Crates.io | universal-bot-core |
| lib.rs | universal-bot-core |
| version | 1.0.0 |
| created_at | 2025-08-17 21:22:24.923775+00 |
| updated_at | 2025-08-17 21:22:24.923775+00 |
| description | Core functionality for Universal Bot AI automation framework with AWS Bedrock |
| homepage | https://github.com/paiml/universal-bot |
| repository | https://github.com/paiml/universal-bot |
| max_upload_size | |
| id | 1799719 |
| size | 278,129 |
Enterprise-grade AI automation framework integrating AWS Bedrock, PDMT templating, and AssetGen content generation into a unified, production-ready platform.
Universal Bot is a comprehensive AI-powered automation framework that combines cutting-edge technologies from production systems:
universal-bot/
โโโ core/ # Core Rust components
โ โโโ bedrock/ # AWS Bedrock client implementation
โ โ โโโ client.rs # Connection pooling & retry logic
โ โ โโโ models.rs # Model configuration & selection
โ โ โโโ metrics.rs # Token usage & cost tracking
โ โโโ pdmt/ # Template engine
โ โ โโโ engine.rs # Handlebars-based generation
โ โ โโโ validators.rs # Todo validation & scoring
โ โ โโโ quality.rs # Quality gate enforcement
โ โโโ providers/ # AI provider abstractions
โ โโโ bedrock.rs # AWS Bedrock provider
โ โโโ mcp.rs # MCP protocol provider
โโโ generators/ # Content generation modules
โ โโโ quiz/ # Quiz generation with validation
โ โโโ blog/ # Blog post generation
โ โโโ marketing/ # Multi-platform marketing
โ โโโ educational/ # Labs, reflections, key terms
โโโ validators/ # Validation components
โ โโโ content.rs # Meta-aware content validation
โ โโโ quality.rs # Quality gate checks
โ โโโ structure.rs # Course structure validation
โโโ integrations/ # External integrations
โโโ github/ # GitHub API & Actions
โโโ aws/ # S3, Bedrock services
โโโ mcp/ # Model Context Protocol
[dependencies]
universal-bot-core = "1.0"
# Clone the repository
git clone https://github.com/paiml/universal-bot
cd universal-bot
# Install dependencies
make install
# Configure AWS credentials
aws configure
# Run tests to verify setup
make test
# Start the bot
cargo run --bin universal-bot
universal-bot-rust/
โ
โโโ ๐ฆ core/ # The 80% - Universal AI Brain
โ โโโ src/
โ โ โโโ bedrock/ # AWS Bedrock client & models
โ โ โ โโโ client.rs # Connection management
โ โ โ โโโ models.rs # Model orchestration
โ โ โ โโโ streaming.rs # Real-time responses
โ โ โ
โ โ โโโ conversation/ # Conversation engine
โ โ โ โโโ pipeline.rs # Message processing
โ โ โ โโโ state.rs # State machines
โ โ โ โโโ context.rs # Memory management
โ โ โ
โ โ โโโ plugins/ # Extension system
โ โ โ โโโ traits.rs # Plugin interfaces
โ โ โ โโโ registry.rs # Plugin management
โ โ โ โโโ builtin/ # Core plugins
โ โ โ
โ โ โโโ lib.rs # Public API
โ โ
โ โโโ examples/ # Runnable demonstrations
โ โ โโโ basic_conversation.rs
โ โ โโโ multi_model_chat.rs
โ โ โโโ stream_conversation.rs
โ โ โโโ plugin_demo.rs
โ โ
โ โโโ Cargo.toml # Dependencies
โ
โโโ ๐ adapters/ # The 20% - Platform Theory
โ โโโ discord_theory.md # Discord architecture (no code)
โ โโโ slack_theory.md # Slack patterns (conceptual)
โ โโโ web_api_theory.md # REST endpoints (theory)
โ โโโ integration_patterns.md # General adapter design
โ
โโโ ๐ course/ # Video course materials
โ โโโ module_1/ # Foundation videos
โ โโโ module_2/ # Core engine videos
โ โโโ module_3/ # Advanced patterns
โ โโโ module_4/ # Plugin architecture
โ โโโ module_5/ # Platform theory
โ
โโโ ๐ docs/ # Documentation
โ โโโ architecture.md # System design
โ โโโ bedrock_setup.md # AWS configuration
โ โโโ rust_patterns.md # Rust best practices
โ โโโ deployment.md # Production guide
โ
โโโ ๐งช tests/ # Test suite
โ โโโ integration/ # End-to-end tests
โ โโโ unit/ # Component tests
โ
โโโ ๐ง scripts/ # Utility scripts
โโโ setup.sh # Environment setup
โโโ test.sh # Run all tests
โโโ deploy.sh # Deployment helper
Think of messages flowing through a factory assembly line:
Raw Input Enriched Routed
โ โ โ
โผ โผ โผ
โโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ
โ Sanitizeโ โโโโโโโโโโโบ โ Context โ โโโโโโโโโโโโบ โ Model โ
โโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ
โ Display โ โโโโโโโโโโโ โ Format โ โโโโโโโโโโโ โ AI โ
โโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ
Final Output Structured Response
Like LEGO blocks with standardized connectors:
pub trait BotPlugin {
async fn process(&self, input: Message) -> Result<Message>;
fn capabilities(&self) -> Vec<Capability>;
}
// Any plugin can connect if it fits the trait
impl BotPlugin for WeatherPlugin { ... }
impl BotPlugin for DatabasePlugin { ... }
impl BotPlugin for CustomPlugin { ... }
# Run all tests
make test
# Run specific test suite
cargo test --package universal-bot-core
# Run property tests
cargo test --features property-testing
# Run integration tests
cargo test --test integration
# Generate coverage report
make coverage
# Run linting and formatting
make lint
cargo fmt --check
cargo clippy -- -D warnings
use universal_bot::{BotCore, BedrockConfig, Message};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Initialize the universal brain
let config = BedrockConfig::from_env()?;
let bot = BotCore::new(config).await?;
// Process a message (platform-agnostic)
let input = Message::text("Hello, what can you do?");
let response = bot.process(input).await?;
println!("๐ค {}", response.content);
// This same bot core could connect to:
// - Discord (with adapter)
// - Slack (with adapter)
// - Web API (with adapter)
// - Any platform (with adapter)
Ok(())
}
We welcome contributions! See CONTRIBUTING.md for guidelines.
Track your learning journey:
- [x] Module 1: Foundation
- [x] Module 2: Core Engine
- [ ] Module 3: Advanced AI
- [ ] Module 4: Plugins
- [ ] Module 5: Platform Theory
- [ ] Final Project: Custom Bot Brain
Complete all modules and build a custom bot brain to earn:
Week 1: "I can connect to AWS Bedrock from Rust"
Week 2: "I built a conversation engine"
Week 3: "My bot uses multiple AI models"
Week 4: "I created custom plugins"
Week 5: "I understand how to adapt this anywhere"
Final: "I have a production-ready AI brain"
This project is licensed under the MIT License - see LICENSE file for details.
๐ง Stop Building Bots. Start Building Brains. ๐ง
The future isn't platform-specific. It's universally intelligent.
Start Course โข Watch Videos โข Join Community