
Deeprepo
io.github.abhishek2432001由 GitHub 账号 abhishek2432001 发布v1.0.0更新于 Oct 24, 2026
Productivity-boosting RAG engine for codebases with multi-provider AI support and semantic search.
概览
本地 RAG 引擎,为代码库建立索引,让 AI 助手查找符号、解释文件、评估改动影响并回答代码问题。
- 可以做什么
- 索引代码库目录,在本地 SQLite 文件中构建代码图谱、向量嵌入和生成的 wiki,并只对变更文件做增量重新处理。查找类或函数定义位置,列出文件的结构或 API。解释文件的作用,并评估修改该文件会影响哪些部分。回答关于代码库的开放式问题并给出项目概览,同时返回作为依据的源文件路径。
- 适用场景
- 适合助手在本地代码库上工作、希望获得比直接读取原始文件更省 token 且更有针对性的上下文时使用,尤其适用于符号查找、文件解释以及编辑前的改动影响检查。适用于桌面端的 Cursor、Claude Desktop 或其他 MCP 客户端。
- 运行要求
- 以本地 Python 进程运行,需安装带 mcp 附加项的 deeprepo 包,仅支持桌面端。需要 AI 提供方:本地运行的 Ollama(推荐,免费),或通过 LLM_PROVIDER 和 EMBEDDING_PROVIDER 配置的云服务,并需要 OPENAI_API_KEY、ANTHROPIC_API_KEY、GEMINI_API_KEY 或 HUGGINGFACE_API_KEY/HF_TOKEN 等密钥。代码库需先完成索引。
安装
在 SourceWeft 中
- 打开 控制台中的 Deeprepo,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
DeepRepo — Local RAG Engine for Codebases
A production-grade Python library for performing RAG (Retrieval Augmented Generation) on local codebases. No heavy frameworks, no external vector DBs, no cloud required.
What It Does
DeepRepo ingests a codebase and builds three things simultaneously:
A smart query router classifies every question and picks the cheapest context strategy, reducing LLM token usage by 5–50x compared to naive RAG.
Features
- Zero dependencies on heavy frameworks — pure Python, SQLite-backed
- Multiple AI providers — Ollama (free/local), OpenAI, Anthropic, Gemini, HuggingFace
- CLI-first —
deeprepo ingest ./deeprepo serve/deeprepo query "…" - Wiki viewer — browsable, searchable HTML wiki with in-page chat (
deeprepo serve) - 7 focused MCP tools — drop DeepRepo into Cursor / Claude Desktop as an MCP server
- Branch isolation — per-branch SQLite databases with copy-on-write from base branches
- 3-tier retrieval — Embeddings → FTS → Graph fallback for resilient search
- Incremental ingestion — unchanged files are skipped; only deltas re-processed
Quick Start
1. Install
For MCP server support:
2. Install Ollama (free, local — recommended)
3. Ingest your codebase
4. Browse the wiki
5. Ask questions
CLI Reference
Common flags (all commands)
ingest flags
serve flags
Examples
Python API
query() return shape
Supported AI Providers
Note: Anthropic has no embeddings API. Pair it with another provider:
Architecture
Storage
Everything lives in a single SQLite file per branch — no Redis, no Postgres, no Chroma.
Design Patterns
- Facade —
DeepRepoClientis the single entry point; internals are hidden - Strategy —
LLMProvider/EmbeddingProviderabstract interfaces; providers are swappable - Registry —
@register_llm("ollama")decorator auto-registers providers at import time - Bottom-up synthesis — wiki pages generated leaves-first; parent pages consume child summaries
- 3-tier fallback — Embeddings → FTS → Graph; queries work even when embeddings are cold
- Copy-on-write branching — feature branches start from base-branch cache, then delta-update
MCP Server (AI Assistant Integration)
Connect DeepRepo as an MCP server so Cursor, Claude Desktop, or any MCP-compatible AI assistant can call it directly — without ever reading raw files.
Setup
Cursor — create ~/.cursor/mcp.json:
Claude Desktop — add to ~/Library/Application Support/Claude/claude_desktop_config.json:
Available MCP Tools (7 tools)
Token Reduction vs Naive RAG
CLAUDE.md tip
Add this to your project's CLAUDE.md so Claude automatically uses DeepRepo:
Configuration
Environment Variables
Testing
The test_deeprepo_flow.py script tests all 7 sections end-to-end:
- Client initialisation & branch flags
- Ingest (graph + embeddings + wiki)
- WikiEngine — page generation, caching, repo overview
- Graph API — skeleton, blast-radius, symbol lookup
- RAG / Router — intent classification, query execution
- CLI commands — all subcommands + help
- Branch isolation flag combinations
Adding a New Provider
- Create
src/deeprepo/providers/myprovider.py - Implement
EmbeddingProviderand/orLLMProviderinterfaces - Decorate with
@register_embedding("myprovider")/@register_llm("myprovider") - Auto-discovered at import time — no other changes needed
Documentation
- DEVELOPER_WORKFLOW_GUIDE.md — daily dev workflows and automation recipes
- deeprepo_core/README.md — package README (PyPI)
- docs/high-level-design.excalidraw — process flow diagram
- docs/class-interaction-design.excalidraw — class diagram
License
MIT License — see LICENSE file for details.
Built for developers who want full control over their RAG pipelines.
来源:README.md,提交 1dcac5d
工具
0版本历史
1- v1.0.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分