feat: CodeRAG v1.0 — standalone, local-first semantic code-search engine#4
Merged
Conversation
…bol-aware chunking, hybrid retrieval Replace the file-averaged, OpenAI-only, append-only POC engine with a chunk-level, incremental, hybrid-search engine: - EmbeddingProvider abstraction (fastembed local default, OpenAI opt-in, fake for tests); embedding dim comes from the provider, not a hardcoded constant. - SQLite is the source of truth (files/chunks/vectors/FTS5); FAISS is a rebuildable cache. - Pluggable vector index: exact Flat, auto-switching to IVF past a scale threshold. - Symbol-aware chunking: Python via ast, JS/TS/Go/Rust/Java via tree-sitter, line-window fallback. - Incremental indexing with content hashing and delete-before-add (fixes the duplicate/stale vector bug from the old watchdog monitor). - Hybrid dense + BM25 retrieval fused with Reciprocal Rank Fusion. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
All four surfaces are thin adapters over the CodeRAG facade: - coderag CLI: index / search / watch / serve / ui / status (entry point 'coderag'). - FastAPI server (coderag serve): GET /search /status /file, POST /index ([server] extra). - Streamlit UI (coderag ui): streamed answers, file:line citations, scores, reindex ([ui] extra). Removes the old main.py / app.py / prompt_flow.py / cli.py / scripts entry points. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Covers config/providers, SQLite store + Flat/IVF vector index, chunking across languages, incremental indexing + no-duplicate invariant, RRF + hybrid search, and the CLI/HTTP/watcher surfaces. Default run is fully offline via a deterministic fake embedder; the real fastembed model is exercised only under -m integration. Removes the old smoke tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…OPMENT, modernize CI - README: drop the 'made obsolete by Cursor' framing; present CodeRAG as a standalone, local-first semantic code-search engine for large/custom codebases, with CLI / library / HTTP / UI quickstarts and an architecture diagram. - AGENTS.md / DEVELOPMENT.md: document the new module layout and design invariants. - pyproject: v1.0.0, new deps (fastembed, tree-sitter grammars, tqdm), extras (server/ui/openai), single 'coderag' entry point, pytest integration marker. - CI: 3.11/3.12 matrix running black/isort/flake8/mypy + offline pytest (-m 'not integration'). - example.env rewritten around CODERAG_* config; .flake8 added; tooling and .gitignore updated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
CI runs 'pytest' directly (not 'python -m pytest'), so the repo root wasn't on sys.path and 'from tests.conftest import ...' failed with ModuleNotFoundError. Add pythonpath=['.'] to the pytest config so it resolves regardless of invocation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Reworks CodeRAG from a file-averaged, OpenAI-only POC into a standalone, local-first semantic code-search engine for large, custom, or private codebases. It runs with no API key (local ONNX embeddings by default) and is usable via CLI, a Python library, an HTTP/REST server, and a Streamlit UI.
Bugs fixed from the old design
IndexFlatIPcan't delete). Now delete-before-add with a deletable index — a test proves the store and FAISS stay in lock-step.file:linecitations.metadata.npy→ SQLite source of truth, FAISS as a rebuildable cache.New capabilities
ast) + JS/TS/Go/Rust/Java (tree-sitter), line-window fallback for the rest.CodeRAGfacade) behind four thin surfaces.Surfaces
```bash
coderag index | search "..." | watch | serve | ui | status # CLI
from coderag import CodeRAG # library
coderag serve -> GET /search /status /file, POST /index # HTTP/REST ([server])
coderag ui # Streamlit ([ui])
```
Verification
black/isort/flake8/mypyclean.-m "not integration").Notes for reviewers
coderag index.tree-sitter-language-pack(shipped an incompatible bundled binding) to the official per-language grammar wheels on the modern 0.25 API.main.py,app.py,prompt_flow.py,coderag/{index,search,monitor,embeddings,cli}.py,scripts/.Commits are split: core engine → surfaces → tests → docs/CI.
🤖 Generated with Claude Code