Skip to main content

rig_compose/
lib.rs

1//! # rig-compose
2//!
3//! Composable agent kernel for [`rig`](https://github.com/0xplaygrounds/rig)
4//! (and any rig-shaped tool surface): stateless skills, transport-agnostic
5//! tools, registry-driven agents, and a signal-routing coordinator.
6//!
7//! Originally extracted from [Azreal](https://github.com/ForeverAngry/azreal)'s
8//! threat-detection kernel, this crate is now domain-neutral and can wrap
9//! any tool/agent stack.
10//!
11//! ## Composability rules
12//! 1. [`Skill`] is stateless. Any skill can be assigned to any [`Agent`].
13//! 2. [`Tool`] is the only side-effectful interface. Local impls and
14//!    remote transports (see `rig-mcp`) share the trait; skills cannot
15//!    tell them apart.
16//! 3. [`Agent`] holds a slice of the global registries — it never
17//!    hard-codes skill or tool names.
18//! 4. [`Workflow`] composes agents. The [`CoordinatorAgent`] is one
19//!    workflow primitive; specialist routing is another configuration of it.
20
21pub mod agent;
22pub mod context;
23pub mod coordinator;
24pub mod delegate;
25pub mod instructions;
26#[cfg(feature = "manifest")]
27pub mod manifest;
28pub mod registry;
29pub mod skill;
30pub mod tool;
31pub mod workflow;
32
33pub use agent::{Agent, AgentId, AgentStepResult, GenericAgent, GenericAgentBuilder};
34pub use context::{Evidence, InvestigationContext, NextAction, Signal};
35pub use coordinator::{CoordinatorAgent, CoordinatorBuilder, RoutingRule};
36pub use delegate::{
37    DelegateExecutor, DelegateName, DelegateRegistry, DelegateTool, InProcessAgentDelegate,
38};
39pub use instructions::Instructions;
40#[cfg(feature = "manifest")]
41pub use manifest::{
42    AgentManifest, DelegateKind, DelegateSpec, InstructionsSpec, KnowledgeSpec, ManifestError,
43    McpServerSpec, ModelSpec, ToolSpec, delegate_stub, materialize_local_and_delegate_tools,
44    materialize_local_and_delegate_tools_with_delegates,
45};
46pub use registry::{KernelError, SkillRegistry, ToolRegistry};
47pub use skill::{Skill, SkillId, SkillOutcome};
48pub use tool::{LocalTool, Tool, ToolName, ToolSchema};
49pub use workflow::Workflow;