CodeWise is a private, local AI assistant that helps you understand a codebase by asking it questions. Load a project (files, a folder, a zip, or a GitHub repository), ask questions in plain English, and get answers grounded in your actual code, with the file names and line numbers they came from.
Everything runs on your own machine. Qwen2.5-Coder runs locally through Ollama, your code is indexed in a local ChromaDB, and nothing is sent to a cloud service.
"Who calls
process_pdf_pipeline?" · "How does the upload flow work?" · "What depends onstore.py?"
Bring in a whole project
- 📂 Upload files, whole folders (drag and drop), or
.ziparchives - 🐙 Import a GitHub repository by pasting its URL
- 🧹 Skips noise automatically:
node_modules,venv,.git, lockfiles, minified bundles, and anything in your.gitignore
Ask and get grounded answers
- 💬 Plain-English questions, with follow-ups that understand "it" and "that"
- ⚡ Answers stream in word by word, with a Stop button
- 📄 Every answer lists its sources: file, line range, and function or class
- 🙅 Says so when the answer isn't in your code, instead of guessing
Understand how code connects
- 🔗 Maps which functions call which, and which files import which
- 🎯 Answers "who calls X?" and "what depends on this file?" from the real structure of the code
Review the whole project
- 📊 AI Code Audit: architecture, patterns, code quality and security concerns across the project
flowchart LR
Q["Your question"] --> R["Rewrite follow-ups"]
R --> S1["Search by meaning<br/>(vectors)"]
R --> S2["Search by name<br/>(BM25 keywords)"]
R --> S3["Call / import graph"]
S1 & S2 & S3 --> F["Fuse rankings"]
F --> P["Prompt with numbered<br/>code lines"]
P --> M["Qwen2.5-Coder<br/>(Ollama)"]
M --> A["Streamed answer<br/>+ sources"]
- Structure-aware chunking. Code is split into whole functions and classes (Python by syntax tree; JS/TS, Java, Go, Rust, C/C++ by code blocks), not arbitrary slices.
- Code-aware embeddings.
nomic-embed-textturns each chunk, labelled with its file, function and lines, into a vector stored in ChromaDB. - Hybrid search. Meaning-based search, keyword search that understands
snake_caseandcamelCase, and the call/import graph are combined with Reciprocal Rank Fusion. - Grounded prompts. The best chunks are sent with real line numbers, fitted to the model's context window.
- Local generation. Qwen2.5-Coder writes the answer, which streams back to the browser.
Details: Architecture guide.
You'll need Python 3.10+, Node.js 20.19+, and Ollama.
# 1. Models (one time)
ollama pull qwen2.5-coder:7b
ollama pull nomic-embed-text
# 2. Backend
git clone https://github.com/shekharsanskar9/CodeWise.git
cd CodeWise
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
python backend.py # http://127.0.0.1:8000
# 3. Frontend (second terminal)
cd frontend
npm install
npm run dev # open http://localhost:5173Then click Create Project, upload some code, and start asking.
💡 On a Mac, the backend uses port 8000 because macOS reserves 5000 for AirPlay Receiver.
To change models, limits or ports, copy .env.example to .env and edit it. See Configuration.
| Guide | What's inside |
|---|---|
| Architecture | Components, upload and question flows, code graph, data storage, design decisions |
| API reference | Every endpoint with request/response examples |
| Configuration | All settings and when to change them |
| Development | Dev setup, tests, where to make common changes |
| Evaluation | Measuring search and answer quality |
| Troubleshooting | Fixes for common problems |
There's also a friendlier overview in the project wiki.
| Layer | Tools |
|---|---|
| Backend | Python, Flask, ChromaDB, SQLite |
| Models | Ollama · Qwen2.5-Coder 7B (answers) · nomic-embed-text (search) |
| Frontend | React, Vite, Tailwind CSS, Lucide icons |
| Quality | pytest (~90 tests), retrieval and answer-quality evaluation |
backend.py Entry point
codewise/ Backend package: ingestion, search, prompts, code graph, API
frontend/ React app
tests/ pytest suite (runs without Ollama)
eval/ Retrieval and answer-quality evaluation
docs/ Documentation
Python, JavaScript, TypeScript, Java, Kotlin, C, C++, C#, Go, Rust, PHP, Ruby, Swift, SQL, plus HTML, CSS, JSON, YAML, TOML, XML and Markdown.
Structure-aware chunking and the call/import graph are most accurate for Python, then JavaScript/TypeScript.
- Slower than cloud tools. About 20–40 seconds per answer on an M4 MacBook with 16 GB. That's the cost of running a 7B model locally.
- A small model is still a small model. Great at explaining and finding code, weaker at deep reasoning across many files, and it occasionally gets a path slightly wrong. Always check the sources.
- Calls are matched by name. Two functions both called
saveare treated as one, and dynamic calls aren't detected. - A snapshot of your code. After editing, upload the changed files again.
- No user accounts. It's built to run on your own machine, not on the public internet.
| Version | Highlights |
|---|---|
| 1.0 | First working version: upload files, ask questions, answers with sources |
| 2.0 | Rebuilt search: structure-aware chunking, code-aware embeddings, hybrid search, follow-up rewriting, correct line numbers, saved project data, tests |
| 3.0 | Folder, zip and GitHub import; streaming answers; call/import graph; answer-quality evaluation |
- Remember the open project across page reloads, and list or delete projects
- Background imports with progress for very large repositories
- Optional hosted model for users who prefer speed over privacy
- Re-index only the files that changed
- VS Code extension
- Docker deployment
Sanskar Shekhar
Computer Science Engineer
AI • Machine Learning • Full Stack Development
The objective of CodeWise is to enable developers to interact with their codebase using natural language. By combining Retrieval-Augmented Generation with hybrid search, a code graph and a locally hosted LLM, CodeWise delivers accurate, context-aware answers grounded in the uploaded source code, without the code ever leaving your machine.