pydocs-mcp 0.4.0
Published to PyPI: https://pypi.org/project/pydocs-mcp/0.4.0/
pip install pydocs-mcpAdded
- Multi-repo search — one MCP server (or CLI query) over several already-indexed repos:
serve --workspace <dir>/--db <file>load pre-built{name}_{hash}.dbbundles read-only; a newprojectfilter onsearch/lookupscopes one repo, omitted it unions across all with dedup (a repo's own code beats the same symbol seen as a dependency; most-recently-indexed wins among duplicates). A per-database identity stamp rejects bundles built with a mismatching embedder up front. - Reference-graph readers on
lookup—show="impact"(everything that transitively calls a symbol, ranked — "what breaks if I change X?") andshow="context"(the symbol's dependency closure packed under a token budget — "everything to understand X"). - Graph-boosted retrieval — dense-seeded
graph_expandstep, index-timenode_scores(PageRank / community, optional[graph]extra) with centrality/diversity rerankers, synthetic embedding-kNNsimilaredges, graph presets + a structural-recall benchmark split. - Selective dependency embedding — everything stays BM25/FTS-indexed, but dense vectors are written per package tier: the project embeds fully; dependencies embed one docstring page per module plus markdown/READMEs by default. Promote chosen dependencies with
--full-dep NAME/embedding.full_index_dependencies(globs);embedding.dependency_policy: full | doc_pages | none. Indexing torch-sized dependencies drops from ~an hour to seconds on CPU. - ONNX / OpenVINO backends for
sentence_transformers—embedding.backend: torch | onnx | openvino+embedding.model_file_name(e.g. a qint8-quantized export) for ~2–4× faster CPU inference; new[openvino]extra. Index on GPU, serve on CPU with the same model. - New embedders —
gte-modernbert-baseand the code-specializedF2LLM-v2family viasentence_transformers(RepoQA leaderboard + figures in the benchmark docs). - Dependency manifests —
[project.optional-dependencies]and PEP 735[dependency-groups]are now parsed; the--watchwatcher re-indexes whenpyproject.toml/requirements*.txtchange. - Example agent —
examples/ask_your_docs_agent/: a minimal LangGraph ReAct chat agent (terminal or notebook) over the MCP tools, with conversation memory, follow-up reformulation, and project inference. - Documentation site — Sphinx + Furo under
documentation/.
Changed
- Default chunk search is now dense + graph expansion (
chunk_search_graph.yaml), replacing BM25-only — RepoQA recall@10 0.40 → 0.77 on standard queries, 0.30 → 1.00 on structurally-reachable answers, at no extra indexing cost. BM25 and hybrid remain as presets. - Dependencies embed documentation pages only by default;
scope="deps"searches route to a BM25 ∥ dense fusion preset so dependency code stays reachable by keyword. graph_expanddecay default raised to 0.9.- Schema v10 → v12 — additive, migrated automatically on open. Note: the ingestion pipeline identity changed, so the first re-index after upgrading re-extracts and re-embeds packages; serving existing indexes keeps working without it.
Fixed
- Reference resolver no longer rescans the whole symbol universe per reference (O(N²) → bucketed) — indexing large dependencies such as numpy/torch previously appeared to hang.
- The startup SQLite ↔ vector-store integrity check compares intended embeddings instead of raw chunk counts, ending the re-extract-everything loop for deployments that don't embed every chunk.
- Dense search over a partially-embedded corpus no longer raises when the candidate set contains vectorless chunks.
- BM25 candidates carry
qualified_name, unblocking LLM tree reranking. - GPU benchmark runs no longer silently fall back to CPU (onnxruntime CUDA library path).