miyabi-agents 0.1.2

Miyabi Agents - Autonomous AI agents (DEPRECATED: Use miyabi-agent-* crates)
docs.rs failed to build miyabi-agents-0.1.2
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: miyabi-agents-0.1.1

miyabi-agents

Note: This crate is deprecated in favor of specialized agent crates:

  • miyabi-agent-coordinator
  • miyabi-agent-codegen
  • miyabi-agent-review
  • miyabi-agent-workflow
  • miyabi-agent-business
  • miyabi-agent-integrations

This crate now serves as a unified re-export layer for backward compatibility.

Features

Agent Lifecycle Hooks

The hooks system allows you to extend agent behavior with lifecycle events:

  • Pre-Execute: Validate environment, check prerequisites
  • Post-Execute: Log results, trigger actions, index knowledge
  • On Error: Handle failures, trigger alerts

Built-in Hooks

  • EnvironmentCheckHook: Validate required environment variables
  • MetricsHook: Record execution metrics using tracing
  • AuditLogHook: Append execution details to .ai/logs

Auto-Indexing (Optional)

When the knowledge-integration feature is enabled, AuditLogHook can automatically index agent execution logs into a vector database for future knowledge retrieval.

use miyabi_agents::{HookedAgent, AuditLogHook};
use miyabi_knowledge::KnowledgeConfig;

let config = KnowledgeConfig::from_file("~/.config/miyabi/knowledge.json")?;
let hook = AuditLogHook::new(".ai/logs").with_auto_index(config);

See: Hook Integration Guide for complete documentation.

Usage

Basic Hook Usage

use miyabi_agents::{HookedAgent, MetricsHook, AuditLogHook};
use miyabi_agent_coordinator::CoordinatorAgent;
use miyabi_types::{AgentConfig, Task};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    // Create agent
    let config = AgentConfig::default();
    let agent = CoordinatorAgent::new(config);

    // Wrap with hooks
    let mut hooked_agent = HookedAgent::new(agent);
    hooked_agent.register_hook(MetricsHook::new());
    hooked_agent.register_hook(AuditLogHook::new(".ai/logs"));

    // Execute
    let task = create_sample_task();
    let result = hooked_agent.execute(&task).await?;

    Ok(())
}

With Auto-Indexing

use miyabi_agents::{HookedAgent, AuditLogHook};
use miyabi_knowledge::KnowledgeConfig;

// Load configuration
let knowledge_config = KnowledgeConfig::from_file("~/.config/miyabi/knowledge.json")?;

// Create hooked agent with auto-indexing
let mut hooked_agent = HookedAgent::new(agent);
hooked_agent.register_hook(
    AuditLogHook::new(".ai/logs").with_auto_index(knowledge_config)
);

// Execute - logs will be auto-indexed in the background
let result = hooked_agent.execute(&task).await?;

Features

  • default: Standard hooks (Metrics, Environment Check, Audit Log)
  • knowledge-integration: Enable auto-indexing with miyabi-knowledge

Documentation

Migration from Legacy Agents

If you're using the legacy agent implementations in this crate, please migrate to the specialized crates:

// Old (deprecated)
use miyabi_agents::CoordinatorAgent;

// New (recommended)
use miyabi_agent_coordinator::CoordinatorAgent;

License

See LICENSE in the repository root.