superlinear-ai/raglite

🥤 RAGLite is a Python toolkit for Retrieval-Augmented Generation (RAG) with DuckDB or PostgreSQL

What it solves

RAGLite is a Python toolkit designed to simplify the implementation of Retrieval-Augmented Generation (RAG) pipelines. It removes the complexity of managing heavy dependencies (like PyTorch or LangChain) while providing high-performance tools for document processing, retrieval, and generation using lightweight databases like DuckDB or PostgreSQL.

How it works

  • Data Ingestion: It converts documents (including PDFs) to Markdown and uses advanced chunking techniques, such as semantic chunking and late chunking, to prepare data for embedding.
  • Storage & Search: It utilizes DuckDB or PostgreSQL for both keyword (FTS/tsvector) and vector (VSS/pgvector) search, enabling hybrid search capabilities.
  • Retrieval Pipeline: It supports adaptive retrieval (where the LLM decides if retrieval is needed), reranking via the rerankers library, and the use of a closed-form linear query adapter to optimize search results.
  • Integration: It leverages LiteLLM for provider-agnostic LLM and embedding model access, and includes a built-in Model Context Protocol (MCP) server to connect with clients like Claude Desktop.

Who it’s for

Developers who want a fast, permissive, and extensible RAG framework that avoids "bloated" dependencies and supports both local (via llama.cpp) and remote LLM providers.

Highlights

  • Lightweight: No PyTorch or LangChain dependencies.
  • Flexible Storage: Native support for DuckDB and PostgreSQL.
  • Advanced Chunking: Implements semantic chunking and late chunking for better context preservation.
  • Adaptive RAG: LLM-driven decision making on whether to retrieve information.
  • MCP Support: Built-in Model Context Protocol server for easy integration with AI assistants.
  • Evaluation: Optional integration with Ragas for measuring retrieval and generation performance.