Ask a codebase anything. Check every answer.
SpectraCode indexes a repository and answers questions about it. Each answer cites the exact file and lines it came from, and every citation is checked against the source before you see it.
SpectraCode is open source and runs locally. This page is a tour of it; the app itself starts with two commands.
How an answer gets checked
Parse
Each file is split along function, method and class boundaries, so a span is always a whole unit with exact line numbers.
Search
A meaning-based search and an identifier-aware keyword search each rank the spans. The two rankings are merged.
Follow
Functions and types that the top spans refer to are looked up one hop away and added as context.
Answer
The model writes its answer and cites spans by file and line range.
Check
Every citation is compared with the retrieved code. Lines out of range are adjusted, unknown files are rejected, and unsupported questions get no answer.
A tour of the app
Screenshots from a local run against the bundled sample repository. Select one to open it full size.
Ask, then read the cited lines
Citations in an answer are numbered stations. Selecting one opens the file at those lines, marked in yellow, with the enclosing function named above the code.
See which files import which
The dependency graph draws files as stations. Imports are blue, files that import the selected one are red, and circular imports are dashed.
Search by meaning or by name
Ctrl K searches the whole repository. Results show the function or class, its file and lines, and a preview of the code.
Measure it yourself
The benchmarks page runs a fixed set of questions and scores whether the right code was found and whether each citation points at the right lines.
Run it on your machine
You need Python and Node.js. No Docker and no API key are required to start.
Start the backend
git clone https://github.com/YahyaLendani/SpectraCode.git
cd SpectraCode/backend
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000
Start the frontend
cd SpectraCode/frontend
npm install
npm run dev
Then open http://localhost:3000. On first start the backend indexes a small FastAPI sample repository, so there is something to ask about straight away. It reads Python, TypeScript, TSX and JavaScript, and search embeddings are computed on your machine.