Expand description
§Paladin - Enterprise Multi-Agent Orchestration Framework
Paladin is a Rust-based enterprise multi-agent orchestration framework built with Hexagonal Architecture (Ports & Adapters) and Domain-Driven Design principles. It enables the creation, coordination, and scaling of intelligent AI agents (Paladins) through configurable orchestration patterns with comprehensive LLM integration.
§Core Concepts
- Paladin: Autonomous AI agent capable of reasoning and action
- Battalion: Multi-agent coordination patterns (Formation, Phalanx, Campaign, Chain of Command)
- Garrison: Conversation memory and context storage
- Arsenal: External tool execution via MCP (Model Context Protocol)
- Sanctum: Vector storage for semantic search and RAG
- Citadel: State persistence and recovery
§Architecture
The framework follows hexagonal architecture with three layers:
- Core Layer (
core): Pure business logic with zero external dependencies - Application Layer (
application): Application services and coordination logic - Infrastructure Layer (
infrastructure): Adapter implementations for external systems
§Facade Crate Role
The paladin crate is the application assembly point and composition root for the
Paladin workspace. It wires together all leaf crates into a runnable application.
§What this crate contains
ServiceRunner— the composition root that assembles and starts all services- Application services (
src/application/services/) — coordination logic for agents, battalions, arsenals, orchestration, herald, sanctum, and more - Configuration (
src/config/) — settings types and multi-source config loading - CLI modules (
src/application/cli/) — command implementations (requiresclifeature flag) - Binary entry points —
main.rs(default binary) andbin/paladin-cli.rs(requiresclifeature flag)
§What this crate does NOT contain
Business logic, port trait definitions, and infrastructure adapter implementations live exclusively in the leaf crates. The facade only assembles them.
§Leaf crates
| Crate | Capability |
|---|---|
paladin-core | Domain entities, base types, pure business logic |
paladin-ports | Port trait definitions (output and input ports) |
paladin-battalion | Multi-agent coordination patterns |
paladin-llm | LLM provider adapters (OpenAI, Anthropic, DeepSeek) |
paladin-memory | Garrison memory adapters (in-memory, SQLite, vector) |
paladin-notifications | Notification channel adapters |
paladin-storage | Storage adapters (SQLite, MySQL, MinIO/S3) |
paladin-content | Content processing and ingestion |
paladin-web | Web API adapter (Axum-based REST server) |
Dependency direction: facade → leaf crates (one direction only). Leaf crates must never import from the facade.
§Stable Public API
This library exports a curated stable public API defined in STABLE_API.md. The API follows semantic versioning with strong backwards compatibility guarantees:
- Port Traits: Primary extension points for integrating external systems
- Domain Entities: Core business types (Paladin, Battalion, etc.)
- Builders: Fluent construction patterns
- Configuration: Application settings types
- Errors: Comprehensive error enums
- Base Types: Generic framework primitives
§Quick Start
use paladin::{PaladinBuilder, LlmPort};
use std::sync::Arc;
// Create a Paladin agent
let paladin = PaladinBuilder::new(llm_port)
.name("ResearchAgent")
.system_prompt("You are a helpful research assistant.")
.max_loops(5)
.build()?;
// Execute the agent
let result = paladin_service.execute(&paladin, "Analyze the market trends").await?;
println!("Response: {}", result.output);§Feature Flags
redis-queue(default): Redis-based async queue supports3-storage(default): MinIO/S3 file storage supportmysql-backend: MySQL database backendsqlite-backend: SQLite database backend
§Documentation
§Stability Guarantee
All types exported from this module are part of the stable public API and follow semantic versioning. Breaking changes will only occur in major version bumps. See STABLE_API.md for details.
Modules§
- application
- Application layer: Use cases and port trait definitions Application Layer
- config
- Configuration management
- core
- Core domain layer: Pure business logic Core Domain Layer
- infrastructure
- Infrastructure layer: Adapter implementations Infrastructure Layer
- prelude
- Prelude: convenient re-exports of the most commonly used types. Convenient re-exports of the most commonly used Paladin types.
Structs§
- Battalion
Config - Configuration for Battalion operations
- LlmProvider
Factory - Factory for creating LLM provider adapters by name.
- Mock
LlmAdapter - Configurable mock adapter for the
LlmPorttrait. - Multi
Step Mock LlmPort - A mock adapter that returns different responses for successive calls.
- OpenAI
Adapter - OpenAI LLM adapter implementing
LlmPort. - OpenAI
Config - Configuration for the OpenAI adapter.
- Paladin
Config - Runtime configuration for Paladin execution
- Paladin
Data - Core data payload for a Paladin entity
Enums§
- Battalion
Error - Error types for Battalion operations
- Paladin
Status - Status of a Paladin during its lifecycle
Type Aliases§
- Paladin
- Type alias for a Paladin entity following the
Node<T>pattern