Idea → Architecture → Code → Tests → Docs → Running App A multi-agent AI pipeline that takes a plain-English project idea all the way to a running, downloadable codebase — with human approval gates at every critical step.
You type an idea. MAX.sys does the rest:
You: "build a task manager with a REST API and SQLite"
│
▼
┌─────────────┐
│ ARCHITECT │ Full system design — folder structure,
│ │ tech stack, API design, module breakdown
└──────┬──────┘
│ ✋ You review & approve (or request changes)
▼
┌─────────────┐
│ BUILDER │ Writes every file. Production-ready,
│ │ no placeholders, no TODOs.
└──────┬──────┘
│ ✋ You review & approve (or request changes)
▼
┌───────────┐ ┌──────────┐ ┌──────────────┐
│ TESTER │ → │ WRITER │ → │ RUNNER │
│ bug report│ │ README.md│ │ serve/proxy │
└───────────┘ └──────────┘ └──────────────┘
│ │
└──────── auto, no gates ──────┘
│
✓ Files written to disk
✓ App running & previewed
✓ ZIP ready to download
- 4 specialized AI agents — Architect, Builder, Tester, Writer, each with a focused single job
- Human approval gates after Architect and Builder — approve to advance or iterate as many times as needed
- Smart intent detection — type naturally; the backend classifies your message as APPROVE or IMPROVE automatically
- Automatic file writing — parses the builder's output and writes every file to
projects/<name>/on disk - Smart project type detection — detects Static, Flask, or Node from the written files
- Universal preview — all project types served through MAX's own server at
localhost:5000:- Static HTML/JS/CSS → served directly at
/preview/<name>/ - Flask / FastAPI → patched for correct port binding, proxied at
/proxy/<name>/ - Node.js → proxied at
/proxy/<name>/
- Static HTML/JS/CSS → served directly at
- Flask auto-patcher — fixes common LLM-generated issues before running (wrong port,
debug=True, missingapp.run) - Live terminal — real-time subprocess output streamed via SSE
- File explorer — browse and syntax-highlight every written file in the UI
- ZIP download — download the full project as a
.zipin one click - Session persistence — pipeline state saved to
session.jsonafter every step; survives server restarts - Project history — every completed project logged to
history.jsonwith preview, ZIP, and restore buttons - Robust file parser — handles 6+ LLM output format variations with multi-pattern regex and fallback mode
- Debug endpoint —
GET /debug/parseshows what the parser extracted if a write looks incomplete
| Agent | Job | Gate |
|---|---|---|
| ARCHITECT | Complete architecture doc — tech stack, folder tree, module breakdown, API design, implementation notes, and run metadata (PROJECT_NAME, RUN_COMMAND, INSTALL_COMMAND, PORT) |
✅ User approves |
| BUILDER | Implements every file from the architecture doc. Full production-quality code, no stubs | ✅ User approves |
| TESTER | Static analysis, bug report table (file/issue/severity), fixed code for critical bugs, test cases, quality score 1–10 | ❌ Auto |
| WRITER | Generates a complete README.md from the architecture, code, and test report |
❌ Auto |
MAX.sys never opens an external port in the browser. All previews are routed through localhost:5000:
| Detected type | Detection logic | How previewed |
|---|---|---|
static |
Has .html files or only web-safe extensions |
Served directly at /preview/<name>/ — instant |
flask |
in progress | in progress |
node |
in progress | in progress |
other |
Python with no web framework (CLI, scripts) | Subprocess runs, no iframe preview |
| Layer | Technology |
|---|---|
| LLM API | Groq |
| Models | meta-llama/llama-4-scout-17b-16e-instruct and groq/compound |
| Backend | Python · Flask · Flask-CORS |
| Frontend | Vanilla HTML / CSS / JS — single file, no build step |
| Markdown | marked.js |
| Syntax highlighting | highlight.js |
| Config | python-dotenv |
- Python 3.7+
- A Groq API key — free tier works
pip
1. Clone the repository
git clone https://github.com/Samin-Saikia/MAX.sys-Multi-Agent-Software-Builder
cd max-sys2. Install dependencies
pip install flask flask-cors groq python-dotenv3. Set your API key
cp .env.example .envEdit .env:
GROQ_API_KEY=your_groq_api_key_here4. Run
python app.py5. Open
http://localhost:5000
Type your idea and press Enter:
a REST API for a task manager with user auth and SQLite
vanilla JS pomodoro timer, dark theme, saves to localStorage
flask dashboard that shows live CPU and memory usage with charts
After the Architect or Builder responds, an approval bar appears:
- ✓ Approve — advance to the next stage
- ✏ Improve (or just type) — send feedback for a revision
# Architecture gate — example feedback
"use PostgreSQL instead of SQLite"
"add WebSocket support for live updates"
"split the auth module into a separate blueprint"
# Build gate — example feedback
"the login route is missing input validation"
"add a requirements.txt file"
"the CSS is too basic, improve the styling"Iterate as many times as needed. The pipeline only advances when you approve.
- Tester reviews code — bug report + test cases (auto)
- Writer generates
README.md(auto) - Files written to
projects/<name>/ - App launched (server projects) or served directly (static)
- Preview loads in the right panel
- ZIP ready to download
| Tab | Contents |
|---|---|
| ▶ Terminal | Live subprocess output — install logs, startup, runtime errors |
| ⬡ Files | File tree + syntax-highlighted viewer for every written file |
| ◈ Preview | Live iframe of the running app |
| ◷ History | All past completed projects — preview, ZIP, or restore |
max-sys/
├── app.py # Flask backend — pipeline, agents, file parser,
│ # runner, patcher, preview/proxy routes
├── index.html # Frontend — single HTML file, no build step
├── session.json # Auto-created — current pipeline state (survives restarts)
├── history.json # Auto-created — index of all completed projects
├── projects/ # Auto-created — one subfolder per built project
│ └── <name>/
├── .env # Your Groq API key (never commit this)
├── .env.example # Key template
└── README.md # This file
Main pipeline endpoint. Routes user messages through the state machine.
Request
{ "message": "build a weather dashboard using open-meteo API" }Response
{
"stage": "await_arch_approval",
"agent": "ARCHITECT",
"message": "...",
"waiting_for": "approval",
"pipeline_status": { "arch": true, "build": false, "test": false, "write": false },
"project": { "name": "", "port": null }
}Server-Sent Events stream of live subprocess output. Consumed by the terminal panel.
Returns whether the subprocess port is currently accepting connections.
{ "ready": true, "port": 5001, "ptype": "flask", "preview": "/proxy/my-app/" }All files in the current project folder with paths, contents, and sizes.
Streams the project as a .zip. Supports ?project= to download any past project by name.
Serves static project files directly from disk.
Reverse-proxies to the running subprocess. Retries up to 6× with 1s gaps before returning a friendly auto-refresh page.
Shows what the file parser found in the current build output — useful when a project write looks incomplete.
Returns the full list of completed past projects.
Restores a past project's metadata into the pipeline state.
Terminates the running subprocess. Pipeline state is preserved.
Kills any subprocess and wipes all pipeline state back to idle. Deletes session.json. The projects/ folder is kept.
Returns current stage, conversation history, and pipeline status flags.
| Stage | Description |
|---|---|
idle |
Waiting for a project idea |
await_arch_approval |
Architecture ready — waiting for approval or feedback |
builder |
Builder generating code |
await_build_approval |
Code ready — waiting for approval or feedback |
tester |
Tester running (auto) |
writer |
Writer generating README (auto) |
running |
Files written, subprocess starting |
done |
Complete — type a new idea to restart |
Two JSON files are created automatically in the project root:
session.json — written after every state change. On the next python app.py startup, the pipeline is restored exactly where it left off. If the server crashed mid-run, the stage drops back to done so nothing is lost.
history.json — one entry appended each time the pipeline completes. Stores project name, type, preview URL, original idea, and timestamp. The ◷ History tab reads this file.
Running ↺ reset deletes session.json so the next startup begins fresh.
| Variable | Required | Description |
|---|---|---|
GROQ_API_KEY |
✅ | From console.groq.com/keys |
- Flask preview latency — Flask apps need time to install deps and start up. The proxy retries automatically and the terminal shows live progress.
- Single session — one active pipeline at a time; designed for solo local use
- In-memory subprocess state — restarting
app.pykills any running subprocess (the project files on disk are unaffected) - Token cap — Groq's 4096-token output limit may truncate very large projects
- No auth — do not expose port 5000 on a public network
Samin Saikia
Python Developer focused on backend systems, AI agents, and practical software tools.
- GitHub: https://github.com/Samin-Saikia
- LinkedIn: https://www.linkedin.com/in/samin-saikia-b7660b3a1/
Built as an experimental research project exploring multi-agent software development pipelines.
- Fork the repo
- Create a branch:
git checkout -b feature/your-feature - Commit:
git commit -m "add: your feature" - Push and open a Pull Request
MIT — see LICENSE for details.


