Docdex

io.github.bekirdag由 GitHub 账号 bekirdag 发布v0.2.101更新于 Nov 7, 2026

Fast per-repo documentation indexer and full-text search MCP server for codebases.

概览

AI 生成的概览

本地优先的索引与搜索守护进程,让 AI 助手对代码仓库的文档和源码进行排序检索,并提供持久记忆。

可以做什么
  • 对仓库文档和源码进行全文检索,返回按意图排序的结构化结果
  • 通过 AST 与影响图查找代码定义并追踪下游依赖,支持多种语言
  • 存储与召回仓库事实、代理偏好和导入的对话记录,并生成日记条目与唤醒摘要
  • 查询由归档对话派生的时序知识图谱,包括实体、边与事件
  • 由同一个本地守护进程同时服务 CLI、HTTP 与 MCP 客户端,可选地借助本地 LLM 过滤进行网络补充
适用场景
适合需要针对特定代码库获得可靠且私密的上下文、而不想依赖嘈杂的 grep 结果或把代码上传到托管向量库的场景,也适合希望跨会话记住项目事实和历史对话的情况。
运行要求
以本地进程运行:安装 npm 包(需 Node.js 18 或更高版本),会下载对应操作系统的二进制文件;Windows 上需先安装 Microsoft Visual C++ 2015-2022 可再发行组件(x64)。需先为仓库建立索引并启动守护进程,再把客户端指向本地 MCP 端点(默认 127.0.0.1:28491 的 HTTP/SSE,或本地 IPC)。可选使用 Ollama 等本地 LLM 服务做嵌入与过滤。
安装前请注意
守护进程会在本机写入索引、记忆、对话归档和知识数据库,导入对话记录会把其内容保存在本地。使用 --expose 暴露到回环地址之外时必须配合 --auth-token,且应谨慎操作。可选的网络补充会把查询发送到外部搜索和本地 LLM 服务。自动配置会改写多个已安装 AI 客户端的设置,请检查这些改动。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Docdex,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[Website] [GitHub Actions Workflow Status] [GitHub License] [GitHub Release] [Made with Rust]

Docdex

Turn your repository into fast, private context that humans and AI can trust.

Docdex is a local-first indexer and search daemon for documentation and source code. It sits between your raw files and your AI assistant, providing deterministic search, code intelligence, and persistent memory without ever uploading your code to a cloud vector store.

⚡ Why Docdex?

Most AI tools rely on "grep" (fast but dumb) or hosted RAG (slow and requires uploads). Docdex runs locally, understands code structure, and gives your AI agents a persistent memory.

ProblemTypical ApproachThe Docdex Solution
Finding Contextgrep/rg (Noisy, literal matches)Ranked, structured results based on intent.
Code PrivacyHosted RAG (Requires uploading code)Local-only indexing. Your code stays on your machine.
Siloed SearchIDE-only search barsShared Daemon serving CLI, HTTP, and MCP clients simultaneously.
Code AwarenessString matchingAST & Impact Graph to understand dependencies and definitions.

🚀 Features

  • 📚 Document Indexing: Rank and summarize repo documentation instantly.
  • 🧠 AST & Impact Graph: Search by function intent and track downstream dependencies (supports Rust, Python, JS/TS, Go, Java, C++, and more).
  • 💾 Repo Memory: Stores project facts, decisions, and notes locally.
  • 👤 Agent Memory: Remembers user preferences (e.g., "Use concise bullet points") across different repositories.
  • 🗂️ Conversation Memory: Imports transcripts, keeps wake-up bundles compact, and derives repo-scoped summaries, diary entries, and working memory.
  • 🕸️ Temporal Knowledge Graph: Extracts entities, edges, episodes, and code-facing links from archived conversations for timeline and neighborhood queries.
  • 🧭 Wake-Up + Project Map Context: Injects compact wake-up bundles, profile truth, and cached Project map: context into OpenAI-compatible chat completions.
  • 🔌 MCP Native: Auto-configures for tools like Claude Desktop, Cursor, and Windsurf.
  • 🌐 Web Enrichment: Optional web search with local LLM filtering through detected local LLM services.

📦 Set-and-Forget Install

Install once, point your agent at Docdex, and it keeps working in the background.

1. Install via npm (Recommended)

Requires Node.js >= 18. This will download the correct binary for your OS (macOS, Linux, Windows).

bash
npm i -g docdex

[!WARNING] Windows requirement: Docdex uses the MSVC runtime. Install the Microsoft Visual C++ Redistributable 2015-2022 (x64) before running docdex/docdexd.

2. Auto-Configuration

If you have any of the following clients installed, Docdex automatically configures them to use the local MCP endpoint (daemon HTTP/SSE):

Claude Desktop, Cursor, Windsurf, Cline, Roo Code, Continue, VS Code, PearAI, Void, Zed, Codex.

Note: Restart your AI client after installation.


🛠️ Usage Workflow

1. Index a Repository

Run this once to build the index and graph data.

bash
docdexd index --repo /path/to/my-project

2. Start the Daemon

Start the shared server. This handles HTTP requests and MCP connections.

bash
docdex start# or: docdexd daemon --host 127.0.0.1 --port 28491

3. Ask Questions (CLI)

You can chat directly from the terminal.

bash
docdexd chat --repo /path/to/my-project --query "how does auth work?"

🔌 Model Context Protocol (MCP)

Docdex is designed to be the "brain" for your AI agents. It exposes an MCP endpoint that agents connect to.

Architecture

mermaid
flowchart LR  Repo[Repo on disk] --> Indexer[Docdex Indexer]  Indexer --> Daemon[Docdex Daemon]  Daemon -->|HTTP + SSE| MCPClient[MCP Client]  MCPClient --> Host[AI Agent / Editor]

Use the daemon HTTP/SSE endpoint. For sandboxed clients, Docdex can also serve MCP over local IPC (Unix socket or Windows named pipe), while HTTP/SSE remains the default for most MCP clients.

Manual Configuration

If you need to configure your client manually:

JSON (Claude/Cursor/Continue):

json
{  "mcpServers": {    "docdex": {      "url": "http://127.0.0.1:28491/v1/mcp/sse"    }  }}

Claude Code (CLI) JSON (~/.claude.json or project .mcp.json):

json
{  "mcpServers": {    "docdex": {      "type": "http",      "url": "http://127.0.0.1:28491/v1/mcp"    }  }}

TOML (Codex):

toml
[mcp_servers.docdex]url = "http://127.0.0.1:28491/v1/mcp"tool_timeout_sec = 300startup_timeout_sec = 300

🤖 capabilities & Examples

1. AST & Impact Analysis

Don't just find the string "addressGenerator"; find the definition and what it impacts.

bash
# Find definitioncurl "http://127.0.0.1:28491/v1/ast?name=addressGenerator&pathPrefix=src"
# Track downstream impact (what breaks if I change this?)curl "http://127.0.0.1:28491/v1/graph/impact?file=src/app.ts&maxDepth=3"

2. Memory System

Docdex allows you to store "facts" that retrieval helps recall later.

Repo Memory (Project specific):

bash
# Teach the repo a factdocdexd memory-store --repo . --text "Payments retry up to 3 times with backoff."
# Recall it laterdocdexd memory-recall --repo . --query "payments retry policy"

Agent Memory (User preference):

bash
# Set a style preferencedocdexd profile add --agent-id "default" --category style --content "Use concise bullet points."

3. Conversation Memory

Conversation memory is repo-scoped by default and optional. Repo-less sessions must use an explicit conversation namespace so they never silently reuse a repo archive. The subsystem imports transcripts, stores episodic summaries and working memory, derives diary entries and temporal KG facts into knowledge.db, and keeps recall under a strict wake-up budget.

The CLI archive, diary, and hook commands are HTTP-backed wrappers, so start docdex start or docdexd daemon first.

bash
# Archive and inspect transcriptsdocdexd conversations import --repo . ./session.txt --format plain_text --agent-id codexdocdexd conversations list --repo . --agent-id codexdocdexd conversations search --repo . "timeline_index"docdexd conversations read --repo . <session_id>
# Import into an explicit global conversation namespace instead of a repo archivedocdexd conversations import --conversation-namespace shared-team ./session.txt --format plain_text --agent-id codexdocdexd conversations search --conversation-namespace shared-team "timeline_index"
# Keep agent diary notes alongside imported sessionsdocdexd diary write --repo . --agent-id codex "Wake-up rollout validated against knowledge.db timeline output."docdexd diary read --repo . --agent-id codex
# Trigger durable summarization from an external transcriptdocdexd hook conversation --repo . \  --action session_close_summarization \  --source codex \  --agent-id codex \  --transcript ./session.txt \  --format plain_text \  --wait-for-processing
# Build a compact wake-up bundle over recent contextcurl -X POST http://127.0.0.1:28491/v1/wakeup \  -H "Content-Type: application/json" \  -d '{"agent_id":"codex","query":"timeline_index","max_tokens":96}'
# Address the same archive over HTTP without repo_idcurl -X POST http://127.0.0.1:28491/v1/wakeup \  -H "Content-Type: application/json" \  -H "x-docdex-conversation-namespace: shared-team" \  -d '{"agent_id":"codex","query":"timeline_index","max_tokens":96}'
# Explore derived repo-scoped knowledge facts and provenancecurl "http://127.0.0.1:28491/v1/kg/query?q=knowledge.db&limit=10"curl "http://127.0.0.1:28491/v1/kg/search/nodes?q=knowledge&limit=10"curl "http://127.0.0.1:28491/v1/kg/neighborhood?entity=knowledge.db&limit=10"curl "http://127.0.0.1:28491/v1/kg/timeline?entity=knowledge.db&limit=10"
# Chat with wake-up + project-map context and inspect reasoning trace metadatacurl -X POST http://127.0.0.1:28491/v1/chat/completions \  -H "Content-Type: application/json" \  -d '{    "model": "fake-model",    "messages": [{"role": "user", "content": "What changed around knowledge.db?"}],    "docdex": {      "agent_id": "codex",      "limit": 6,      "include_libs": true,      "dag_session_id": "session-123"    }  }'

4. Local LLM Services

Docdex detects supported local LLM services before it suggests installing anything. It can reuse Ollama, vLLM, llama.cpp-compatible OpenAI endpoints, LM Studio, LocalAI, SGLang, TGI-compatible deployments, and healthy local mcoda agents when they are already present. Ollama remains the recommended fallback because it is the easiest guided setup path.

  • Setup: Run docdex setup for an interactive wizard that lists detected services, models, embedding candidates, and local delegation agents.
  • Inspect: Run docdexd llm detect --json or docdexd llm diagnostics --json to see why a service/model was selected, skipped, or marked unhealthy.
  • Manual Ollama fallback: If no usable service is installed, pull the fallback embedding model with ollama pull nomic-embed-text.
  • Custom Ollama URL:
bash
DOCDEX_OLLAMA_BASE_URL=http://127.0.0.1:11434 docdex start --host 127.0.0.1 --port 28491

⚙️ Configuration & HTTP API

Docdex runs as a local daemon serving:

  • CLI Commands: docdexd chat
  • HTTP API: /search, /v1/capabilities, /v1/search/rerank, /v1/search/batch, /v1/chat/completions, /v1/ast, /v1/graph/impact, /v1/conversations/*, /v1/diary/*, /v1/hooks/conversation, /v1/wakeup, /v1/kg/*
  • MCP Endpoints: /v1/mcp and /v1/mcp/sse
  • Capability Negotiation Tools: docdex_capabilities, docdex_rerank, docdex_batch_search, docdex_conversation_*, docdex_diary_*, docdex_conversation_hook, docdex_wakeup, docdex_kg_*

Multi-Repo Setup

Run a single daemon and mount additional repos on demand.

bash
docdex start --port 28491
# Mount repos and capture repo_id valuescurl -X POST "http://127.0.0.1:28491/v1/initialize" \  -H "Content-Type: application/json" \  -d '{"rootUri":"file:///path/to/repo-a"}'
curl -X POST "http://127.0.0.1:28491/v1/initialize" \  -H "Content-Type: application/json" \  -d '{"rootUri":"file:///path/to/repo-b"}'

Notes:

  • When more than one repo is mounted (or the daemon starts without a default repo), include x-docdex-repo-id: <sha256> on HTTP requests.
  • MCP sessions bind to the repo provided in initialize.rootUri and reuse that repo automatically.

Security

  • Secure Mode: By default, Docdex enforces TLS on non-loopback binds.
  • Loopback: 127.0.0.1 is accessible without TLS for local agents.
  • To expose to a network (use with caution), use --expose and --auth-token.

📚 Learn More

  • Detailed Usage: docs/usage.md
  • API Reference: docs/http_api.md
  • MCP Specs: docs/mcp/errors.md
[图片]

来源:README.md,提交 35a5328

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

2
  1. v0.2.101最新Nov 7, 2026
  2. v0.2.99Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分