CodeSmith AI is a production-quality, multi-agent AI coding assistant that acts as your personal software engineering team. Built with Python, Streamlit, and Google's Gemini API, it goes beyond simple code generation by simulating an entire software development lifecycle—iteratively planning, generating, reviewing, debugging, and fixing code before delivering the final polished product.
Instead of a standard "Prompt → Code" workflow, CodeSmith AI orchestrates a pipeline of specialized AI agents that collaborate to ensure the output is modular, secure, and production-ready.
- Multi-Agent Architecture: Five distinct AI agents collaborate sequentially (Analyzer, Generator, Reviewer, Debugger, and Fixer) to ensure high-quality output.
- Automatic Disk Export: Automatically parses the AI-generated code and saves it to your local disk, fully reconstructing the required folder and file structure inside the
outputs/directory. - Interactive UI: A sleek, minimal, Apple-inspired Streamlit interface featuring a dynamic progress timeline, live stage tracking, and a tabbed results viewer.
- Downloadable Code: One-click download of the complete generated codebase into a concatenated text file.
- Robust Parsing System: Utilizes strict formatting and regex-based parsing to guarantee accurate file creation and prevent directory traversal issues.
CodeSmith AI executes your requirements through the following orchestrated pipeline:
- 🧐 Requirement Analyzer: Ingests your initial prompt, breaking it down into structured features, inputs, outputs, dependencies, and edge cases.
- 🏗️ Code Generator: Scaffolds the initial folder structure and writes the raw codebase based on the analyzed requirements.
- 🕵️ Code Reviewer: Acts as a Senior Software Engineer, scrutinizing the generated code for architecture, naming conventions, readability, scalability, and performance.
- 🐛 Bug Detector: Analyzes the code specifically for syntax errors, logical flaws, missing imports, and security vulnerabilities.
- 🛠️ Code Fixer: Takes the original code, the review comments, and the bug reports to rewrite the final, bug-free, and optimized codebase.
Here is exactly how CodeSmith AI generates your project from start to finish:
- User Input: The user provides a natural language prompt describing the desired software, feature, or script.
- Analysis: The Analyzer Agent processes the prompt to create a detailed requirement specification, outlining features, inputs/outputs, and edge cases.
- Draft Generation: The Generator Agent takes the parsed requirements and outputs a complete, drafted codebase with the appropriate folder structure.
- Code Review: The Reviewer Agent analyzes the generated draft for code quality, architecture, and best practices, producing a list of suggested improvements.
- Bug Detection: The Debugger Agent scans the drafted code for syntax errors, logical flaws, missing imports, and security vulnerabilities.
- Code Refinement: The Fixer Agent ingests the original draft alongside the review comments and bug reports to produce a final, optimized, and bug-free version of the code.
- Export & Save: The final corrected code is parsed by the application and automatically saved to your local disk in the
outputs/directory, completely reconstructing the project folder structure.
Follow these steps to get CodeSmith AI running locally.
Ensure you have Python 3.9+ installed on your system.
Navigate to the project directory, then create and activate a virtual environment:
cd codesmith-ai
python3 -m venv .venv
# On macOS/Linux:
source .venv/bin/activate
# On Windows:
# .venv\Scripts\activatepip install -r requirements.txtCreate your local environment file:
cp .env.example .envOpen the .env file and add your Gemini API key:
GEMINI_API_KEY=your_actual_api_key_here
GEMINI_MODEL=gemini-3.1-flash-litestreamlit run app.pyThis will launch the application in your default web browser (usually at http://localhost:8501).
When a prompt is successfully processed, the final fixed code is passed to the Parser Utility.
The parser scans the Markdown output for strict ### File: path/to/file.ext signatures. It automatically generates a unique timestamped folder (e.g., outputs/project_20240510_153022/), creates the necessary subdirectories, and writes the raw code files directly to your machine.
- Frontend: Streamlit
- Backend: Python 3
- LLM Engine: Google Generative AI (Gemini)
- Configuration:
python-dotenv