Skip to main content

Crate hanzo_agents

Crate hanzo_agents 

Source
Expand description

Hanzo Agents - Specialized AI agents for development workflows

This crate provides pre-built agent types that can be used across hanzo-dev (CLI) and hanzo-node for consistent AI-powered development assistance.

§Agent Types

  • Architect Agent: High-level system design and architectural decisions
  • CTO Agent: Technical leadership, code quality, and best practices
  • Reviewer Agent: Code review, quality assurance, and suggestions
  • Explorer Agent: Codebase exploration and documentation
  • Planner Agent: Task planning and implementation strategy

§Architecture

The agent system follows patterns from hanzo-engine:

  • Trait-based extensibility: Tools implement a consistent callback interface
  • MCP integration: Tools can be provided via Model Context Protocol servers
  • OpenAI compatibility: Tool calling uses OpenAI-compatible format
  • Async-first design: All APIs are async with proper concurrency control

§Example

use hanzo_agents::{AgentRegistry, AgentType, AgentConfig};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut registry = AgentRegistry::new();
    let architect = registry.get(AgentType::Architect)?;
    let config = AgentConfig::default();

    let result = architect
        .run("Design a microservices architecture for a payment system", &config)
        .await?;

    println!("{}", result.output);
    Ok(())
}

Re-exports§

pub use registry::AgentRegistry;
pub use registry::AgentType;
pub use traits::SpecializedAgent;
pub use agents::*;

Modules§

agents
Specialized agent implementations
prelude
Re-exports from hanzo-agent for convenience
prompts
System prompts for specialized agents
registry
Agent registry for managing and accessing specialized agents
tools
Tool registry and execution for agents
traits
Core traits for specialized agents