启用 HyDE 会显著改变结果质量,README 建议先读论文再开启;Unstructured 预处理器支持的其他格式需额外安装该依赖;表格解析依赖 gmft 或 Azure Document Intelligence,图片解析需 Gemini API,均为可选组件。
pip install pyllmsearchREADME 未说明显存或 GPU 型号要求;支持 OpenAI 兼容 API 与 HuggingFace 本地模型,本地推理的硬件门槛需自行评估。
基于 YAML 配置的本地文档 RAG 问答系统,在基础 RAG 之上强化解析、混合检索与重排
用大模型对本地文档做检索问答,集成 HyDE、SPLADE、重排序和 Chroma 向量库,适合快速搭建 RAG 应用。
核心能力
- 用 YAML 配置驱动整套 RAG 流程,支持增量索引新文档
- 内置 md/pdf/docx 解析器,按标题与代码块切分并支持深链接跳转
- 稠密向量存 ChromaDB,配合 SPLADE 稀疏向量做混合检索
- 支持 Retrieve and Re-rank,可选 bge-reranker-v2-m3 等交叉编码器
- 提供 FastAPI 接口与 SSE MCP 服务,可接入 Cursor、Windsurf 等客户端
容易踩的坑
- v0.9.5最新正式版2026-01-17 · 2026-01-17 08:48 UTC
- Dependencies update - compatibility with latest Langchain, Chroma, CUDA and supporting packages.
- Test compatibility with Python 3.13.
- Add support for Zerank-2 re-ranker (demands significant GPU memory).
- Expose
update-rag-indexvia MCP and additional tool testing. - Documentation update.
- v0.9.22025-06-01 · 2025-06-01 09:40 UTC
查看更新说明
- Add a temporary fix for Protobuf library incompatibility with latest version of Chromadb.
- Add 'rag_generate_answer_simple' mcp endpoint, to allow retrieving an answer from RAG system without including the relevant documents.
- v0.9.12025-05-31 · 2025-05-31 13:17 UTC
查看更新说明
- Add a better error message when document path doesn't exist or isn't a directory - https://github.com/snexus/llm-search/issues/130
- Introduce optional
score_cutoffbased on reranker score to allow better control over included results from the reranker. - Update dependencies
- v0.9.02025-04-27 · 2025-04-27 10:18 UTC
查看更新说明
- Update dependencies and convert the project to uv based package management. As a result, requirements.txt was deleted.
- BREAKING CHANGE - remove support for llama-cpp, as the compatible version became obsolete and llamacpp can be used as a standalone package, utilizing OpenAI compatible connection.
- Introduce MCP server for semantic search and RAG answer operations, allowing compatibility with any MCP client - https://llm-search.readthedocs.io/en/latest/usage.html#api-and-mcp-server
- v0.8.4Fix API issue2025-01-12 · 2025-01-12 03:43 UTC
查看更新说明
Addresses - https://github.com/snexus/llm-search/pull/127 (thanks @guspuffygit)
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
pyLLMSearch - Advanced RAG
The purpose of this package is to offer an advanced question-answering (RAG) system with a simple YAML-based configuration that enables interaction with a collection of local documents. Special attention is given to improvements in various components of the system in addition to basic LLM-based RAGs - better document parsing, hybrid search, HyDE, chat history, deep linking, re-ranking, the ability to customize embeddings, and more. The package is designed to work with custom Large Language Models (LLMs) – whether from OpenAI or installed locally.
Interaction with the package is supported through the built-in frontend, or by exposing an MCP server, allowing clients like Cursor, Windsurf or VSCode GH Copilot to interact with the RAG system.
Features
-
Fast parsing and embedding of medium size document bases (tested on up to few gigabytes of markdown and pdfs)
-
Incremental updates for new documents, without a need to re-index the entire document base.
-
Supported document formats
- Build-in parsers:
.md- Divides files based on logical components such as headings, subheadings, and code blocks. Supports additional features like cleaning image links, adding custom metadata, and more..pdf- MuPDF-based parser..docx- custom parser, supports nested tables.
- Other common formats are supported by
Unstructuredpre-processor:- List of formats see here.
- Build-in parsers:
-
FastAPI based API + MCP server, allowing communicating with RAG via any mcp client, including VSCode/Windsurf/Cursor and others.
-
Deep linking into document sections - jump to an individual PDF page or a header in a markdown file.
-
Allows interaction with embedded documents, internally supporting the following models and methods (including locally hosted):
- OpenAI compatible models and APIs.
- HuggingFace models.
-
Interoperability with LiteLLM + Ollama via OpenAI API, supporting hundreds of different models (see Model configuration for LiteLLM)
-
SSE MCP Server enabling interface with popular MCP clients.
-
Hybrid search and Reranking
-
Dense embeddings from a folder of documents and stores them in a vector database (ChromaDB).
-
The following embedding models are supported:
- Hugging Face embeddings.
- Sentence-transformers-based models.
- Instructor-based models.
- OpenAI embeddings.
-
Sparse embeddings using SPLADE (https://github.com/naver/splade) to enable hybrid search (sparse + dense).
-
Supports the "Retrieve and Re-rank" strategy for semantic search, see here.
- Besides the originally
ms-marco-MiniLMcross-encoder, more modernbge-reranker-v2-m3andzerank-2is supported.
- Besides the originally
-
-
Support for table parsing via open-source gmft (https://github.com/conjuncts/gmft) or Azure Document Intelligence.
-
Optional support for image parsing using Gemini API.
-
Supports HyDE (Hypothetical Document Embeddings) - see here.
- WARNING: Enabling HyDE (via config OR webapp) can significantly alter the quality of the results. Please make sure to read the paper before enabling.
- From my own experiments, enabling HyDE significantly boosts quality of the output on a topics where user can't formulate the quesiton using domain specific language of the topic - e.g. when learning new topics.
-
Support for multi-querying, inspired by
RAG Fusion- https://towardsdatascience.com/forget-rag-the-future-is-rag-fusion-1147298d8ad1- When multi-querying is turned on (either config or webapp), the original query will be replaced by 3 variants of the same query, allowing to bridge the gap in the terminology and "offer different angles or perspectives" according to the article.
-
Supprts optional chat history with question contextualization
-
Other features
- Simple web interfaces.
- Ability to save responses to an offline database for future analysis.
Demo
