π€ AI-powered software development pipeline driven by 6 specialized agents. Transforms plain English requirements into production-ready code β fully automating planning, development, code reviews, and deployment configs using Next.js and Groq's Free API.
View the Project on GitHub ParthivPandya/multi-agent-orchestrator
v2 brings 5 major architectural enhancements inspired by competitive analysis of CrewAI, ComposioHQ, AWS Agent Squad, and Kore.ai.
| Enhancement | Description | Inspired By |
|---|---|---|
| π§ Intelligent Routing | A pre-classifier routes each request to the optimal pipeline subset, saving tokens and time | AWS Agent Squad |
| βοΈ Agentic Tools | Agents can now do things: web search, workspace file reading, and static code linting | ComposioHQ, WSHobson |
| π RAG Knowledge | In-memory TF-IDF retrieval grounds agents in up-to-date framework docs (Next.js 15, React 19, etc.) | Kore.ai, CrewAI |
| π Flows DSL | A typed FlowDefinition system maps pipeline modes to agent subsets β the foundation for custom crews |
CrewAI |
| πΎ Stateful Checkpoints | Pipeline state is saved to disk after every stage. Resume from any failure point with one API call | ComposioHQ |
| Most AI code generators are **black boxes** β you type a prompt, wait, and hope for the best. This project takes a fundamentally different approach: - π **Software Factory, Not a Chatbot** β 7 agents with distinct roles collaborate like a real dev team - π§ **Smart Routing** β A classifier pre-screens every request and skips unnecessary agents automatically - π **Self-Correcting** β The Code Reviewer catches bugs and sends code back for revision automatically - π§ͺ **Tests Included** β A dedicated Testing Agent auto-generates unit & integration tests for every project - π **RAG-Grounded** β Agents consult up-to-date framework docs before generating code β no deprecated APIs - βοΈ **Tools-Enabled** β Agents actively search the web and lint code, not just "think" in text - πΎ **Resume on Failure** β Every stage is checkpointed. Groq API crash? Resume from where you left off - π‘οΈ **Battle-Hardened** β Every agent call has exponential backoff retry (up to 3 attempts) - ποΈ **Full Transparency** β Watch every agent think, every tool call fire, every RAG doc retrieved in real-time - π **Analytics Built-in** β Per-agent token usage, latency charts, and cost estimates after every run - πΈ **100% Free** β Runs on Groq's free tier. No OpenAI bills. No subscriptions. | ### The v2 Pipeline ``` You: "Build a REST API for a todo app with auth" β π§ Router β Classify intent β Select pipeline mode β π RAG β Retrieve framework docs β π Analyst β Structured specs π Planner β Task breakdown π» Developer β Code + web search β (Self-correcting loop) π Reviewer β Code quality + lint π§ͺ Tester β Unit test suite π Deployer β Docker + CI/CD β You: Complete project + tests, checkpoint saved! π ``` |
| ### π§ Intelligent Routing *(v2 New!)* A `llama-3.1-8b-instant` pre-classifier runs before any agent. It detects 4 intent modes and skips irrelevant agents: - `FULL_PIPELINE` β All 7 agents (complex build) - `QUICK_FIX` β Dev + Reviewer only (bug fix/tweak) - `PLAN_ONLY` β Analyst + Planner only (architecture question) - `CODE_REVIEW_ONLY` β Reviewer only (paste code for review) ### π RAG Knowledge Base *(v2 New!)* Zero-dependency TF-IDF cosine retrieval against 8 curated knowledge chunks. Framework docs for **Next.js 15, React 19, TypeScript 5, Vercel AI SDK 4, Tailwind v4, Node.js, and Prisma** are injected into Developer and Reviewer prompts at runtime to prevent hallucinated or deprecated APIs. ### βοΈ Agentic Tools Ecosystem *(v2 New!)* Agents now have access to real tools: - **`searchWeb`** β DuckDuckGo Instant Answer API (free, no key needed) - **`readFile`** β Sandboxed workspace file reader (path-traversal safe) - **`lintCode`** β 13-rule static linter with 0-100 quality score (checks for `eval`, hardcoded secrets, XSS, `any` types, React key props, and more) All tool calls stream live to the **β‘ Agent Activity** feed in the UI. ### πΎ Stateful Checkpoints *(v2 New!)* Every agent stage writes a JSON checkpoint to `.workspace/checkpoints/`. If the pipeline fails (Groq rate limit, network error, etc.), resume exactly where you left off by passing `resumeCheckpointId` to the API. | ### π Pipeline Flows DSL *(v2 New!)* A `FlowDefinition` system maps every pipeline mode to a typed, ordered list of agent nodes. This is the extensible foundation for user-defined custom crews β just add a YAML parser on top. ### π Fully Automated 7-Agent Pipeline Plain English β production code β unit tests β deployment config. Zero manual intervention. ### π§ͺ Auto-Generated Test Suite The Testing Agent writes comprehensive Jest/Pytest/Go tests automatically based on the tech stack detected in the generated code. ### π‘οΈ Exponential Backoff Retry Every agent call is wrapped in retry logic: 3 automatic attempts with 2s β 4s β 8s backoff. Transient Groq API errors are handled silently. ### π Developer β Reviewer Loop Built-in feedback cycle: Code Reviewer sends rejected code back to Developer for revision (up to 3 iterations). Reviewer now has lint pre-analysis and RAG docs for more accurate reviews. ### π Analytics Dashboard Toggle the analytics panel after any run to see per-agent token usage, latency bars, and estimated cost β all in one view. ### π Pipeline History & Restore Every run is saved to `localStorage`. Open the History panel, browse past runs with timestamps, and restore any of them with one click. ### β‘ Real-Time SSE Streaming Every agent's start, tool calls, RAG retrievals, checkpoint saves, and completion stream live to the UI. |
| Feature | This Project v2 | CrewAI | AWS Agent Squad | ComposioHQ | Kore.ai |
|---|---|---|---|---|---|
| πΈ Completely Free | β Groq free tier | β | β | β | β |
| π₯οΈ Beautiful Web UI | β Premium dark theme | β οΈ CLI | β οΈ CLI | β οΈ CLI | β οΈ Enterprise |
| β‘ Real-time Streaming | β SSE events | β | β | β | β |
| π§ Intelligent Routing | β 4-mode classifier | β οΈ Partial | β Yes | β | β |
| π RAG Knowledge | β In-memory TF-IDF | β Yes | β | β | β Enterprise |
| βοΈ Agentic Tools | β Web + lint + files | β Yes | β οΈ Partial | β Yes | β οΈ Partial |
| πΎ Resume on Failure | β Checkpoints | β | β | β οΈ Partial | β |
| π Self-Correcting Code | β DevβReview loop | β Yes | β οΈ | β οΈ | β οΈ |
| π§ͺ Auto Test Generation | β Dedicated agent | β | β | β | β |
| π‘οΈ Retry on Failure | β Exp. backoff | β | β | β | β οΈ |
| π Analytics Dashboard | β Built-in | β | β | β | β Enterprise |
| π¦ Ready-to-Deploy Output | β Docker + CI/CD | β | β | β | β |
| π One-Click Deploy | β Vercel button | β | β | β | β |
flowchart TB
subgraph Frontend["π₯οΈ Frontend (Next.js App Router)"]
UI[RequirementInput] --> Page[page.tsx]
Page --> PV[PipelineView]
Page --> OP[OutputPanel]
Page --> WV[WorkspaceViewer]
Page --> AP[AnalyticsPanel]
Page --> HP[HistoryPanel]
Page --> AF["β‘ Activity Feed (NEW)"]
Page --> RB["π§ Route Banner (NEW)"]
end
subgraph API["π‘ API Layer"]
Page -->|POST + SSE| Orch["/api/orchestrate"]
Page -->|POST| Save["/api/workspace"]
end
subgraph Pipeline["π Orchestration Pipeline v2"]
Orch --> O["orchestrator.ts"]
O --> R0["π§ Router Agent (NEW)\nclassifyIntent()"]
R0 -->|FULL_PIPELINE| A1
R0 -->|QUICK_FIX| A3
R0 -->|PLAN_ONLY| A1
subgraph RAG["π RAG Layer (NEW)"]
KB["knowledgeBase.ts\n8 doc chunks"] --> Ret["retriever.ts\nTF-IDF cosine search"]
end
Ret -->|top-3 chunks| A3
Ret -->|top-3 chunks| A4
A1["π Requirements Analyst"] --> A2["π Task Planner"]
subgraph Tools["βοΈ Agentic Tools (NEW)"]
SW["searchWeb.ts\nDuckDuckGo API"]
LC["lintCode.ts\n13-rule linter"]
RF["readFile.ts\nSandboxed reader"]
end
SW -->|web refs| A3
LC -->|lint report| A4
A2 --> A3["π» Developer Agent"]
A3 --> A4["π Code Reviewer"]
A4 -->|CHANGES_REQUESTED| A3
A4 -->|APPROVED| A5["π§ͺ Testing Agent"]
A5 --> A6["π Deployment Agent"]
subgraph Checkpoint["πΎ Checkpoints (NEW)"]
CP["checkpoint.ts\n.workspace/checkpoints/"]
end
A1 & A2 & A3 & A4 & A5 & A6 -->|save state| CP
end
subgraph LLM["π§ Groq API (Free Tier)"]
R0 -.-|llama-3.1-8b-instant| G[Groq Cloud]
A1 -.-|llama-3.1-8b-instant| G
A2 -.-|llama-4-scout-17b| G
A3 -.-|qwen3-32b| G
A4 -.-|llama-3.3-70b| G
A5 -.-|llama-3.3-70b| G
A6 -.-|llama-3.1-8b-instant| G
end
style Frontend fill:#1a1a2e,color:#e0e0ff
style API fill:#16213e,color:#e0e0ff
style Pipeline fill:#0f3460,color:#e0e0ff
style LLM fill:#533483,color:#e0e0ff
style RAG fill:#1a2a1e,color:#e0e0ff
style Tools fill:#2a1a1e,color:#e0e0ff
style Checkpoint fill:#2a2a1a,color:#e0e0ff
| # | Agent | Model | Purpose | Max Tokens |
|---|---|---|---|---|
| 0 | π§ Router / Classifier (New!) | llama-3.1-8b-instant |
Classifies intent β routes to optimal pipeline subset (FULL / QUICK_FIX / PLAN_ONLY / REVIEW_ONLY) | 512 |
| 1 | π Requirements Analyst | llama-3.1-8b-instant |
Parses raw English β structured JSON specification with FRs, NFRs, acceptance criteria, tech stack | 2,048 |
| 2 | π Task Planner | llama-4-scout-17b-16e-instruct |
Breaks specifications β ordered tasks with IDs, priorities, dependencies, and sizing | 2,048 |
| 3 | π» Developer Agent | qwen/qwen3-32b |
Writes complete, production-ready source code β augmented with RAG docs + web search results | 4,096 |
| 4 | π Code Reviewer | llama-3.3-70b-versatile |
Reviews code with RAG docs + pre-computed lint analysis. Returns APPROVED or CHANGES_REQUESTED with score | 2,048 |
| 5 | π§ͺ Testing Agent | llama-3.3-70b-versatile |
Auto-generates unit & integration tests matched to the tech stack. Non-fatal β pipeline continues if it fails | 3,072 |
| 6 | π Deployment Agent | llama-3.1-8b-instant |
Generates Dockerfile, docker-compose.yml, CI/CD pipelines, and deployment guides | 2,048 |
All agents are individually wrapped in
withRetry()β up to 3 attempts with exponential backoff (2s β 4s β 8s). The Router Agent always falls back toFULL_PIPELINEon any error so it never blocks users.
| Mode | Agents Run | Token Savings | Best For |
|---|---|---|---|
FULL_PIPELINE |
All 7 | β | Build a new feature / app |
QUICK_FIX |
Router + Dev + Reviewer | ~60% | Small bug fix, style tweak |
PLAN_ONLY |
Router + Analyst + Planner | ~70% | Architecture planning |
CODE_REVIEW_ONLY |
Router + Reviewer | ~80% | Review pasted code |
RAG retrieves framework docs
β
Developer writes code + web search context
β
Static linter runs (0-100 score)
β
Code Reviewer reviews (with RAG + lint report)
β
APPROVED? ββββ Yes βββ Testing Agent β Deployment Agent
β β
No (CHANGES_REQUESTED) Checkpoint saved to disk
β
Developer revises (max 3 iterations)
# 1. Clone the repository
git clone https://github.com/ParthivPandya/multi-agent-orchestrator.git
cd multi-agent-orchestrator
# 2. Install dependencies
npm install
# 3. Set up environment variables
cp .env.example .env.local
Edit .env.local and add your Groq API key:
# Get your free key at https://console.groq.com
GROQ_API_KEY=gsk_your_api_key_here
# Development server
npm run dev
# Open in browser
# β http://localhost:3000
npm run build
npm start
multi-agent-system/
βββ src/
β βββ app/
β β βββ page.tsx # Main UI β routing banner, activity feed, checkpoint state
β β βββ layout.tsx # Root layout with SEO metadata
β β βββ globals.css # Premium dark design system + animations
β β βββ api/
β β βββ orchestrate/route.ts # POST β 7-agent pipeline + resumeCheckpointId support
β β βββ agent/route.ts # POST β Test individual agents
β β βββ workspace/
β β βββ route.ts # GET/POST β List & save workspace files
β β βββ [project]/file/
β β βββ route.ts # GET β Read individual file content
β βββ lib/
β β βββ orchestrator.ts # π― v2 Pipeline controller β routing + RAG + tools + checkpoints
β β βββ context.ts # Shared state between agents
β β βββ fileParser.ts # Extracts code files from markdown output
β β βββ history.ts # localStorage pipeline history + analytics
β β βββ types/index.ts # TypeScript types β extended with all v2 types
β β βββ agents/
β β β βββ routerAgent.ts # π§ Router/Classifier β intent classification (v2 NEW)
β β β βββ requirementsAnalyst.ts # Agent 1 β Requirement parsing
β β β βββ taskPlanner.ts # Agent 2 β Task decomposition
β β β βββ developer.ts # Agent 3 β Code generation (+ RAG/search context)
β β β βββ codeReviewer.ts # Agent 4 β Code review (+ RAG/lint context)
β β β βββ testingAgent.ts # Agent 5 β Unit & integration test generation
β β β βββ deploymentAgent.ts # Agent 6 β Deployment configs
β β βββ tools/ # βοΈ Agentic Tools (v2 NEW)
β β β βββ index.ts # Barrel export
β β β βββ searchWeb.ts # DuckDuckGo Instant Answer API
β β β βββ readFile.ts # Sandboxed workspace file reader
β β β βββ lintCode.ts # 13-rule static linter (0-100 score)
β β βββ rag/ # π RAG Knowledge Base (v2 NEW)
β β β βββ knowledgeBase.ts # 8 curated doc chunks (Next.js 15, React 19, TS5, etc.)
β β β βββ retriever.ts # TF-IDF cosine similarity retrieval + keyword boosting
β β βββ flows/ # π Flows DSL (v2 NEW)
β β β βββ types.ts # FlowDefinition, FlowAgentNode, BUILT_IN_FLOWS
β β βββ workspace/ # πΎ Stateful Orchestration (v2 NEW)
β β β βββ checkpoint.ts # Save/load/list checkpoints to .workspace/checkpoints/
β β βββ prompts/
β β βββ analyst.prompt.ts # System prompt for Agent 1
β β βββ planner.prompt.ts # System prompt for Agent 2
β β βββ developer.prompt.ts # System prompt for Agent 3 (+ RAG injection)
β β βββ reviewer.prompt.ts # System prompt for Agent 4 (+ RAG + lint injection)
β β βββ testing.prompt.ts # System prompt for Agent 5
β β βββ deployer.prompt.ts # System prompt for Agent 6
β βββ components/
β βββ RequirementInput.tsx # Input form with example prompts
β βββ PipelineView.tsx # v2: Router node + skipped agent styling
β βββ AgentCard.tsx # v2: Supports 'skipped' status
β βββ OutputPanel.tsx # Formatted/Raw/JSON output tabs
β βββ WorkspaceViewer.tsx # File tree + code viewer + save + ZIP export
β βββ AnalyticsPanel.tsx # Per-agent token/latency bar chart
β βββ HistoryPanel.tsx # Slide-in past-runs panel with restore
βββ .workspace/
β βββ checkpoints/ # πΎ Pipeline checkpoint files (auto-created)
βββ workspace/ # π Generated projects are saved here
βββ .env.example # Environment variable template
βββ package.json
βββ tsconfig.json
POST /api/orchestrateRuns the pipeline with intelligent routing and real-time SSE streaming.
Request:
{
"requirement": "Build a REST API for a todo app with authentication",
"resumeCheckpointId": "optional-checkpoint-id-for-resume"
}
Response: Server-Sent Events stream
| Event Type | Description |
|---|---|
route_decision |
(v2 New) Router classified intent β includes mode, reasoning, skipped agents, confidence |
rag_retrieval |
(v2 New) RAG retrieved relevant docs β includes source names and chunks |
tool_call |
(v2 New) An agent is calling a tool (searchWeb, lintCode, etc.) |
tool_result |
(v2 New) Tool returned a result β includes output and duration |
checkpoint_saved |
(v2 New) Pipeline state saved to disk β includes checkpoint ID |
stage_start |
Agent has started processing |
stage_complete |
Agent finished β includes output, token count, and latency |
stage_error |
Agent encountered an unrecoverable error (after all retries) |
retry_attempt |
An agent failed and is being retried |
iteration_info |
DeveloperβReviewer loop iteration update |
pipeline_complete |
All agents finished |
final_result |
Complete results payload + checkpointId + routeDecision |
Resume from checkpoint:
{
"requirement": "Build a REST API for a todo app with authentication",
"resumeCheckpointId": "lk3x2a-f4c1"
}
The pipeline will replay completed stages to the UI and continue from the last saved state.
POST /api/agentTest an individual agent in isolation.
Request:
{
"agentName": "testing-agent",
"input": "function add(a, b) { return a + b; }"
}
Valid agent names: router-agent, requirements-analyst, task-planner, developer, code-reviewer, testing-agent, deployment-agent
POST /api/workspaceSave generated project files (source + tests + configs) to disk.
Request:
{
"projectName": "my-todo-app",
"files": [
{ "path": "src/index.ts", "content": "..." },
{ "path": "src/index.test.ts", "content": "..." },
{ "path": "Dockerfile", "content": "..." }
]
}
| Setting | Value |
|---|---|
| Inter-agent delay | 1,500ms (prevents Groq rate limits) |
| Max retry attempts per agent | 3 |
| Retry backoff schedule | 2s β 4s β 8s (exponential) |
| Max review iterations | 3 |
| Testing Agent failure | Non-fatal β pipeline continues to deployment |
| Router failure | Always falls back to FULL_PIPELINE β never blocks users |
| Web search timeout | 5s (non-blocking) |
| RAG context cap | Top-3 chunks per query |
| Groq free tier RPM | 30 requests/min |
| Groq free tier TPM | ~14,400 tokens/min |
| Max output per agent | 512 β 4,096 tokens |
| Technology | Purpose |
|---|---|
| Next.js 16 | Full-stack React framework (App Router) |
| TypeScript 5 | Type-safe development |
| Vercel AI SDK v6 | Unified LLM interface |
| @ai-sdk/groq | Groq API provider |
| Groq Cloud | Ultra-fast LLM inference (free tier) |
| TF-IDF (custom) | In-memory vector similarity for RAG β zero dependencies |
| DuckDuckGo API | Free web search for Developer agent tool calls |
| Vanilla CSS | Custom glassmorphism design system + animations |
GROQ_API_KEY in the environment variablesNote: Checkpoint persistence requires persistent filesystem. Vercelβs ephemeral filesystem means checkpoints will not survive between deployments. Use Railway, Render, or Docker for persistent checkpoints.
# Build the image
docker build -t multi-agent-orchestrator .
# Run the container
docker run -p 3000:3000 -e GROQ_API_KEY=your_key_here multi-agent-orchestrator
POST /api/agent)latencyMs measured and displayedsearchWeb, lintCode, readFile tool ecosystemBUILT_IN_FLOWS typed flow definitions + extensible FlowDefinition system| Feature | Description |
|---|---|
| π§ Agent Memory | Learn user preferences across sessions (coding style, language, frameworks) |
| πΌοΈ Vision-to-Code | Upload UI mockups/screenshots β generate matching frontend code |
| π Multi-Language Output | Support Python, Go, Rust, Java β not just TypeScript/JavaScript |
| ποΈ Project Templates | Pre-built starters (Next.js, Express, FastAPI) to reduce token usage |
| π€ Collaborative Mode | Multiple users working on the same pipeline in real-time |
| π Security Scanner Agent | Dedicated OWASP-based security audit agent |
Contributions are welcome! The project is actively growing.
git checkout -b feature/amazing-featuregit commit -m 'Add amazing feature'git push origin feature/amazing-feature| Task | Difficulty | Description |
|---|---|---|
| π YAML Flow Parser | Medium | Add a YAML parser on top of src/lib/flows/types.ts to support custom crew definitions |
| π Multi-Provider LLM | Medium | Add @ai-sdk/openai as an alternative provider option |
| β Human-in-the-Loop | Medium | Add a pause modal before the Deployment Agent runs |
| π GitHub Push | Medium | Create lib/github.ts using the GitHub REST API |
| β‘ Token Streaming | Hard | Switch agents from generateText to streamText |
| π Expand RAG KB | Easy | Add more knowledge chunks to src/lib/rag/knowledgeBase.ts |
| π± Mobile UI | Easy | Make the layout responsive for smaller screens |
π‘ Tip for new contributors: The v2 architecture separates concerns cleanly β each new feature slot is in its own directory (
tools/,rag/,flows/,workspace/). Adding a new tool takes ~30 lines. Adding a new knowledge chunk to the RAG base takes 10 lines.
This project is licensed under the MIT License β see the LICENSE file for details.