1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//! # rig-compose
//!
//! Composable agent kernel for [`rig`](https://github.com/0xplaygrounds/rig)
//! (and any rig-shaped tool surface): stateless skills, transport-agnostic
//! tools, registry-driven agents, and a signal-routing coordinator.
//!
//! Originally extracted from [Azrael](https://github.com/ForeverAngry/azrael)'s
//! threat-detection kernel, this crate is now domain-neutral and can wrap
//! any tool/agent stack.
//!
//! ## Composability rules
//! 1. [`Skill`] is stateless. Any skill can be assigned to any [`Agent`].
//! 2. [`Tool`] is the only side-effectful interface. Local impls and
//! remote transports (see `rig-mcp`) share the trait; skills cannot
//! tell them apart.
//! 3. [`Agent`] holds a slice of the global registries — it never
//! hard-codes skill or tool names.
//! 4. [`Workflow`] composes agents.
//!
//! ## Two paths for agent-to-agent delegation
//!
//! rig-compose ships **two complementary delegation primitives**. Pick
//! the one that matches who should decide *when* a peer agent is invoked.
//!
//! **Default — [`delegate::DelegateTool`] (model-driven, agentic).**
//! A child agent is exposed as a normal [`Tool`]. The parent agent's
//! model decides when to call it, just like any other tool. This is the
//! recommended path for autonomous agent-to-agent collaboration, because
//! the topology stays open and transport-symmetric: the same tool call
//! works whether the peer runs in-process via
//! [`delegate::InProcessAgentDelegate`] or behind an MCP server via
//! `rig_mcp::McpTool`.
//!
//! **Optional — [`coordinator::CoordinatorAgent`] (deterministic, host-driven).**
//! A signal-tag router that hops to the first matching specialist with
//! no model in the loop. Reach for it only when the routing topology is
//! fixed up-front and you specifically want a free dispatch hop —
//! typical use is an overseer that fans one specialist out per partition
//! before any LLM has loaded. Not a substitute for `DelegateTool` when
//! you want the *agents* to choose how they cooperate.
/// Deterministic, no-LLM signal-tag router. See the crate-level
/// "Two paths for agent-to-agent delegation" section: prefer
/// [`delegate::DelegateTool`] for model-driven peer collaboration and
/// reach for [`coordinator::CoordinatorAgent`] only when the topology
/// is fixed and a free dispatch hop matters.
/// Model-driven, transport-agnostic agent delegation. The default path
/// for autonomous agent-to-agent collaboration. See the crate-level
/// "Two paths for agent-to-agent delegation" section.
pub use ;
pub use ;
pub use ;
pub use ;
pub use Instructions;
pub use ;
pub use ;
pub use ;
pub use ;
pub use Workflow;