Skip to main content

LLM Powered Advanced RAG Application

Project description

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, incremental parsing and embedding of medium size document bases (tested on up to few gigabytes of markdown and pdfs)

  • 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.
  • 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.

  • Generates 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, e.g., multilingual-e5-base.
      • Instructor-based models, e.g., instructor-large.
      • OpenAI embeddings.
  • Generates sparse embeddings using SPLADE (https://github.com/naver/splade) to enable hybrid search (sparse + dense).

  • An ability to update the embeddings incrementally, without a need to re-index the entire document base.

  • 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 the "Retrieve and Re-rank" strategy for semantic search, see here.

    • Besides the originally ms-marco-MiniLM cross-encoder, more modern bge-reranker is supported.
  • 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.
    • Deep linking into document sections - jump to an individual PDF page or a header in a markdown file.
    • Ability to save responses to an offline database for future analysis.
    • FastAPI based API + MCP server, allo

Demo

Demo

Documentation

Browse Documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyllmsearch-0.9.0.tar.gz (3.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyllmsearch-0.9.0-py3-none-any.whl (75.1 kB view details)

Uploaded Python 3

File details

Details for the file pyllmsearch-0.9.0.tar.gz.

File metadata

  • Download URL: pyllmsearch-0.9.0.tar.gz
  • Upload date:
  • Size: 3.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for pyllmsearch-0.9.0.tar.gz
Algorithm Hash digest
SHA256 3f3968cac2c56a9c61b4fbc06230f6fd9880bf5d4a66b114c7b9f04765afd90e
MD5 4af58455ca9bb5dcf662d0089d9ac626
BLAKE2b-256 321a08a1c94df72bef0bbdb37b0c1539d00ca8f9feeabac4310db355b6e86468

See more details on using hashes here.

File details

Details for the file pyllmsearch-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: pyllmsearch-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 75.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for pyllmsearch-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8e3c80a93bf29ca5c6c5bc3f33710455e0a10b66eea4ff4b3d2bbfda0c9a93e8
MD5 6b3e27dd272fb4bc38328d2ccfbb3bae
BLAKE2b-256 5177f72a7f846b8ab285ab8fdad95ecca2ea7fe90a8366db84f51482243e17a6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page