Skip to main content

Open In Colab

pyLLMSearch - Advanced RAG

Documentation

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 Unstructured pre-processor:
      • List of formats see here.
  • 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-MiniLM cross-encoder, more modern bge-reranker-v2-m3 and zerank-2 is supported.
  • 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

Demo

Documentation

Browse Documentation

Metadata

Release files for pyllmsearch 0.9.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyllmsearch 0.9.5
File Size Uploaded
pyllmsearch-0.9.5.tar.gz 4.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyllmsearch 0.9.5
File Interpreter ABI Platform
pyllmsearch-0.9.5-py3-none-any.whl Python 3 none any Details

Total release size: 4.1 MB

Release files / pyllmsearch-0.9.5.tar.gz

Download URL pyllmsearch-0.9.5.tar.gz
Size 4.0 MB
Tags Source
SHA-256 checksum
How to use checksums
de5a5e68dfac7fff3feb6ef399b31cbe232b6506e9e0374b6487496b881c1d15
BLAKE2b-256 checksum
How to use checksums
ea33b83ba1810a3da76cef2da5f93cebcb7c8f7be5622351ca46c8baf8171c64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / pyllmsearch-0.9.5-py3-none-any.whl

Download URL pyllmsearch-0.9.5-py3-none-any.whl
Size 76.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
949bf9f76a496ed00815e48ea6308bc09785e02d1ae3664ccc09bd023fbe7da1
BLAKE2b-256 checksum
How to use checksums
33d5ee46ded8c3a7fc2c77614fa7d064277afc55c0ce91091e09079a6738fdd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release history Release notifications | RSS feed

This release

0.9.5 This release

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.4

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.7

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.6

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page