# RAGLite

A Python toolkit for retrieval-augmented generation that stores and searches documents in DuckDB or PostgreSQL, with configurable LLMs, rerankers, and hybrid keyword-and-vector search.

RAGLite is a Python toolkit for building retrieval-augmented generation applications on top of DuckDB or PostgreSQL. Any LLM provider can be used through LiteLLM, including local llama-cpp-python models, and either database can serve as a combined keyword-and-vector search store; a reranker can be chosen from the rerankers library, defaulting to multilingual FlashRank.

It converts PDFs to Markdown, embeds multiple vectors per chunk using late chunking with contextual headings, splits sentences and semantic chunks by solving optimization problems, and combines native full-text and vector search into hybrid retrieval. An adaptive retrieval mode lets the LLM decide whether and what to retrieve, and a built-in MCP server lets any MCP client, such as Claude Desktop, query it directly.

Optional extras add a customizable chat frontend with Chainlit, Pandoc-based conversion of other file formats, Mistral OCR document processing, and evaluation of retrieval and generation with Ragas. It installs with pip and is released under the MPL-2.0 license.

Website: https://github.com/superlinear-ai/raglite
