Skip to content

Commit 8a2e0e3

Browse files
feat: transform to AI Development Cockpit with LangGraph orchestration
Major architectural transformation from dual-domain platform to AI agent orchestration system that democratizes coding. ## Vision Change - FROM: Dual-domain LLM platform (SwaggyStacks/ScientiaCapital) - TO: AI Development Cockpit that transforms noobs into software engineering managers - Target users: Beginners who want to build software by managing AI agent teams ## Architecture - LangGraph 1.0 multi-agent state machine orchestration - Human-in-the-loop approval gates (architecture, testing, deployment) - Service-to-service integration with ai-cost-optimizer microservice - 90% cost savings via intelligent LLM routing ## New Structure - src/orchestrator/ - LangGraph state machine and workflow - graph.ts - Main state graph with approval gates - AgentOrchestrator.ts - High-level orchestration API - src/agents/ - AI agent implementations - BaseAgent.ts - Abstract base class with cost-optimized thinking - CodeArchitect.ts - System design and architecture planning - src/services/cost-optimizer/ - Integration with ai-cost-optimizer service - CostOptimizerClient.ts - Service-to-service HTTP client - src/types/orchestrator.ts - Complete type definitions for orchestration system ## Dependencies Added - @langchain/core ^0.3.28 - @langchain/langgraph ^0.2.42 - @langchain/openai ^0.3.18 - langchain ^0.3.11 - uuid ^11.0.3 ## Documentation Updates - README.md: Complete rewrite with democratization vision - CLAUDE.md: LangGraph architecture and agent system docs - .env.example: Updated for ai-cost-optimizer microservice integration - package.json: Renamed from dual-domain-llm-platform to ai-development-cockpit ## 5 Core Agents (Initial Implementation) 1. CodeArchitect - System designer (implemented) 2. BackendDeveloper - API & database builder (placeholder) 3. FrontendDeveloper - UI/UX builder (placeholder) 4. Tester - Quality assurance (placeholder) 5. DevOpsEngineer - Deployment & infrastructure (placeholder) 🚀 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 45ccaab commit 8a2e0e3

10 files changed

Lines changed: 2499 additions & 776 deletions

File tree

.env.example

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,18 @@ NEXT_PUBLIC_SUPABASE_ANON_KEY="your_supabase_anon_key_here" # Required: Supabase
4949
SUPABASE_SERVICE_ROLE_KEY="your_service_role_key_here" # Required: Admin operations & migrations
5050

5151
# ----------------------------------------------------------------------------
52-
# COST OPTIMIZER CONFIGURATION (ai-cost-optimizer integration)
52+
# COST OPTIMIZER CONFIGURATION (ai-cost-optimizer microservice integration)
5353
# ----------------------------------------------------------------------------
54-
COST_OPTIMIZER_ENABLED="true" # Enable intelligent routing (true/false)
55-
COST_OPTIMIZER_DEFAULT_TIER="auto" # Routing strategy: auto | free | mid | premium
56-
COST_OPTIMIZER_COMPLEXITY_THRESHOLD="100" # Token count for simple vs complex (default: 100)
57-
COST_OPTIMIZER_DAILY_BUDGET="5.00" # Daily budget in USD (alerts when exceeded)
58-
COST_OPTIMIZER_MONTHLY_BUDGET="50.00" # Monthly budget in USD (hard limit)
59-
COST_OPTIMIZER_API_URL="http://localhost:3001" # Internal API endpoint
60-
COST_OPTIMIZER_SAVINGS_TARGET="0.60" # Target 60% cost reduction
54+
# The ai-cost-optimizer is a SEPARATE microservice deployed independently
55+
# GitHub: https://github.com/ScientiaCapital/ai-cost-optimizer
56+
# This service routes AI requests to the most cost-effective provider
57+
# providing 90% cost savings (Gemini free tier → Claude Haiku → Premium)
58+
# ----------------------------------------------------------------------------
59+
COST_OPTIMIZER_API_URL="https://your-cost-optimizer-vercel-url.vercel.app" # Required: ai-cost-optimizer service URL
60+
# Production: Your Vercel deployment URL
61+
# Development: http://localhost:3002 (if running locally)
62+
COST_OPTIMIZER_API_KEY="your_cost_optimizer_api_key_here" # Required: API key for cost optimizer service
63+
# Generate from ai-cost-optimizer dashboard
6164

6265
# ----------------------------------------------------------------------------
6366
# RUNPOD CONFIGURATION (Serverless Chinese LLMs)
@@ -120,27 +123,36 @@ ENABLE_MARKETPLACE="true" # Enable model marketp
120123
# ============================================================================
121124
# NOTES:
122125
# ============================================================================
123-
# 1. Cost Optimization Strategy:
124-
# - 70% of queries route to Gemini Flash (FREE)
126+
# 1. Architecture Overview:
127+
# - This is an AI DEVELOPMENT COCKPIT - orchestrates AI agents to build software
128+
# - Integrates with ai-cost-optimizer microservice for 90% cost savings
129+
# - LangGraph-based multi-agent system with human-in-the-loop approval gates
130+
# - Transforms noobs into software engineering managers
131+
#
132+
# 2. Cost Optimization Strategy (via ai-cost-optimizer microservice):
133+
# - 70% of queries route to Gemini Flash (FREE via ai-cost-optimizer)
125134
# - 25% route to Claude Haiku (~$0.13/day)
126-
# - 5% route to RunPod Chinese LLMs (~$0.05/day)
127-
# - Expected monthly cost: $15-20 (vs $45-50 without optimization)
135+
# - 5% route to Premium models when needed
136+
# - Expected monthly cost: $4-5 (vs $45-50 without optimization)
137+
#
138+
# 3. Required API Keys (Minimum to start):
139+
# - COST_OPTIMIZER_API_URL + API_KEY (ai-cost-optimizer service)
140+
# - NEXT_PUBLIC_SUPABASE_URL + ANON_KEY (authentication & database)
128141
#
129-
# 2. Required API Keys (Minimum to start):
130-
# - GOOGLE_API_KEY (free tier available)
131-
# - ANTHROPIC_API_KEY (required for complex queries)
132-
# - OPENROUTER_API_KEY (fallback routing)
133-
# - NEXT_PUBLIC_SUPABASE_URL + ANON_KEY (authentication)
142+
# 4. ai-cost-optimizer Setup:
143+
# - Deploy ai-cost-optimizer separately to Vercel
144+
# - GitHub: https://github.com/ScientiaCapital/ai-cost-optimizer
145+
# - Configure API keys in that service (GOOGLE_API_KEY, ANTHROPIC_API_KEY, etc.)
146+
# - This cockpit only needs the cost optimizer's URL and API key
134147
#
135-
# 3. Optional but Recommended:
148+
# 5. Optional but Recommended:
136149
# - RUNPOD_API_KEY (for Chinese LLM support)
137150
# - REDIS_URL (for caching and performance)
138-
# - COST_ALERT_WEBHOOK (for budget monitoring)
139151
#
140-
# 4. Security Best Practices:
152+
# 6. Security Best Practices:
141153
# - Never commit this file with real keys
142154
# - Use .env.local for actual credentials (gitignored)
143155
# - Rotate keys regularly
144-
# - Use service role keys only server-side
156+
# - The ai-cost-optimizer handles LLM API keys - this service only talks to optimizer
145157
#
146158
# ============================================================================

0 commit comments

Comments
 (0)