Composable agent kernel for Rig-shaped systems.
Composable agent kernel for rig.
- Stateless
Skilltrait — assignable to any agent. - Transport-agnostic
Tooltrait — local closures or remote MCP servers (via the companionrig-mcpcrate) look identical at the call site. - Registry-driven
Agent—GenericAgent::builder()with declarative skill chains and per-agent tool whitelisting viaToolRegistry::scoped. - Signal-routing
CoordinatorAgent— first-matchRoutingRules with optional fallback.
Originally extracted from Azreal.
[dependencies]
rig-compose = "0.1"Enable manifest loading when you want the portable agent manifest schema:
[dependencies]
rig-compose = { version = "0.1", features = ["manifest"] }use async_trait::async_trait;
use rig_compose::{
Agent, GenericAgent, InvestigationContext, KernelError, Skill, SkillOutcome,
SkillRegistry, ToolRegistry,
};
struct KeywordSkill;
#[async_trait]
impl Skill for KeywordSkill {
fn id(&self) -> &str {
"example.keyword"
}
fn applies(&self, context: &InvestigationContext) -> bool {
context.has_signal("keyword.match")
}
async fn execute(
&self,
_context: &mut InvestigationContext,
_tools: &ToolRegistry,
) -> Result<SkillOutcome, KernelError> {
Ok(SkillOutcome::default().with_delta(0.25))
}
}
# async fn run() -> Result<(), KernelError> {
let skills = SkillRegistry::new();
skills.register(std::sync::Arc::new(KeywordSkill));
let tools = ToolRegistry::new();
let agent = GenericAgent::builder("triage")
.with_skills(["example.keyword"])
.build(&skills, &tools)?;
let mut context = InvestigationContext::new("entity-1", "default")
.with_signal("keyword.match");
let result = agent.step(&mut context).await?;
assert_eq!(result.skills_run, vec!["example.keyword".to_string()]);
# Ok(()) }See examples/basic_agent.rs for a compiling version.
| Feature | Default | Description |
|---|---|---|
manifest |
- | Enables serde-yaml backed portable agent manifests. |
rig-compose targets Rust 2024 and has MSRV 1.88.
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.