Repolode
superlinear-ai

superlinear-ai/raglite

A Python toolkit for Retrieval-Augmented Generation that stores and searches documents in DuckDB or PostgreSQL.

Stars
1,211
Forks
117
Open issues
17
Last commit
6 days ago

What is it?

RAGLite is a Python toolkit for building Retrieval-Augmented Generation pipelines. It converts PDFs and other documents to Markdown, splits them into chunks, embeds them, and stores everything in either DuckDB or PostgreSQL, so you can retrieve relevant passages and pass them to an LLM when answering questions.

Retrieval combines the database's native keyword and vector search (FTS with VSS on DuckDB, tsvector with pgvector on PostgreSQL) and can rerank results with a configurable reranker. LLMs and embedders are accessed through LiteLLM, including local llama.cpp models via llama-cpp-python, and the project avoids heavy dependencies such as PyTorch or LangChain.

Beyond basic retrieval, RAGLite offers an optional query adapter computed from evaluation data, metadata filtering, a built-in MCP server for clients such as Claude desktop, and a Chainlit-based chat frontend. Ragas-based evaluation of retrieval and generation is available as an extra.

Key features

  • 01Store and search documents in DuckDB or PostgreSQL with hybrid keyword and vector search.
  • 02Use any LLM or embedder supported by LiteLLM, including local llama.cpp models.
  • 03Rerank retrieved chunks with rerankers, with FlashRank as the default.
  • 04Convert PDFs to Markdown and optionally handle other formats via Pandoc or Mistral OCR.
  • 05Filter retrieval results with document metadata.
  • 06Expose search as an MCP tool and serve an optional Chainlit chat frontend.

Use cases

  • Building a question-answering assistant over a private set of PDFs or Markdown documents.
  • Running a fully local RAG setup with DuckDB and a llama.cpp model.
  • Adding a knowledge-base search tool to Claude desktop through MCP.
  • Experimenting with retrieval strategies and measuring them with Ragas evaluations.

Quick start

  1. 1

    Install RAGLite from PyPI

    pip install raglite
  2. 2

    Configure RAGLite with a DuckDB or PostgreSQL database and an LLM in Python

Things to know

  • Licensed under MPL-2.0, a file-level copyleft license that requires sharing modifications to its source files.
  • Local llama.cpp models need a separately installed llama-cpp-python build that matches your Python version and platform.
  • Some features, such as the Cohere reranker and Mistral OCR, need external API keys.

In collections

Topics

FAQ

What is raglite?
A Python toolkit for Retrieval-Augmented Generation that stores and searches documents in DuckDB or PostgreSQL. RAGLite is a Python toolkit for building Retrieval-Augmented Generation pipelines. It converts PDFs and other documents to Markdown, splits them into chunks, embeds them, and stores everything in either DuckDB or PostgreSQL, so you can retrieve relevant passages and pass them to an LLM when answering questions.
Is raglite free to use? What license does it have?
raglite is open source under the MPL-2.0 license. Check the license terms before using it in commercial products.
Is raglite still maintained?
Actively maintained. The last commit to raglite was on Nov 1, 2026.
What can I use raglite for?
Building a question-answering assistant over a private set of PDFs or Markdown documents. Running a fully local RAG setup with DuckDB and a llama.cpp model. Adding a knowledge-base search tool to Claude desktop through MCP. Experimenting with retrieval strategies and measuring them with Ragas evaluations.
How do I install raglite?
Install RAGLite from PyPI: pip install raglite Configure RAGLite with a DuckDB or PostgreSQL database and an LLM in Python
Where can I get raglite?
The source code and installation instructions are on GitHub: https://github.com/superlinear-ai/raglite

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects