An AI-powered Code Explainer that understands, analyzes, and explains entire codebases using Qwen 2.5 running locally through Ollama. Built with a privacy-first approach, the entire application operates offline without relying on any cloud-based AI services.
Code Explainer Agent is a local-first AI assistant designed to help developers understand unfamiliar codebases quickly. Simply upload a project or repository, and the agent analyzes the complete source code, builds contextual understanding, and answers questions about the architecture, execution flow, dependencies, and implementation details.
Unlike cloud-based coding assistants, all AI inference runs locally on your machine using Qwen 2.5 via Ollama, ensuring that your source code never leaves your computer.
- Upload an entire project as a ZIP archive
- Analyze complete folder structures
- Parse thousands of source files
- Support multi-language repositories
- Automatic project indexing
- Explain complete repositories
- Explain files and modules
- Explain classes and methods
- Explain functions line by line
- Identify project architecture
- Detect design patterns
- Trace execution flow
- Analyze dependencies
- Understand configuration files
Ask questions such as:
- Explain this project.
- How does authentication work?
- Where is the database connection initialized?
- Explain this API.
- How does JWT work here?
- Which module handles payments?
- Explain this function.
- Find where this class is used.
- Why am I getting this error?
- Explain this algorithm.
- Context-aware code search
- Function search
- Class search
- API search
- Configuration search
- Dependency search
Your source code never leaves your machine.
This project does not use:
- โ OpenAI API
- โ Anthropic API
- โ Gemini API
- โ Groq API
- โ OpenRouter API
- โ Claude API
- โ Any cloud-hosted LLM
Everything runs locally through Ollama.
User
โ
โผ
React Frontend
โ
โผ
FastAPI Backend
โ
โโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโ
โ โ
โผ โผ
Repository Parser Chat Service
โ โ
โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโ
โผ
Chunking & Parsing
โ
โผ
Embedding Generator
โ
โผ
Local Vector Database
โ
โผ
Ollama Server
โ
โผ
Qwen 2.5
- React
- TypeScript
- Tailwind CSS
- Vite
- Python
- FastAPI
- LangChain
- Qwen 2.5
- Ollama
- Local Embedding Model
- Retrieval-Augmented Generation (RAG)
- ChromaDB / FAISS
- SQLite
Upload a project ZIP file.
or
Select an existing repository.
โ
The repository is extracted locally.
โ
The parser scans:
- Folder structure
- Source files
- Classes
- Functions
- Imports
- Dependencies
- Configuration files
โ
Source code is divided into semantic chunks.
โ
Embeddings are generated locally.
โ
Embeddings are stored in the local vector database.
โ
User asks a question.
โ
Relevant code is retrieved.
โ
Qwen 2.5 generates a contextual explanation.
Code-Explainer-Agent/
โโโ frontend/
โ โโโ src/
โ โโโ components/
โ โโโ pages/
โ โโโ hooks/
โ โโโ services/
โ โโโ assets/
โ
โโโ backend/
โ โโโ api/
โ โโโ parser/
โ โโโ rag/
โ โโโ embeddings/
โ โโโ services/
โ โโโ models/
โ โโโ utils/
โ โโโ main.py
โ
โโโ uploads/
โโโ vectordb/
โโโ models/
โโโ README.md
โโโ requirements.txt
git clone https://github.com/yourusername/Code-Explainer-Agent.git
cd Code-Explainer-Agentcd backend
pip install -r requirements.txtcd frontend
npm installDownload and install Ollama for your operating system.
Start the Ollama server:
ollama serveDownload the Qwen 2.5 model:
ollama pull qwen2.5Verify installation:
ollama listuvicorn main:app --reloadnpm run dev| Service | URL |
|---|---|
| Frontend | http://localhost:5173 |
| Backend | http://localhost:8000 |
| Ollama | http://localhost:11434 |
OLLAMA_URL = "http://localhost:11434"
MODEL_NAME = "qwen2.5"
EMBEDDING_MODEL = "nomic-embed-text"No API keys are required.
Explain this repository.
Describe the project architecture.
How does authentication work?
Explain the API flow.
Where is the database initialized?
Explain this class.
Explain this function.
Which files handle routing?
Find all usages of UserService.
Why is this code throwing an exception?
- Learning unfamiliar repositories
- Understanding legacy code
- Code reviews
- Architecture exploration
- Developer onboarding
- Debugging
- Documentation generation
- Educational purposes
- Multi-Agent Architecture
- Code Editing Agent
- Repository Refactoring
- Git Integration
- GitHub Repository Cloning
- UML Diagram Generation
- Documentation Generator
- Test Case Generation
- Session Memory
- Multi-Repository Support
- Workspace Management
Contributions are welcome.
- Fork the repository.
- Create a feature branch.
- Commit your changes.
- Push to your branch.
- Open a Pull Request.
If you find this project useful, consider giving it a Star โญ on GitHub.