rig-compose 0.1.2

Composable agent kernel: stateless skills, transport-agnostic tools, registry-driven agents, signal-routing coordinator. Companion crate for rig.
Documentation

rig-compose

Composable agent kernel for Rig-shaped systems.

crates.io docs.rs license


Composable agent kernel for rig.

  • Stateless Skill trait — assignable to any agent.
  • Transport-agnostic Tool trait — local closures or remote MCP servers (via the companion rig-mcp crate) look identical at the call site.
  • Registry-driven AgentGenericAgent::builder() with declarative skill chains and per-agent tool whitelisting via ToolRegistry::scoped.
  • Signal-routing CoordinatorAgent — first-match RoutingRules with optional fallback.

Originally extracted from Azreal.

Install

[dependencies]
rig-compose = "0.1"

Enable manifest loading when you want the portable agent manifest schema:

[dependencies]
rig-compose = { version = "0.1", features = ["manifest"] }

Quickstart

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.

Features

Feature Default Description
manifest - Enables serde-yaml backed portable agent manifests.

Compatibility

rig-compose targets Rust 2024 and has MSRV 1.88.

License

Licensed under either of:

at your option.