RAGLite is a Python toolkit for retrieval-augmented generation (RAG), with the database optionally being DuckDB or PostgreSQL. It connects to various LLMs through LiteLLM (including local llama-cpp-python models), uses rerankers to select a reranker, and by default uses the multilingual FlashRank. Its dependencies are lightweight and permissively open source, it does not depend on PyTorch or LangChain, and it supports macOS Metal and Linux/Windows CUDA acceleration.
Main capabilities: PDF to Markdown based on pdftext and pypdfium2; multi-vector chunk embeddings, with support for late chunking and context chunk headers; optimal sentence splitting and semantic chunking by solving a binary integer program; hybrid search using the database's native FTS+VSS (tsvector+pgvector); adaptive retrieval in which the LLM decides whether to retrieve and what to retrieve; a prompt-cache-aware message array structure; Anthropic long-context prompt format; an optimal closed-form query adapter by solving the orthogonal Procrustes problem; a built-in MCP server for clients such as Claude desktop to connect to; an optional Chainlit frontend (Web, Slack, Teams); optional Pandoc conversion of any document to Markdown; optional Mistral OCR to process PDFs, images, DOCX, and PPTX and automatically generate image descriptions; optional Ragas to evaluate retrieval and generation quality.
Usage: install with pip install raglite; add the chainlit extra for the frontend, the pandoc extra for other file types, Mistral OCR requires installing mistralai, and evaluation requires the ragas extra. When configuring, specify the database and LLM, you can configure a reranker, and set self_query=True to enable self-query. Insert documents with Document.from_text() or Document.from_path(), and metadata can be passed for retrieval filtering. When running RAG, you can use the adaptive pipeline, or manually control steps such as search, retrieval, reranking, expanding chunks, and generation. The query adapter generates an evaluation set via insert_evals, then uses update_query_adapter to compute and store it. The MCP server requires installing Claude desktop and uv, and configuring startup. The frontend can be started with the chainlit command.
Limitations: the material does not provide specific pricing, platform support scope, or performance data; some features depend on additional installation and external services (such as Mistral OCR, Ragas, and Chainlit).