AgentForge

Multi-Agent Overview

Coordinate multiple agents with handoffs, trust models, and shared workspaces.

Overview

AgentForge's multi-agent system lets you compose multiple agents into collaborative workflows. The Coordinator manages handoffs between agents with trust enforcement, budget tracking, and cycle detection.

Quick Start

import { defineAgent, Coordinator, createLLM } from '@ahzan-agentforge/core';

const researcher = defineAgent({
  name: 'researcher',
  description: 'Researches topics',
  tools: [searchTool],
  llm,
  systemPrompt: 'You are a researcher. Find relevant information.',
});

const writer = defineAgent({
  name: 'writer',
  description: 'Writes content based on research',
  tools: [writeTool],
  llm,
  systemPrompt: 'You are a writer. Create content from research findings.',
});

const coordinator = new Coordinator({
  agents: { researcher, writer },
});

const result = await coordinator.run('researcher', {
  task: 'Research and write about AI agents',
});

Key Features

FeatureDescription
HandoffsAgents pass tasks to other agents
Trust ModelControl which agents can talk to each other
WorkspaceShared key-value store between agents
BudgetCoordination-level cost tracking
Cycle DetectionPrevents infinite handoff loops
PatternsPre-built: pipeline, parallel, supervisor, debate

Coordination Patterns

PatternDescription
pipeline()Sequential execution — each agent builds on the previous
parallel()Concurrent execution — all agents work simultaneously
supervisor()One agent delegates to workers
debate()Agents argue different positions, supervisor synthesizes

Next Steps