cabal

Crates.iocabal
lib.rscabal
version0.1.0
created_at2025-12-14 22:53:54.919319+00
updated_at2025-12-14 22:53:54.919319+00
descriptionHierarchical agent orchestration system - the scheming group
homepage
repositoryhttps://github.com/moltenlabs/molten
max_upload_size
id1985228
size89,697
Chris Mathew (chriscmathew-dorsia)

documentation

README

🎭 Cabal

Hierarchical agent orchestration system - the scheming group.

Crates.io Documentation License

Overview

Cabal is the orchestration layer for hierarchical AI agent systems. It manages agent lifecycles, coordinates task execution, and handles communication between agents.

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                          ORCHESTRATOR (Level 0)                      β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”               β”‚
β”‚  β”‚ Task Planner β”‚  β”‚ Agent Factoryβ”‚  β”‚ Result Mergerβ”‚               β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
         β–Ό                   β–Ό                   β–Ό
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚ Domain Lead β”‚     β”‚ Domain Lead β”‚     β”‚ Domain Lead β”‚
  β”‚  (Level 1)  β”‚     β”‚  (Level 1)  β”‚     β”‚  (Level 1)  β”‚
  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
         β”‚                   β”‚                   β”‚
    β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”
    β–Ό         β–Ό         β–Ό         β–Ό         β–Ό         β–Ό
 β”Œβ”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”
 β”‚ W1  β”‚  β”‚ W2  β”‚    β”‚ W3  β”‚  β”‚ W4  β”‚    β”‚ W5  β”‚  β”‚ W6  β”‚
 β””β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”˜

Features

  • πŸ—οΈ Hierarchical agent spawning
  • πŸ“¨ Op/Event communication protocol
  • πŸ”„ Session management
  • πŸ‘₯ Agent lifecycle management
  • πŸ“Š Token usage tracking

Installation

[dependencies]
cabal = "0.1"

Usage

use cabal::{Orchestrator, GoblinChannel, Op, Event};
use trinkets::ToolRegistry;

#[tokio::main]
async fn main() {
    // Create orchestrator with tool registry
    let registry = ToolRegistry::new();
    let (orchestrator, channel) = Orchestrator::with_channel(registry);

    // Spawn orchestrator in background
    tokio::spawn(orchestrator.run());

    // Send operations
    channel.send(Op::user_input("Build a REST API")).unwrap();

    // Handle events
    while let Some(event) = channel.recv().await {
        match event {
            Event::AgentSpawned { agent_id, role, .. } => {
                println!("Agent {} spawned as {:?}", agent_id, role);
            }
            Event::TaskComplete { result, .. } => {
                println!("Done: {}", result.summary);
                break;
            }
            _ => {}
        }
    }
}

Agent Roles

use warhorn::AgentRole;

// Orchestrator - top-level coordinator
let orchestrator = AgentRole::Orchestrator;

// Domain leads - coordinate specific areas
let frontend_lead = AgentRole::DomainLead { 
    domain: "frontend".into() 
};

// Workers - execute specific tasks
let worker = AgentRole::Worker;

// Specialists - experts in specific areas
let security = AgentRole::Specialist { 
    specialty: "security".into() 
};

Part of the Goblin Family

License

MIT OR Apache-2.0

Commit count: 0

cargo fmt