Multi-Agent AI Orchestration Platform - Intelligent Complex Decision Making
- 🎯 Project Vision
- ✨ Key Features
- 🏗️ Architecture
- 🤖 AI Agents
- 🛠️ Technology Stack
- ⚙️ Installation & Configuration
- 🚀 Getting Started
- 📁 Code Folder Analysis
- 📚 API Documentation
- 🎨 User Interface
- 🔌 Integrations
- 📊 System Flow
- 🧪 Testing
- 📈 Performance Optimizations
- 🔒 Security
- 🤝 Contributing
- 📄 License
ArbiterAI is a web application that creates an AI-powered "Artificial Committee" system for analyzing software development tasks. Equipped with three different personalities and perspectives, AI agents evaluate complex technical decisions from multiple angles, producing better, more balanced, and more implementable solutions.
When any software development idea, question, or task is presented:
- VisionaryDev 🚀 - Amplifies the potential by 10x with innovative ideas
- LazyDev ⚡ - Shows the simple path to build MVP with minimum effort
- CriticalDev 🔴 - Ruthlessly questions risks and failure scenarios
Then ArbiterAI synthesizes these three perspectives to create a solid, actionable final decision and step-by-step implementation plan.
- Visionary Perspective: Futuristic and innovative ideas
- Pragmatic Perspective: Fast MVP and minimal complexity
- Critical Perspective: System weaknesses and risks
- Synthesis: Balanced combination of all three
- Live analysis process via Server-Sent Events (SSE)
- Instant visualization of thinking steps
- Real-time tool calls and results
- Interactive Process Timeline display
- JSON schema validated final decisions
- Step-by-step implementation plans
- Detailed justifications
- Rich markdown formatted text
- Google Custom Search API for real-time web search
- Current technology and trend information
- Code examples and implementation details
- Dynamic tool calling system
- Multi-turn chat support
- Context-aware continued analysis
- References to previous decisions
- Responsive and mobile-friendly design
- Code syntax highlighting
- Smooth scrolling and animations
- User-friendly welcome screen
- Drag & Drop Upload: Simply drag your project folder
- Auto-Filtering: Automatically ignores
node_modules,venv,.git, build outputs - Multi-Language Support: 80+ file types and programming languages
- File Management: View, search, and manage uploaded files
- Syntax Highlighting: Code viewer with line numbers and copy functionality
- Smart Analysis: AI analyzes entire codebase and provides insights
┌─────────────────────────────────────────┐
│ Frontend (Next.js/React) │
│ - UI Components (ThinkingProcess) │
│ - Process Timeline Viewer │
│ - Real-time Event Handling │
└──────────────┬──────────────────────────┘
│
┌──────▼───────┐
│ API Layer │
│ /api/orchestrate
└──────┬───────┘
│
┌──────▼──────────────────────────┐
│ OrchestratorService (Main Flow) │
│ - Agent Management │
│ - Event Streaming │
│ - Error Handling │
└──────┬──────────────────────────┘
│
┌─────────┼──────────────┬────────────┐
│ │ │ │
┌───▼──-┐ ┌─────▼───┐ ┌──────▼────┐ ┌────▼────┐
│Arbiter│ │ Refiner │ │ Chief │ │ Tools │
│Agent │ │ Agent │ │ Architect │ │ Search │
└───────┘ └─────────┘ └───────────┘ └─────────┘
│ │ │ │
└──────────┼──────────────┴────────────┘
│
┌──────▼────────────────┐
│ Gemini AI Models │
│ - 2.5 Pro (Primary) │
│ - 2.5 Flash (Fallback)
└───────────────────────┘
- pages/index.tsx - Main chat interface
- components/ - Reusable React components
- styles/ - CSS modules and styling
- hooks/useOrchestration - State management and API communication
- pages/api/orchestrate.ts - SSE stream endpoint
- pages/api/committee.ts - Configuration endpoint
- OrchestratorService - Main orchestration and agent management
- ArbiterService - Legacy system (deprecated)
- Event stream management and error handling
- ArbiterAgent - Initial analysis and research
- RefinerAgent - Analysis refinement
- ChiefArchitectAgent - Final plan creation
- performSearch - Google Custom Search API
- searchCodeExamples - Code example search
- Dynamic function calling system
Role: Analyzes the presented task and produces initial findings.
System Prompt Features:
- Simulates VisionaryDev, LazyDev, and CriticalDev perspectives
- Synthesizes between three perspectives
- Creates final decision and implementation plan
Tools:
performSearch- Technology researchsearchCodeExamples- Code example search
Output:
- Thought steps in stream format
- Tool calls and results
- Final chunk: Complete initial analysis
Role: Examines ArbiterAgent's output to make it more robust.
System Prompt Features:
- Expert CTO perspective with 30 years experience
- Finds hidden assumptions and dependencies
- Questions bottlenecks and alternative solutions
- Makes plan more solid and efficient
Tools:
- No research tools (only refines)
Output:
- Improved and refined analysis
- More detailed justification
- Optimized implementation plan
Role: Creates technical architecture and structured output.
System Prompt Features:
- Self-critique and critical thinking
- Analysis → Critique → Synthesis phases
- JSON schema structured output
- Fallback and retry mechanisms
Tools:
submitFinalPlan- Submit structured planperformSearch- ResearchsearchCodeExamples- Code examples
Output:
{
"finalDecision": "Concise final decision",
"justification": "Detailed reasoning",
"implementationPlan": [
{
"step": 1,
"title": "Title",
"details": "Details"
}
]
}| Technology | Version | Purpose |
|---|---|---|
| Next.js | 15.5.4 | React framework and API routes |
| React | 19.1.0 | UI components |
| React DOM | 19.1.0 | DOM rendering |
| TypeScript | 5 | Type safety |
| React Markdown | 10.1.0 | Markdown rendering |
| react-syntax-highlighter | 15.6.6 | Code syntax highlighting |
| Technology | Version | Purpose |
|---|---|---|
| @google/generative-ai | 0.24.1 | Gemini AI API |
| Zod | 4.1.12 | Schema validation |
| Technology | Version | Purpose |
|---|---|---|
| uuid | 13.0.0 | Unique ID generation |
| Technology | Version | Purpose |
|---|---|---|
| ESLint | 9 | Code linting |
| @types/ | Latest | TypeScript types |
# Node.js >= 18.17.0 required
node --version
# npm or yarn
npm --version
# or
yarn --versiongit clone https://github.com/yourusername/ai-komitesi.git
cd ai-komitesinpm install
# or
yarn installCreate a .env.local file and add the following variables:
# Google Generative AI API Key
# https://makersuite.google.com/app/apikey
GOOGLE_API_KEY=your_google_api_key_here
# Google Custom Search API
# https://programmablesearchengine.google.com/
CUSTOM_SEARCH_API_KEY=your_custom_search_api_key_here
SEARCH_ENGINE_ID=your_search_engine_id_here
# Model Selection (Optional)
DEFAULT_AGENT_MODEL=gemini-2.5-pro- Visit Google AI Studio
- Click "Get API Key" button
- Create a new project or select existing one
- Copy the API key
- Visit Google Cloud Console
- Create a new project
- Enable Custom Search API
- Create an API key
- Create a search engine on Programmable Search Engine
- Copy the Search Engine ID (cx)
npm run devOpen http://localhost:3000 in your browser.
npm run build
npm startnpm run lint- Open the app -
http://localhost:3000 - Enter a question - Example:
Compare React Hook Form vs Formik - Press Enter or click the Send button
- Watch the Analysis Process - Real-time steps will appear
- Review Results - Final plan and recommendations
Create a step-by-step plan for building a responsive e-commerce page
with Next.js and TailwindCSS.
What is the best JWT authentication implementation for a
Node.js and Express.js project?
Compare PostgreSQL vs MongoDB. Which is better for a SaaS
application that starts small but grows?
How should I deploy my Next.js application to production?
Choose between Vercel, AWS, and DigitalOcean.
One of the most powerful features of ArbiterAI is the ability to analyze entire project folders. Simply drag and drop your project, and the system intelligently processes all code files while automatically filtering out unnecessary folders and build artifacts.
1. Click on "📁 Code Folder Analysis" card on welcome screen
2. Click "Select Folder" button
3. Choose your project's root directory
4. System automatically begins processing
The system automatically ignores:
- Dependencies:
node_modules/,venv/,env/,.venv/ - Build Outputs:
dist/,build/,.next/,.nuxt/ - Version Control:
.git/,.gitignore - IDE Config:
.vscode/,.idea/ - Cache Dirs:
__pycache__/,.pytest_cache/,.cache/ - OS Files:
.DS_Store,Thumbs.db
1. View all uploaded files in the list
2. Click any file to view with syntax highlighting
3. Remove unwanted files if needed
4. Click "🔍 Analyze" to start AI analysis
AI analyzes your entire codebase and provides:
- Code quality assessment
- Security vulnerabilities
- Performance optimization opportunities
- Architecture recommendations
- Missing features and improvements
- Step-by-step implementation plan
80+ file types supported including:
- JavaScript/TypeScript (
.js,.ts,.tsx) - Python (
.py,.pyx) - Java, Go, Rust, C/C++, C#
- Ruby, PHP, Swift, Kotlin, Dart
- HTML, CSS, SCSS, Markdown
- JSON, XML, YAML, SQL, GraphQL
- Config files:
package.json,tsconfig.json,Dockerfile, etc.
Size Limits:
- Maximum file size: 5MB
- Maximum total size: 50MB
- Maximum 100 files per upload
Best Practices:
- Upload complete projects for comprehensive analysis
- System auto-filters unnecessary folders
- Includes config files automatically (package.json, etc.)
- Optimal: 10-50 code files per analysis
- Multiple analyses support context from previous results
React Project:
my-react-app/
├── src/ ✅ All uploaded
├── public/ ✅ Uploaded
├── package.json ✅ Uploaded
├── tsconfig.json ✅ Uploaded
├── node_modules/ ❌ Automatically ignored
└── .next/ ❌ Automatically ignored
Result: ~20 files analyzed
Python Project:
my-python-app/
├── src/ ✅ All .py files
├── tests/ ✅ Uploaded
├── requirements.txt ✅ Uploaded
├── venv/ ❌ Automatically ignored
└── __pycache__/ ❌ Automatically ignored
Result: ~15 files analyzed
- Code Viewer: Syntax-highlighted code with line numbers
- File Search: Filter files by name in the list
- Copy to Clipboard: One-click code copying
- Session Management: Temporary file storage, auto-cleanup after 1 hour
- Real-time Streaming: Live analysis results as they're processed
Purpose: Initiates task analysis and AI orchestration.
Request Format:
{
"task": "Question or task text",
"history": [
{
"role": "user",
"parts": [{"text": "Previous question"}]
},
{
"role": "model",
"parts": [{"text": "Previous response"}]
}
]
}Response Format: Server-Sent Events (SSE)
data: {"source":"orchestrator","type":"status","payload":{"status":"running",...},"timestamp":1234567890}
data: {"source":"arbiter","type":"thought","payload":{"message":"Thought..."},"timestamp":1234567891}
data: {"source":"arbiter","type":"tool_call","payload":{"functionName":"performSearch",...},"timestamp":1234567892}
data: {"source":"arbiter","type":"tool_result","payload":{"result":"Result..."},"timestamp":1234567893}
data: {"source":"chief_architect","type":"final_plan","payload":{"finalDecision":"...",...},"timestamp":1234567894}
data: {"source":"orchestrator","type":"status","payload":{"status":"completed",...},"timestamp":1234567895}
Event Types:
| Type | Source | Description |
|---|---|---|
status |
All Agents | Status update |
thought |
Agents | Thinking process |
tool_call |
Agents | Tool invocation |
tool_result |
Agents | Tool result |
final_chunk |
Agents | Final text |
final_plan |
ChiefArchitectAgent | Structured plan |
error |
All Agents | Error message |
HTTP Status Codes:
200- Success (SSE stream starts)400- Invalid request405- Method Not Allowed500- Server error
pages/index.tsx (Main Page)
├── WelcomeScreen
│ └── Suggestion Cards
├── MessageList
│ ├── User Messages
│ ├── Model Messages (ModelMessageComponent)
│ └── Loading State
│ ├── ThinkingProcess (Initial loading)
│ └── ProcessTimeline
│ ├── StepRenderer Components
│ │ ├── ThoughtStepView
│ │ ├── ToolCallStepView
│ │ ├── ToolResultStepView
│ │ ├── FinalAnswerStepView
│ │ └── FinalPlanStepView
│ └── FinalStepRenderer
└── Input Footer
├── Auto-growing Textarea
└── Send Button
Welcome screen shown on first visit.
- Smart suggestion cards
- Quick start options
- Responsive grid layout
Loading indicator shown when analysis starts.
- Animated phase messages
- Progress bar animation
- Memory efficient implementation
Displays real-time analysis steps.
- Chronological order
- Status indicators
- Inline syntax highlighting
Specialized render components for each step type:
- ThoughtStepView - Thinking steps
- ToolCallStepView - Tool invocations
- ToolResultStepView - Tool results
- FinalAnswerStepView - Final answers
- FinalPlanStepView - Structured plans
/* Mobile First Approach */
- Small screens: 320px+
- Tablets: 640px+
- Desktops: 1024px+
- Large screens: 1280px+- Theme: Dark mode compatible design
- Colors: Brand colors + accessibility
- Typography: Clear hierarchy
- Spacing: Consistent grid (8px base)
- Animations: Smooth transitions
What it does: Performs real-time web search and returns best results.
Implementation (services/tools.ts):
export async function performSearch(query: string): Promise<string> {
const apiKey = process.env.CUSTOM_SEARCH_API_KEY;
const searchEngineId = process.env.SEARCH_ENGINE_ID;
const url = `https://www.googleapis.com/customsearch/v1?key=${apiKey}&cx=${searchEngineId}&q=${encodeURIComponent(query)}&num=5`;
const response = await fetch(url);
const data = await response.json();
// Format and return
return formattedResults;
}Limitations:
- 100 searches per day (free plan)
- 10,000 searches per day (pro plan)
Models:
- gemini-2.5-pro - Primary model (more powerful)
- gemini-2.5-flash - Fallback model (faster)
Fallback Mechanism:
const modelsToTry = [this.primaryModelName, this.fallbackModelName];
for (const modelName of modelsToTry) {
try {
result = await model.generateContent({...});
break; // Success, exit loop
} catch (error) {
// Retry or try next model
}
}Schema Example (lib/schemas.ts):
export const FinalPlanSchema = z.object({
finalDecision: z.string(),
justification: z.string(),
implementationPlan: z.array(z.object({
step: z.number(),
title: z.string(),
details: z.string(),
})),
});User: "Compare Next.js and Express.js"
↓
Input validation
↓
History format: [{ role: 'user', parts: [{ text: ... }] }]
↓
POST /api/orchestrate
OrchestratorService.run()
↓
Event: orchestrator/status/RUNNING
↓
Initialize ArbiterAgent
ArbiterAgent.execute()
↓
Gemini initial analysis (Function Calling enabled)
↓
├─ performSearch("Next.js advantages") → Tool Result
├─ searchCodeExamples("Express.js") → Tool Result
└─ Analysis synthesis
↓
Events: thought, tool_call, tool_result, final_chunk, status
↓
Return: fullAnalysis text
RefinerAgent.execute(initialAnalysis)
↓
Gemini refines analysis
↓
Events: thought, final_chunk, status
↓
Return: refinedAnalysis text
ChiefArchitectAgent.execute()
↓
Gemini structured output (JSON schema)
↓
├─ Analysis phase
├─ Critique phase
└─ Synthesis phase
↓
submitFinalPlan function call
↓
Zod validation
↓
Events: final_plan, status
useOrchestration hook
↓
Event batch processing (100ms intervals)
↓
Event handlers (eventHandlers.ts)
↓
ProcessStep[] state update
↓
React re-render
↓
ProcessTimeline display
↓
Result: Final plan display
Input: "What is React?"
Expected: Quick and concise analysis
Input: "Compare REST API vs GraphQL"
Expected: Detailed comparison + implementation plan
Input: "Best practices for microservices architecture"
Expected: Structured plan + implementation steps
1. Input: "How to write backend with Node.js?"
Response: Backend setup steps
2. Input: "PostgreSQL or Redis for database?"
Response: Answer based on previous context (history consideration)
- Network error followed by fallback model test
- Invalid API key test
- Timeout handling test
-
Frontend
- Responsive design (mobile, tablet, desktop)
- Textarea auto-grow working?
- Keyboard shortcuts (Enter, Shift+Enter)
- Message history scrolling smooth?
- Syntax highlighting working?
-
Backend
- SSE streaming working?
- Event batching working correctly?
- Error events displaying?
-
AI Agents
- Tool calling working?
- Retry mechanism working?
- JSON validation successful?
// Process events in batches every 100ms
const BATCH_INTERVAL = 100;
// Process multiple events in single render
for (const event of batch) {
handler(event);
}// Prevent unnecessary re-renders
const FinalStepRenderer = React.memo(({ steps }) => {
const finalSteps = useMemo(() =>
steps.filter(s => s.type === 'FINAL_PLAN'),
[steps]
);
return ...;
});// Keep maximum 30 steps (clean up old ones)
const MAX_STEPS = 30;
if (newSteps.length > MAX_STEPS) {
const finalSteps = newSteps.filter(s => s.type === 'FINAL_ANSWER');
const otherSteps = newSteps.slice(-(MAX_STEPS - finalSteps.length));
newSteps = [...otherSteps, ...finalSteps];
}- SSE for continuous data transfer
- Progressive rendering on frontend
- Chunk-based processing on backend
Primary: gemini-2.5-pro (powerful)
↓ (3s timeout)
Fallback: gemini-2.5-flash (faster)
✅ Implemented:
- Stored in
.env.localfile (in .gitignore) - Processed server-side (not sent to client)
- Read from process.env
✅ Best Practices:
# .gitignore
.env.local
.env.*.local// Request validation
if (!task || typeof task !== 'string') {
return res.status(400).json({ error: 'Invalid task' });
}
if (!history || !Array.isArray(history)) {
return res.status(400).json({ error: 'Invalid history' });
}// Output validation
const validationResult = FinalPlanSchema.safeParse(data);
if (!validationResult.success) {
// Handle validation error
}Sensitive Info Leak Prevention:
// ❌ WRONG
throw new Error(`API Key: ${apiKey} failed`);
// ✅ RIGHT
throw new Error('Authentication failed');Add proper CORS policy in production:
res.setHeader('Access-Control-Allow-Origin', 'https://yourdomain.com');
res.setHeader('Access-Control-Allow-Methods', 'POST');For abuse prevention:
// Add rate limiting to API calls
const rateLimit = require('express-rate-limit');
const limiter = rateLimit({
windowMs: 15 * 60 * 1000, // 15 minutes
max: 100 // limit each IP to 100 requests per windowMs
});
app.post('/api/orchestrate', limiter, handler);-
Branch Naming
feature/new-feature fix/bug-name refactor/code-improvement -
Commit Messages
feat: Add new feature fix: Fix specific bug docs: Update documentation style: Code formatting refactor: Code refactoring -
Code Standards
- TypeScript strict mode
- ESLint compliance
- 2 space indentation
- Meaningful variable names
- Fork the repository
- Create feature branch
- Commit changes
- Push to branch
- Create Pull Request
- Pass all checks
- Request review
- Phase 2: Parallel agent execution
- Phase 3: Multi-language support
- Phase 4: Custom prompts library
- Phase 5: Plugin system
- Phase 6: Analytics dashboard
- Phase 7: Team collaboration features
This project is licensed under the MIT License. See the LICENSE file for details.
Barış - Full Stack Developer
- 📧 Email: [email@example.com]
- 🔗 GitHub: [@username]
- 💼 LinkedIn: [linkedin.com/in/profile]
- Google Gemini AI team
- Next.js community
- React community
- All open-source library contributors
A: Because real-world decisions are multi-dimensional. Visionary, pragmatic, and critical perspectives from different angles produce more balanced and robust solutions.
A: Usually between 30 seconds to 2 minutes, depending on question complexity.
A: No, Gemini API and Google Custom Search API are required.
A: Currently in localStorage (browser), can be stored in database for production.
A: You can host the frontend yourself. Google APIs are paid but have free tiers.
A: Currently Turkish and English prompts can be prepared.
For questions or issues:
- 🐛 Bug Report: GitHub Issues
- 💬 Discussions: GitHub Discussions
- 📧 Email: [email@example.com]
Make better AI-powered decisions with ArbiterAI! 🚀
Happy Coding! ✨