AI Code Debugger (branded as AI Code Architect) is an advanced real-time code analysis tool designed to help developers identify syntax errors, logical bugs, and optimization opportunities.
Powered by Groq (Llama-3) for high-speed inference and HuggingFace Embeddings for RAG (Retrieval-Augmented Generation), this tool provides instant, context-aware feedback in a professional chat interface.
- ⚡ Ultra-Fast Analysis: Uses Groq's LPU inference engine with Llama-3-70b/Mixtral models.
- 🧠 RAG Integration: Retrieves coding "Best Practices" from a local Vector Database (FAISS) to ground the AI's responses.
- 💬 Modern Chat UI: Features a WhatsApp-style interface with "User-Right / Bot-Left" alignment and typing animations.
- 🐞 Dual-Layer Detection: Identifies both Syntax Errors (missing colons, brackets) and Logic Errors (infinite loops, resource leaks).
- 🌊 Streaming Responses: Simulates a natural conversation with typewriter-style text streaming.
- Frontend: Streamlit (Custom CSS for Dark Mode & Layout)
- LLM Engine: Groq API (Llama-3 / Mixtral)
- Orchestration: LangChain
- Embeddings: HuggingFace (
all-MiniLM-L6-v2) - Vector Store: FAISS (CPU Optimized)
AI-Code-Debugger/
├── .env # API Keys (Create this file manually)
├── .gitignore # Git ignore rules
├── requirements.txt # Python dependencies
├── main.py # Application Entry Point (UI & Stream Logic)
└── src/
├── __init__.py
├── llm_engine.py # RAG Logic, Groq Client, & Streaming
└── utils.py # Custom CSS, Animations, & Layout Configuration
Follow these steps to set up the project locally.
git clone [https://github.com/yathik-2622/AI-Code-Debugger.git](https://github.com/yathik-2622/AI-Code-Debugger.git)
cd AI-Code-Debugger
# Windows
python -m venv venv
venv\Scripts\activate
# Mac/Linux
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Create a file named .env in the root directory and add your Groq API Key:
GROQ_API_KEY=gsk_your_actual_api_key_here
(You can get a free key from console.groq.com)
streamlit run main.py
- Select Language: Choose your programming language (Python, C++, Java, etc.) from the sidebar.
- Paste Code: Paste your buggy code snippet into the chat input bar at the bottom.
- Analyze: Press Enter. The AI will:
- Show a "Thinking" animation (Bouncing dots).
- Retrieve relevant coding context.
- Stream a detailed report including Diagnosis, Fix, and Explanation.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
