A multi-agent AI system that automatically analyzes, debugs, and corrects Python programs using CrewAI, Code Interpreter, Pydantic, and Streamlit.
Demo Video
Debugging Python programs often requires identifying syntax, runtime, and logical errors before applying safe corrections.
This project implements a CrewAI-powered multi-agent debugging workflow where specialized AI agents collaborate to analyze code, generate corrections, and verify the debugging process.
Unlike traditional prompt-based implementations, this project introduces a Builder Pattern that separates LLM reasoning from structured artifact construction, producing deterministic and strongly typed workflow outputs.
- π€ Multi-Agent AI Debugging using CrewAI
- π Automated Syntax, Runtime & Logical Error Detection
- π Automatic Code Correction
- π§ Code Interpreter Integration
- π Builder Pattern for Structured Artifacts
- π Interactive Streamlit Dashboard
- π Observability & Execution Tracing
- π Side-by-Side Code Comparison
- π Unified Diff Viewer
- π¦ JSON Trace Export
The application consists of:
- Streamlit Frontend
- Debugging Service
- Sequential CrewAI Workflow
- Analyzer Agent
- Corrector Agent
- Manager Agent
- Builder Components
- Structured Pydantic Artifacts
- Observability Layer
User Code
β
βΌ
βββββββββββββββββββββββββββ
β Code Analyzer Agent β
βββββββββββββββββββββββββββ
β
βΌ
AnalysisResponse
β
βΌ
AnalysisBuilder
β
βΌ
AnalysisReport
β
βΌ
βββββββββββββββββββββββββββ
β Code Corrector Agent β
βββββββββββββββββββββββββββ
β
βΌ
CorrectionResponse
β
βΌ
CorrectionBuilder
β
βΌ
CorrectedCodeArtifact
β
βΌ
βββββββββββββββββββββββββββ
β Manager Agent β
βββββββββββββββββββββββββββ
β
βΌ
Verification Summary
One of the key architectural improvements in this project is the Builder Pattern.
Instead of asking the LLM to generate complex Pydantic objects directly, each agent only produces a lightweight response schema.
Dedicated Builder classes then construct rich domain artifacts.
LLM
β
βΌ
AnalysisResponse
β
βΌ
AnalysisBuilder
β
βΌ
AnalysisReport
LLM
β
βΌ
CorrectionResponse
β
βΌ
CorrectionBuilder
β
βΌ
CorrectedCodeArtifact
- Deterministic artifact construction
- Reduced prompt complexity
- Strong type safety
- Better maintainability
- Fewer schema validation failures
The debugging workflow exchanges structured artifacts throughout execution.
SourceCodeArtifact
β
βΌ
AnalysisReport
β
βΌ
CorrectedCodeArtifact
β
βΌ
Verification Summary
The project includes a lightweight observability framework that records:
- Workflow Events
- Agent Execution
- Task Completion
- Execution Metrics
- JSON Trace Export
These metrics are visualized directly inside the Streamlit application.
| Component | Technology |
|---|---|
| Framework | CrewAI |
| Language | Python |
| LLM | Groq Llama 3.3 70B |
| Validation | Pydantic v2 |
| UI | Streamlit |
| Execution | CodeInterpreterTool |
| Observability | Custom Tracer |
code-debugging-assistant/
β
βββ agents/
βββ builders/
βββ config/
βββ observability/
βββ prompts/
βββ schemas/
βββ services/
βββ tasks/
βββ utils/
β
βββ images/
βββ streamlit_app.py
βββ crew.py
βββ main.py
βββ requirements.txt
βββ README.md
Clone the repository
git clone https://github.com/ruthuraraj-ml/ai-code-debugging-assistant.gitMove into the project
cd ai-code-debugging-assistantCreate virtual environment
python -m venv .venvActivate
Windows
.venv\Scripts\activateLinux / macOS
source .venv/bin/activateInstall dependencies
pip install -r requirements.txtConfigure environment variables
GROQ_API_KEY=your_api_key
Run
streamlit run streamlit_app.pyThis project demonstrates:
- Multi-Agent AI Systems
- CrewAI Workflow Design
- Builder Design Pattern
- Pydantic Domain Modeling
- Observability for AI Applications
- Streamlit Application Development
- Software Engineering for LLM Systems
- Multi-Agent Workflow
- Builder Pattern
- Structured Artifacts
- Streamlit Dashboard
- Execution Tracing
- Code Diff Viewer
- Evaluation Benchmark Suite
- Regression Testing
- Prompt Optimization
- Improved Logical Error Detection
- Verification Artifact
- Multi-language Support
Ruthuraraj R
Assistant Professor β Mechanical Engineering
AI β’ Machine Learning β’ Generative AI β’ Agentic AI Systems









