raglite  by superlinear-ai

Python toolkit for Retrieval-Augmented Generation (RAG) using DuckDB or PostgreSQL

created 1 year ago
1,040 stars

Top 36.8% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

RAGLite is a Python toolkit for building Retrieval-Augmented Generation (RAG) systems, offering flexibility in LLM providers, databases (PostgreSQL/SQLite), and rerankers. It targets developers and researchers seeking a lightweight, performant, and extensible RAG solution, enabling advanced features like adaptive retrieval and optimized chunking.

How It Works

RAGLite leverages a modular design, integrating with LiteLLM for LLM and embedder abstraction, and supporting both PostgreSQL (with pgvector) and SQLite (with sqlite-vec) for hybrid search. It employs advanced techniques such as optimal sentence splitting via integer programming, multi-vector chunk embedding with late chunking, and adaptive retrieval where the LLM determines the need for external data. This approach aims to improve RAG performance, reduce costs, and enhance output quality.

Quick Start & Requirements

  • Install with pip install raglite. Extras available: [chainlit], [pandoc], [ragas].
  • For local LLMs, install accelerated llama-cpp-python wheels (e.g., pip install "https://github.com/abetlen/llama-cpp-python/releases/download/v0.3.4-cu121/llama_cpp_python-0.3.4-cp310-cp310-linux_x86_64.whl").
  • Supports macOS Metal, Linux/Windows CUDA acceleration.
  • Official documentation and examples are available.

Highlighted Details

  • Integrates with LiteLLM for broad LLM/embedder support, including local llama.cpp models.
  • Features adaptive retrieval, where the LLM decides when and what to retrieve.
  • Implements optimal semantic chunking and multi-vector embeddings.
  • Supports hybrid search (keyword + vector) and reranking for improved relevance.
  • Offers an optional Model Context Protocol (MCP) server for integration with clients like Claude desktop.
  • Includes an optional ChatGPT-like frontend via Chainlit.

Maintenance & Community

The project follows Conventional Commits for automated semantic versioning and changelog generation. Development environment setup is detailed, supporting GitHub Codespaces, VS Code Dev Containers, and uv.

Licensing & Compatibility

The project appears to use permissive open-source dependencies. Specific licensing for RAGLite itself is not explicitly stated in the provided README snippet, but the focus on lightweight and permissive dependencies suggests compatibility with most commercial and closed-source applications.

Limitations & Caveats

The README notes that sqlite-vec is used until it matures, implying potential future changes or reliance on PyNNDescent in the interim. Some advanced features like evaluation require installing additional extras.

Health Check
Last commit

1 month ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
1
Star History
125 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.