How chatwoot/ai-agents works
Project type and purpose
• This is an open-source Ruby SDK (gem) named “ai-agents” for building multi-agent AI workflows.
• It lets you define “Agent” objects with instructions, tools, and handoff relationships, orchestrate them via a thread-safe “Runner,” maintain shared context, and integrate with multiple LLM providers (OpenAI, Anthropic, etc.) and external services via custom Tools.
File structure
• lib/agents — core classes: Agent, AgentRunner, Runner, Tool, CallbackManager, Context, Handoff, etc.
• bin/ — CLI entrypoints (console, setup).
• docs/ — architecture.md, concepts, guides (explains patterns).
• examples/ — sample multi-agent workflows and Tools integrations.
• spec/ — unit tests for all core components.
• .github/workflows — CI.
• Gemfile, Rakefile — build/test tasks.
README for additional insights
• Core components section outlines: Agent, AgentRunner (with internal Runner), Context & State, Tools, Handoffs.
• It shows usage patterns: single agent, multi-agent hub-and-spoke, tool definitions.
• Configuration points: provider API keys, models, timeouts, debug flags.