# Pi Multi-Agent

A TypeScript multi-agent orchestration framework implementing a full goal-plan-execute-evaluate-replan-output lifecycle, with adaptive model routing and a real-time dashboard.

Pi Multi-Agent is a TypeScript framework for production multi-agent orchestration systems, implementing the full agent lifecycle from goal through plan, execute, evaluate, replan and output, with LLM-powered task decomposition and real tool calling. It offers three execution modes: Direct for simple single-step queries handled by one LLM call, Deep for research-intensive collaboration among a cluster of specialized sub-agents, and Workflow for a dynamic, sandboxed pipeline.

Adaptive routing automatically selects the optimal model per task by complexity, priority and required capability, deep planning builds dependency graphs and assigns agent roles against quality thresholds, and an iterative quality loop evaluates output and automatically replans and retries until a threshold is met. It supports six collaboration patterns, including sequential, parallel, debate-and-consensus and critic-reviewer, and six communication topologies from a single agent to a custom hierarchy, with shared memory for inter-agent data passing and session persistence.

A WebSocket-powered Next.js dashboard shows agent status, tool calls and progress in real time. It is fully typed and licensed under MIT.

Website: https://github.com/jwangkun/Pi-Multi-Agent
