β‘ Autonomous AI Software Engineer β Powered by LangGraph & Multi-Model LLMs (Groq, Gemini, OpenAI, Claude)
Plan β Code β Validate β Execute β Self-Heal
A fully autonomous, multi-agent software engineering system that plans, writes, validates, executes, and self-heals Python code inside an isolated Docker sandbox β powered by your choice of LLM (Groq, Gemini Free Tier, OpenAI GPT-4o, or Anthropic Claude).
| Feature | Description |
|---|---|
| π§ Multi-Model Support | Choose your engine: Lightning-fast Groq (Llama), Free Tier Google Gemini, OpenAI GPT-4o, or Anthropic Claude 3.5. Configure seamlessly via .env. |
| π³ Docker Sandbox Execution | All generated code runs inside ephemeral python:3.11-slim containers with 10s timeouts β your host machine is never at risk |
| β‘ WebSocket Live Terminal | Real-time streaming of Docker sandbox output directly to the UI, providing an interactive terminal experience |
| π¬ AST-Powered Validator | Self-healing code pipeline β an ast.NodeVisitor statically analyzes every generated script for unsafe operations, hardcoded secrets, and missing try/except blocks before execution |
| π GitHub Integration | Autonomous repository navigation β the Coder can browse directories and read files from any GitHub repo using built-in PyGithub tools |
| π Tavily Web Search | Real-time API documentation lookup via Tavily β with strict intent-routing to prevent tool over-triggering |
| π Self-Healing Debugger | If code crashes in the sandbox, tracebacks are automatically fed back to a Debugger agent that rewrites stdlib-only fixes in a closed loop |
| πΎ Persistent Memory | PostgreSQL-backed checkpointing β conversation state survives page reloads with sliding-window context injection |
| π₯οΈ Pro IDE Frontend | Modern Next.js frontend with live pipeline graph, syntax-highlighted code editor, real-time terminal, and seamless chat experience |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β LangGraph State Machine β
β β
β START βββΈ Router βββ¬βββΈ Planner βββΈ Coder βββΈ Validator βββ¬βββΈ Terminal β
β β β² β β β β
β β ββββββββββββββββ (reject) β β β
β β (self-reflection loop) β βΌ β
β β β Debugger β
β β β β β
β β ββββββββ β
β ββββΈ Research Agent βββΈ END β
β ββββΈ Knowledge Agent βββΈ END β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββΌββββββββββββββββββ
β Docker Sandbox (ephemeral) β
β python:3.11-slim Β· 10s timeout β
ββββββββββββββββββββββββββββββββββββββ
- π§ Router β Classifies user intent (
coding/research/generic) to avoid unnecessary Docker spin-ups - π Planner β Generates a mission brief with artifact targeting and strategy selection
- π» Coder β Groq Llama 3.3 generates Python code using a ReAct tool-calling loop (GitHub + Tavily)
- β Validator β AST-based static analysis catches dangerous ops, secrets, and missing error handling
- π³ Terminal β Executes validated code inside an ephemeral Docker container
- π§ Debugger β Feeds tracebacks back for autonomous self-healing repairs (up to 5 attempts)
| Requirement | Version | Purpose |
|---|---|---|
| Python | 3.9+ | Runtime |
| Node.js | 18+ | Frontend Runtime |
| Docker Desktop | Latest | Sandboxed code execution |
| PostgreSQL | 16+ (via Docker Compose) | LangGraph state persistence |
| Groq API Key | β | π§ Primary LLM engine (get one free) |
| Tavily API Key | β | π Web search tool (get one free) |
| GitHub Token | β | π Repository access (optional) |
git clone https://github.com/Harsh-Sharma29/AutoForge.git
cd AutoForge
python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS / Linux
source .venv/bin/activate
pip install -r requirements.txtcp .env.example .envEdit .env with your API keys:
# LLM Configuration (groq, gemini, openai, anthropic)
LLM_PROVIDER=gemini
LLM_MODEL=gemini-2.5-flash
# API Keys (Provide the one corresponding to your LLM_PROVIDER)
GEMINI_API_KEY=AIza...
GROQ_API_KEY=gsk_your_groq_api_key_here
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
TAVILY_API_KEY=tvly-your_tavily_key_here
GITHUB_ACCESS_TOKEN=ghp_your_github_token_here
# Database (auto-configured by Docker Compose)
DATABASE_URL=postgresql://autoforge:autoforge@localhost:5432/autoforge?sslmode=disable
AUTOFORGE_API_URL=http://localhost:8005
NEXT_PUBLIC_API_URL=http://localhost:8005The quickest way to start the entire stack (Database, Backend, and Frontend) is via Docker Compose:
docker compose up -d --build
β οΈ Make sure Docker Desktop is running before this step.
If you prefer to run the components manually instead of using Docker Compose for everything:
Open two separate terminals:
Terminal 1 β π₯οΈ FastAPI Backend:
cd backend
python -m uvicorn src.api.server:app --host 127.0.0.1 --port 8005Terminal 2 β π¨ Next.js Frontend:
cd frontend
npm install
npm run devNavigate to http://localhost:3005, enter a coding prompt, and click π Execute Pipeline.
| Agent | Responsibility |
|---|---|
| π§ Router | Intent classification β coding / research / generic β before any expensive work |
| π Planner | Mission brief, artifact targeting, and strategy selection |
| π» Coder | Groq Llama 3.3 code synthesis with ReAct tool-calling loop and multi-file workspace output |
| β Validator | Pre-sandbox AST-based static analysis (dangerous ops, secrets, error handling) |
| π³ Terminal | Docker sandbox execution with 10-second timeout |
| π§ Debugger | Traceback-driven self-healing repair loop (stdlib-only rewrites) |
| π Research | Technical research answers (no sandbox) |
| π‘ Knowledge | Generic Q&A (no sandbox) |
| Loop | Cap | Exit Condition |
|---|---|---|
| Coder β Validator | 3 attempts | Pass validation, or force Terminal |
| Coder β ToolNode | 3 rounds | Max tool-calling rounds reached |
| Terminal β Debugger | 5 attempts | is_verified=True, empty errors, or cap reached |
| LangGraph global | recursion_limit=50 |
Hard ceiling on total node invocations |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/v1/health |
System health: Postgres status, API key status, telemetry |
POST |
/api/v1/session/new |
Generate a new backend-authoritative thread_id |
GET |
/api/v1/history/{thread_id} |
Retrieve conversation history for a session |
POST |
/api/v1/execute |
Execute the LangGraph pipeline (SSE streaming response) |
AutoForge/ βββ docker-compose.yml # Full stack: Postgres + Backend + Frontend βββ .env.example # Environment template βββ backend/ β βββ main.py # CLI LangGraph entry point β βββ Dockerfile # FastAPI backend image β βββ requirements.txt # Python dependencies β βββ src/ β βββ api/ β β βββ server.py # FastAPI backend β SSE streaming, endpoints β βββ core/ β βββ agents/ β βββ tools/ βββ frontend/ βββ Dockerfile # Next.js frontend image βββ package.json # Node dependencies βββ src/ # Next.js App Router code
| Variable | Required | Description |
|---|---|---|
LLM_PROVIDER |
β | groq, gemini, openai, or anthropic |
LLM_MODEL |
β | e.g. gemini-2.5-flash, gpt-4o, llama3-70b-8192 |
GEMINI_API_KEY |
Required if LLM_PROVIDER=gemini (Free Tier available) | |
GROQ_API_KEY |
Required if LLM_PROVIDER=groq | |
TAVILY_API_KEY |
Tavily web search for real-time docs | |
GITHUB_ACCESS_TOKEN |
β Optional | GitHub repository access |
DATABASE_URL |
β | PostgreSQL connection string |
AUTOFORGE_API_URL |
β | FastAPI backend URL (http://localhost:8000) |
HUGGINGFACEHUB_API_TOKEN |
β Optional | HuggingFace Hub token for failover LLM |
| Type | Example | Pipeline Path |
|---|---|---|
| π» Coding | Write a Python script that fetches JSON from an API and handles a missing items key. |
Router β Planner β Coder β Validator β Terminal β Debugger |
| π GitHub | Read the README from langchain-ai/langchain and summarize it. |
Router β Planner β Coder (GitHub tools) β Validator β Terminal |
| π Research | Explain how LangGraph conditional routing works. | Router β Research β END |
| π‘ Generic | What are the trade-offs between monoliths and microservices? | Router β Knowledge β END |
| Control | Status |
|---|---|
| Ephemeral containers (auto-removed) | β |
| Read-only volume mount for scripts | β |
| 10-second execution timeout | β |
| AST-based Validator (static analysis) | β |
| API error payload interception | β |
Dangerous pattern detection (eval, exec, os.remove) |
β |
| Hardcoded credential detection | β |
Threat model: Suitable for trusted developer workflows and portfolio demonstrations.
MIT
Built with β€οΈ by Harsh Sharma
Powered by π§ Groq Β· π¦ LangGraph Β· π³ Docker Β· π PyGithub Β· π Tavily