An AI-powered autonomous development system that uses multiple intelligent agents to build complete software projects from natural language descriptions. Built with LangGraph, Google Gemini, and Python.
- π PM Agent - Generates Product Requirements Documents from user prompts
- ποΈ Architect Agent - Designs system architecture and technology stack
- π» Coder Agent - Generates production-ready code
- π Reviewer Agent - Performs comprehensive code reviews
- π§ͺ Tester Agent - Generates tests and verifies functionality
- β Critic Agent - Final meta-review and quality assurance
- π REST API - FastAPI backend for integration
- π¨ Web UI - Streamlit dashboard for visualization
- π Conditional Routing - Intelligent agent orchestration with LangGraph
- πΎ State Persistence - Checkpoint-based state management
- π Retry Logic - Automatic error recovery
User Request
β
βββββββββββββββββββββββββββββββββββββββ
β PM Agent (Requirements) β
ββββββββββββββββ¬βββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββ
β Architect Agent (Design) β
β βΈοΈ [Human Review Checkpoint] β
ββββββββββββββββ¬βββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββ
β Coder Agent (Code Generation) β
ββββββββββββββββ¬βββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββ
β Reviewer Agent (Code Review) β
β β» [Conditional: Pass?] β
ββββββββββββββββ¬βββββββββββββββββββββββ
β (if pass)
βββββββββββββββββββββββββββββββββββββββ
β Tester Agent (Test Generation) β
β β» [Conditional: Tests Pass?] β
ββββββββββββββββ¬βββββββββββββββββββββββ
β (if pass)
βββββββββββββββββββββββββββββββββββββββ
β Critic Agent (Meta-Review) β
β β» [Conditional: Rollback needed?] β
ββββββββββββββββ¬βββββββββββββββββββββββ
β (if approved)
βββββββββββββββββββββββββββββββββββββββ
β β
Final Review & Delivery β
βββββββββββββββββββββββββββββββββββββββ
- LLM: Google Gemini 2.5 Flash
- Orchestration: LangGraph
- API Framework: FastAPI
- Frontend: Streamlit
- Database: SQLite (state persistence)
- Code Execution: E2B Sandbox
- State Management: Pydantic
- Testing: pytest
langgrpah/
βββ agents/ # Agent implementations
β βββ pm_agent.py
β βββ architect_agent.py
β βββ coder_agent.py
β βββ reviewer_agent.py
β βββ tester_agent.py
β βββ critic_agent.py
βββ graph/ # LangGraph workflow
β βββ state.py # Pydantic state model
β βββ builder.py # Graph construction
β βββ conditional_routing.py
βββ tools/ # Utility tools
β βββ code_executor.py
β βββ file_generator.py
β βββ validators.py
βββ api/ # FastAPI endpoints
β βββ routes.py
βββ ui/ # Streamlit frontend
β βββ app.py
βββ tests/ # Test suite
β βββ test_agents.py
βββ config.py # Configuration
βββ main.py # CLI entry point
βββ requirements.txt # Dependencies
βββ .env.example # Environment template
# Clone the repository
git clone <repo_url>
cd langgrpah
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt# Copy the example env file
cp .env.example .env
# Edit .env with your API keys
# ANTHROPIC_API_KEY=your_key_here
# E2B_API_KEY=your_key_hereChoose how to run the system:
python main.py ui
# Open browser to http://localhost:8501python main.py api
# Open browser to http://localhost:8000/docspython main.py pipeline "Build a simple REST API for task management"python main.py pipeline "Build a user authentication system with FastAPI"from graph.state import AgentState
from graph.builder import get_graph
# Create state
state = AgentState(
user_prompt="Build a todo API with authentication"
)
# Get graph and run
graph = get_graph()
result = graph.invoke(state.dict())
print(result['generated_files_list'])# Start pipeline
curl -X POST http://localhost:8000/pipeline/start \
-H "Content-Type: application/json" \
-d '{"prompt": "Build a REST API"}'
# Check status
curl http://localhost:8000/pipeline/{session_id}/status
# Get generated code
curl http://localhost:8000/pipeline/{session_id}/outputInput: User natural language request Output: Product Requirements Document
The PM Agent:
- Analyzes the user's request
- Extracts requirements and features
- Identifies constraints and scope
- Creates a comprehensive PRD
Input: PRD from PM Agent Output: Technical Design Document
The Architect Agent:
- Proposes technology stack
- Designs API endpoints
- Plans database schema
- Creates system architecture
- Awaits human approval before proceeding
Input: Technical design and requirements Output: Production-ready code files
The Coder Agent:
- Implements all features
- Writes clean, documented code
- Follows software engineering best practices
- Generates multiple files (main.py, config.py, database.py, api.py, utils.py)
Input: Generated code Output: Code review feedback
The Reviewer Agent:
- Checks code quality
- Validates best practices
- Identifies issues and improvements
- Either approves or sends back to Coder
Input: Generated code Output: Test files and execution results
The Tester Agent:
- Generates comprehensive test suites
- Creates unit, integration, and API tests
- Executes tests in sandbox
- Reports test coverage and results
Input: All previous outputs Output: Final approval or rollback decision
The Critic Agent:
- Performs meta-review of entire pipeline
- Assesses requirement coverage
- Evaluates architecture quality
- Makes final go/no-go decision
- Can trigger rollback to earlier stages
Run the test suite:
# Install test dependencies
pip install pytest
# Run all tests
pytest tests/
# Run specific test
pytest tests/test_agents.py::TestPMAgent
# Run with coverage
pytest --cov=agents --cov=graph --cov=tools tests/The system uses a centralized AgentState Pydantic model that:
- Flows through all agents
- Maintains consistency
- Enables checkpointing
- Can be persisted to database
- Validates data types
All agents read from and write to this shared state.
The system logs all executions:
state.execution_history # List of all agent executions
state.total_tokens_used # Total tokens consumed
state.last_error # Last error message (if any)- Input validation on all APIs
- Environment variable management for secrets
- Sandboxed code execution (E2B)
- Rate limiting (can be added)
- CORS configuration (can be added)
# Build
docker build -t langgrpah .
# Run API
docker run -e ANTHROPIC_API_KEY=xxx -p 8000:8000 langgrpah python main.py api
# Run UI
docker run -e ANTHROPIC_API_KEY=xxx -p 8501:8501 langgrpah python main.py ui- Parallel Agent Execution: Some agents could run in parallel
- Caching: Cache agent outputs for similar requests
- Token Optimization: Monitor token usage per agent
- Async Operations: Already using async in FastAPI
- Multi-modal input (voice, images)
- Real-time websocket updates for UI
- Database persistence with SQLAlchemy
- More sophisticated rollback logic
- Cost tracking and optimization
- Plugin system for custom agents
- Version control integration
- Deployment automation (Docker, K8s)
Contributions welcome! Areas for improvement:
- Additional agents (DevOps, Security, Performance)
- Enhanced test coverage
- Better error handling
- Performance improvements
- Documentation
MIT License - See LICENSE file for details
-
User submits request - "Build a task management API"
-
PM Agent analyzes - Creates detailed Requirements Document with features, scope, constraints
-
Architect designs - Creates Technical Design with tech stack, API endpoints, database schema
- βΈοΈ Human Review - User reviews and approves/rejects architecture
-
Coder generates - Writes clean, production-ready code based on design
-
Reviewer checks - Reviews code for quality, best practices, and issues
-
Tester validates - Generates tests and verifies functionality
-
Critic reviews - Final meta-review with approval or rollback decision
-
Delivery - Complete codebase ready for use
For issues, questions, or suggestions:
- Open an issue on GitHub
- Check existing documentation
- Review example prompts
Made with β€οΈ using AI and Python