ares/agents/mod.rs
1//! AI agent orchestration and management.
2//!
3//! This module provides the agent system for A.R.E.S, including:
4//!
5//! - **Agent Trait** - Base trait that all agents implement
6//! - **ConfigurableAgent** - Dynamic agent created from TOML/TOON configuration
7//! - **AgentRegistry** - Registry for creating and managing agent instances
8//! - **Router** - Routes requests to appropriate specialized agents
9//! - **Orchestrator** - Coordinates multi-step agent workflows
10//!
11//! ## Architecture
12//!
13//! All agents are now created dynamically via `ConfigurableAgent`, which reads
14//! configuration from TOML files. Legacy hardcoded agents have been removed.
15//!
16//! ## Example
17//!
18//! ```rust,ignore
19//! use ares::agents::{Agent, AgentRegistry};
20//!
21//! // Create registry from configuration
22//! let registry = AgentRegistry::from_config(&config, provider_registry, tool_registry);
23//!
24//! // Get an agent instance
25//! let agent = registry.get_agent("product")?;
26//!
27//! // Execute with context
28//! let response = agent.execute("Help me with my order", &context).await?;
29//! ```
30
31pub mod configurable;
32/// Multi-agent orchestration for complex tasks.
33pub mod orchestrator;
34pub mod registry;
35/// Request routing to specialized agents.
36pub mod router;
37
38use crate::types::{AgentContext, AgentType, Result};
39use async_trait::async_trait;
40
41// Re-export commonly used types
42pub use configurable::ConfigurableAgent;
43pub use registry::{AgentRegistry, AgentRegistryBuilder};
44
45/// Base trait for all agents
46#[async_trait]
47pub trait Agent: Send + Sync {
48 /// Execute the agent with given input and context
49 async fn execute(&self, input: &str, context: &AgentContext) -> Result<String>;
50
51 /// Get the agent's system prompt
52 fn system_prompt(&self) -> String;
53
54 /// Get the agent type
55 fn agent_type(&self) -> AgentType;
56}