Skip to main content

Crate paladin

Crate paladin 

Source
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 (requires cli feature flag)
  • Binary entry pointsmain.rs (default binary) and bin/paladin-cli.rs (requires cli feature 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

CrateCapability
paladin-coreDomain entities, base types, pure business logic
paladin-portsPort trait definitions (output and input ports)
paladin-battalionMulti-agent coordination patterns
paladin-llmLLM provider adapters (OpenAI, Anthropic, DeepSeek)
paladin-memoryGarrison memory adapters (in-memory, SQLite, vector)
paladin-notificationsNotification channel adapters
paladin-storageStorage adapters (SQLite, MySQL, MinIO/S3)
paladin-contentContent processing and ingestion
paladin-webWeb 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 support
  • s3-storage (default): MinIO/S3 file storage support
  • mysql-backend: MySQL database backend
  • sqlite-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§

BattalionConfig
Configuration for Battalion operations
LlmProviderFactory
Factory for creating LLM provider adapters by name.
MockLlmAdapter
Configurable mock adapter for the LlmPort trait.
MultiStepMockLlmPort
A mock adapter that returns different responses for successive calls.
OpenAIAdapter
OpenAI LLM adapter implementing LlmPort.
OpenAIConfig
Configuration for the OpenAI adapter.
PaladinConfig
Runtime configuration for Paladin execution
PaladinData
Core data payload for a Paladin entity

Enums§

BattalionError
Error types for Battalion operations
PaladinStatus
Status of a Paladin during its lifecycle

Type Aliases§

Paladin
Type alias for a Paladin entity following the Node<T> pattern