by Neverdecel
CodeRAG is an AI-powered tool for real-time codebase querying and augmentation using OpenAI and vector search.
# Add to your Claude Code skills
git clone https://github.com/Neverdecel/CodeRAGLast scanned: 5/30/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-05-30T15:37:27.639Z",
"npmAuditRan": true,
"pipAuditRan": false
}CodeRAG is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by Neverdecel. CodeRAG is an AI-powered tool for real-time codebase querying and augmentation using OpenAI and vector search. It has 211 GitHub stars.
Yes. CodeRAG passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/Neverdecel/CodeRAG" and add it to your Claude Code skills directory (see the Installation section above).
CodeRAG is primarily written in Python. It is open-source under Neverdecel on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh CodeRAG against similar tools.
No comments yet. Be the first to share your thoughts!
A standalone, local-first semantic code-search engine for large and custom codebases.
CodeRAG indexes a whole codebase into a hybrid (vector + keyword) search index and answers questions like "where is retry/backoff handled?" with the exact functions, classes, and files that matter — ranked by meaning, not just string match.
It runs entirely on your machine with no API key (a local ONNX embedding model is the default), keeps its index up to date as you edit, and is built to stay fast on large codebases. Use it from the CLI, embed it as a Python library, self-host it as an HTTP service, or browse with the web UI.
Built for the cases off-the-shelf IDE assistants don't cover well: a codebase that's too big, too private, or too custom — or a search/RAG capability you want to own and embed in your own tools.
ast; JS/TS/Go/Rust/Java via tree-sitter), not crude fixed-size blocks — so results point at real code units with file:line citations.Flat search for small repos, automatic switch to approximate IVF past a threshold so it stays fast at 100k+ chunks.CodeRAG object.pip install -e . # core engine (local embeddings included)
# optional extras:
pip install -e ".[server]" # HTTP/REST API
pip install -e ".[ui]" # Streamlit web UI
pip install -e ".[openai]" # OpenAI embeddings / LLM answers
Index a codebase and search it — no configuration, no API key:
coderag index --watched-dir /path/to/your/repo
coderag search "where are duplicate vectors removed on file change" --watched-dir /path/to/your/repo
1. coderag/indexer.py:141 (Indexer._index_file) [method, sim=0.70]
def _index_file(self, item): removed = 0; existing = self.store.get_file(item.rel) …
2. coderag/indexer.py:1 [window, sim=0.74]
"""Incremental indexing orchestration. ...the critical correctness property…"""
By default the index lives in ./.coderag/. Set CODERAG_WATCHED_DIR / CODERAG_STORE_DIR
(or copy example.env to .env) to avoid repeating flags.
coderag index [PATH] [--full] # build / incrementally update the index
coderag search "QUERY" [-k 8] # hybrid search; add --json or --answer
coderag watch # index, then keep it live as files change
coderag serve --port 8000 # run the HTTP API (needs [server])
coderag ui # launch the web UI (needs [ui])
coderag status # index stats (files, chunks, model, index type)
from coderag import CodeRAG, Config
cr = CodeRAG(Config.from_env(watched_dir="/path/to/repo"))
cr.index()
for hit in cr.search("how is the FAISS index persisted?"):
print(f"{hit.location} {hit.symbol} (sim={hit.similarity:.2f})")
print(hit.text)
coderag serve)curl "http://127.0.0.1:8000/search?q=token%20validation&k=5"
curl -X POST http://127.0.0.1:8000/index -d '{"full": false}' -H 'content-type: application/json'
curl "http://127.0.0.1:8000/status"
curl "http://127.0.0.1:8000/file?path=coderag/api.py&start_line=1&end_line=40"
Self-host it once and point any number of custom apps or teammates at a big shared codebase.
coderag ui)Streamlit app: search box, retrieved chunks with path:line citations and similarity
scores, a one-click Reindex button, and an optional streamed LLM answer (when an OpenAI
key is configured).
Prebuilt multi-arch images (linux/amd64 + linux/arm64) are published to GHCR on
every push to master. Beta — interfaces and tags may change.
# HTTP/REST API on :8000 — mount a repo to index, persist the index in a named volume
docker run --rm -p 8000:8000 \
-v "$PWD:/workspace:ro" -v coderag-index:/data \
ghcr.io/neverdecel/coderag:beta
# build the index once, then query the running server
curl -X POST localhost:8000/index -H 'content-type: application/json' -d '{"full": true}'
curl "localhost:8000/search?q=where%20is%20retry%20handled&k=5"
# Streamlit UI on :8501
docker run --rm -p 8501:8501 \
-v "$PWD:/workspace:ro" -v coderag-index:/data \
ghcr.io/neverdecel/coderag:beta-ui
Tags: :beta (latest master), :edge (alias), :sha-<commit> (immutable); the UI image
adds a -ui suffix. The container indexes /workspace and stores its index in /data
(CODERAG_WATCHED_DIR / CODERAG_STORE_DIR). For OpenAI embeddings/answers, add
-e OPENAI_API_KEY=….
graph LR
A[Source files] --> B[Symbol-aware chunking<br/>ast / tree-sitter]
B --> C[Embeddings<br/>fastembed · OpenAI]
C --> D[(SQLite store<br/>chunks + vectors + FTS5)]
D --> E[FAISS index<br/>Flat → IVF]
Q[Query] --> F[Dense + BM25]
E --> F
D --> F
F --> G[Reciprocal Rank Fusion]
G --> H[Ranked hits<br/>path:line + score]
Everything is configurable via CODERAG_* environment variables or a .env file (see
example.env). Common ones:
| Variable | Default | Meaning |
|---|---|---|
CODERAG_PROVIDER |
fastembed |
fastembed (local) · openai · fake |
CODERAG_MODEL |
BAAI/bge-small-en-v1.5 |
Local embedding model |
CODERAG_WATCHED_DIR |
cwd | Codebase to index |
CODERAG_STORE_DIR |
./.coderag |
Where the DB + index live |
CODERAG_INDEX_TYPE |
auto |
auto · flat · ivf |
CODERAG_IVF_THRESHOLD |
50000 |
Vectors before switching Flat → IVF |
CODERAG_TOP_K |
8 |
Results returned |
OPENAI_API_KEY |
– | Needed only for OpenAI embeddings / answers |
Symbol-aware (function/class/method level): Python, JavaScript, TypeScript/TSX, Go, Rust, Java. Many other languages and docs (C/C++, Ruby, PHP, Markdown, YAML, …) are indexed with a line-window fallback, so they remain searchable.
python -m venv venv && source venv/bin/activate
pip install -e ".[dev,server,openai]"
pytest -m "not integration" # fast, offline (uses a deterministic fake embedder)
pytest -m integration # exercises the real local model (downloads once)
ruff check . && ruff format --check . && mypy coderag # ruff = lint + import-sort + format
See DEVELOPMENT.md and AGENTS.md for architecture and contribution details.
Apache License 2.0 — see LICENSE.
FAISS · fastembed · tree-sitter · FastAPI · Streamlit · watchdog
⭐ If CodeRAG helps you, please give it a star!