A powerful, production-ready hierarchical multi-agent framework with a visual builder for creating, orchestrating, and deploying AI agent systems. Built with TypeScript, Next.js 16, and featuring a drag-and-drop workflow canvas.
- Master Orchestrator: Coordinates complex tasks across specialized sub-agents
- Sub-Orchestrators: Domain-specific coordinators (Analytics, Research, Content)
- Specialist Agents: Focused tools for specific operations
- Intelligent Delegation: Automatic task routing based on domain expertise
- n8n-style Canvas: Drag-and-drop interface for creating agent workflows
- Node Palette: Pre-built nodes for triggers, agents, tools, and logic
- Properties Panel: Configure nodes with rich form controls
- Code Generation: Export visual workflows to production-ready TypeScript
| Provider | Models | Features |
|---|---|---|
| OpenAI | GPT-4o, GPT-4 Turbo | Full tool calling support |
| Ollama | Llama, Mistral, Qwen | Run locally, zero API costs |
| OpenRouter | Claude, Gemini, GPT | Multi-model gateway |
| n8n | Custom workflows | Integration with automation |
| AgentRouter | Auto-routing | Intelligent model selection |
| Custom | Any OpenAI-compatible | Bring your own API |
Analytics Tools:
- Statistical Analysis
- Trend Detection
- Data Comparison
- Correlation Analysis
- Forecasting
Research Tools:
- Web Search
- Content Extraction
- Summarization
- Fact Verification
Content Tools:
- Report Generation
- Content Formatting
- Translation
- Sentiment Analysis
- Node.js 18+ or Bun
- npm, yarn, pnpm, or bun
# Clone the repository
git clone https://github.com/yourusername/multi-agent-system.git
cd multi-agent-system
# Install dependencies
bun install
# Set up environment variables
cp .env.example .env.local
# Start development server
bun run devOpen http://localhost:3000 to see the application.
# Required: OpenAI API Key (for z-ai-web-dev-sdk)
OPENAI_API_KEY=your_openai_api_key
# Optional: Other provider API keys
OLLAMA_BASE_URL=http://localhost:11434
OPENROUTER_API_KEY=your_openrouter_key
N8N_WEBHOOK_URL=http://localhost:5678/webhook
CUSTOM_AI_API_KEY=your_custom_keyβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β User Interface β
β βββββββββββββββ βββββββββββββββ βββββββββββββββββββββββ β
β β Landing Pageβ β Agent App β β Visual Builder β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β API Layer β
β βββββββββββββββββ βββββββββββββββββ ββββββββββββββββββ β
β β /api/agents β β /api/settings β β /api/analytics β β
β βββββββββββββββββ βββββββββββββββββ ββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Agent System Core β
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Master Orchestrator β β
β β (Plans, Coordinates, Aggregates Results) β β
β βββββββββββββ¬βββββββββββββββ¬βββββββββββββββ¬ββββββββββββ β
β β β β β
β βββββββββββββΌβββββ ββββββββΌββββββββ ββββββΌβββββββββββββ β
β β Analytics β β Research β β Content β β
β β Orchestrator β β Orchestrator β β Orchestrator β β
β ββββββββββ¬ββββββββ ββββββββ¬ββββββββ ββββββββββ¬βββββββββ β
β β β β β
β ββββββββββΌβββββ ββββββββΌβββββββ ββββββββΌβββββββ β
β β Analytics β β Research β β Content β β
β β Tools β β Tools β β Tools β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Provider Layer β
β βββββββββββ βββββββββββ βββββββββββββ ββββββββββ ββββββββ β
β β OpenAI β β Ollama β βOpenRouter β β n8n β βCustomβ β
β βββββββββββ βββββββββββ βββββββββββββ ββββββββββ ββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
import { MasterOrchestrator, AnalyticsOrchestrator } from '@/lib/agents';
// Create a master orchestrator
const master = new MasterOrchestrator({
id: 'master-1',
name: 'Task Coordinator',
description: 'Main orchestrator for complex tasks',
role: 'master_orchestrator',
domain: 'general',
model: 'gpt-4o',
});
// Execute a task
const result = await master.execute('Analyze Q4 sales and create a report');- Open the app and click "Launch App"
- Switch to the "Build" tab
- Drag nodes from the palette onto the canvas
- Connect nodes to define workflow
- Configure each node's properties
- Click "Generate Code" to export TypeScript
// src/lib/agents/tools/custom.ts
import { Tool } from '@/lib/agents/core/types';
export const customTool: Tool = {
definition: {
name: 'my_custom_tool',
description: 'Does something specific',
parameters: {
input: {
type: 'string',
description: 'Input parameter',
required: true,
},
},
},
execute: async (params) => {
// Your custom logic here
return {
success: true,
data: { result: 'Processed: ' + params.input },
};
},
};| Endpoint | Method | Description |
|---|---|---|
/api/agents |
POST | Execute master orchestrator |
/api/agents/analytics |
POST | Execute analytics agent |
/api/agents/research |
POST | Execute research agent |
/api/agents/content |
POST | Execute content agent |
/api/settings |
GET/POST | Manage provider settings |
# Execute a task
curl -X POST http://localhost:3000/api/agents \
-H "Content-Type: application/json" \
-d '{
"message": "Analyze the latest market trends",
"context": { "industry": "technology" }
}'- Framework: Next.js 16 (App Router)
- Language: TypeScript 5
- Styling: Tailwind CSS 4 + shadcn/ui
- State Management: Zustand
- Visual Builder: ReactFlow
- Animations: Framer Motion
- AI SDK: z-ai-web-dev-sdk (OpenAI compatible)
src/
βββ app/ # Next.js App Router
β βββ api/ # API Routes
β β βββ agents/ # Agent endpoints
β β β βββ route.ts # Master orchestrator
β β β βββ analytics/ # Analytics agent
β β β βββ research/ # Research agent
β β β βββ content/ # Content agent
β β βββ settings/ # Settings management
β βββ layout.tsx # Root layout
β βββ page.tsx # Main entry (Landing β App)
β βββ globals.css # Global styles
β
βββ components/
β βββ ui/ # shadcn/ui components
β βββ builder/ # Visual builder components
β β βββ VisualBuilder.tsx # Main canvas component
β βββ landing/ # Landing page components
β β βββ LandingPage.tsx # Marketing page
β β βββ ThemeProvider.tsx # Dark/light theme
β βββ MainApp.tsx # Main application
β βββ PageWrapper.tsx # Page wrapper with providers
β βββ SettingsDialog.tsx # Settings modal
β
βββ lib/
β βββ agents/ # Agent system core
β β βββ core/ # Base classes and types
β β β βββ Agent.ts # Base agent class
β β β βββ Orchestrator.ts # Orchestrator base
β β β βββ types.ts # Type definitions
β β βββ orchestrators/ # Specialized orchestrators
β β β βββ MasterOrchestrator.ts
β β β βββ AnalyticsOrchestrator.ts
β β β βββ ResearchOrchestrator.ts
β β β βββ ContentOrchestrator.ts
β β βββ providers/ # AI provider implementations
β β β βββ types.ts # Provider types
β β β βββ store.ts # Settings store
β β β βββ OpenAIProvider.ts
β β β βββ OllamaProvider.ts
β β β βββ OpenRouterProvider.ts
β β β βββ N8nProvider.ts
β β β βββ AgentRouterProvider.ts
β β β βββ CustomProvider.ts
β β βββ tools/ # Built-in tools
β β βββ analytics.ts # Analytics tools
β β βββ research.ts # Research tools
β β βββ content.ts # Content tools
β β
β βββ builder/ # Visual builder core
β β βββ types.ts # Builder types
β β βββ store.ts # Builder state
β β βββ codeGenerator.ts # Visual β Code
β β βββ nodes/ # Custom ReactFlow nodes
β β
β βββ db.ts # Database client
β βββ utils.ts # Utility functions
β
βββ hooks/ # Custom React hooks
βββ use-mobile.ts
βββ use-toast.ts
- Push your code to GitHub
- Import your repository on Vercel
- Set environment variables
- Deploy!
# Dockerfile
FROM oven/bun:1 AS base
WORKDIR /app
# Install dependencies
COPY package.json bun.lock ./
RUN bun install --frozen-lockfile
# Copy source
COPY . .
# Build
RUN bun run build
# Expose port
EXPOSE 3000
# Start
CMD ["bun", "start"]docker build -t multi-agent-system .
docker run -p 3000:3000 multi-agent-systemWe welcome contributions! Please see our Contributing Guide for details.
# Clone and install
git clone https://github.com/yourusername/multi-agent-system.git
cd multi-agent-system
bun install
# Run development server
bun run dev
# Run linting
bun run lint
# Build for production
bun run build| Script | Description |
|---|---|
bun run dev |
Start development server |
bun run build |
Build for production |
bun run start |
Start production server |
bun run lint |
Run ESLint |
bun run db:push |
Push Prisma schema |
bun run db:generate |
Generate Prisma client |
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenAI for GPT models
- Ollama for local LLM support
- ReactFlow for the visual builder canvas
- shadcn/ui for beautiful components
- Vercel for hosting platform
- π Documentation
- π Issue Tracker
- π¬ Discussions
Built with β€οΈ by Will Napolini & Community. Powered by AI.