Embeddable, CPU-friendly retrieval (RAG) as a SQLite extension.
Website · User guide · Releases
RAGite is an embeddable retrieval component for retrieval-augmented generation (RAG). It splits text into chunks, computes embeddings on the CPU and finds the best-matching passages with a hybrid search (vector similarity plus full-text BM25), always with a link back to the source document and position. It ships as a loadable SQLite extension, so any application in any language that can load SQLite extensions can use it: SQLite for RAG.
Download libragite.so from the latest release (Linux x86-64), or build it with cargo build -p ragite-sqlite --release (see CONTRIBUTING.md). Start sqlite3 in the directory that holds the file:
SELECT load_extension('./libragite');
SELECT name, technical_id FROM ragite_default_model();
CREATE VIRTUAL TABLE docs USING ragite;
INSERT INTO docs(text, source, format)
VALUES ('# Installation
Run the installer and restart the application.', 'manual.md', 'text/markdown');
SELECT text, source FROM docs WHERE source = 'manual.md';
SELECT chunk, source, score FROM docs_chunks WHERE docs_chunks MATCH 'How do I install it?' LIMIT 5;This block is run as a test (crates/ragite-sqlite/tests/readme.rs), so it stays correct.
User guide: storing documents (formats, chunking, updates, transactions), searching with the hybrid MATCH, linking results to your own tables, the embedding functions, and models. Its examples are run in CI as well.
- Loading. SQLite looks for the exact name you pass and then for that name plus the platform suffix, so pass a path without the suffix:
load_extension('./libragite')in SQL,.load ./libragitein thesqlite3shell.load_extension('ragite')does not work: the file is calledlibragite.so, and a bare name is looked up on the library search path, not in the current directory. The file name per platform islibragite.so(Linux),libragite.dylib(macOS), andragite.dll(Windows, soload_extension('./ragite')there). Release binaries are published for Linux only so far. Your SQLite must allow extension loading (in Python:conn.enable_load_extension(True); the macOS systemsqlite3cannot load extensions, use Homebrew SQLite). - Model.
modelmay be omitted inCREATE VIRTUAL TABLE; the table then uses the built-in default Model. In this build that is potion-retrieval-32M, technical idpotion-retrieval-32M@6fc8051fab2a1e0ee76689cf08c853792ac285e7, asragite_default_model()reports. To pin it, writeUSING ragite(model='potion-retrieval-32M@6fc8051fab2a1e0ee76689cf08c853792ac285e7').
- One file, in process, no server: documents, chunks, vectors and full-text index live in the same SQLite database.
- Write through the document table and search documents or chunks;
INSERT,UPDATE,DELETEandROLLBACKkeep everything consistent. - Runs well on a CPU, with a built-in default embedding model and the option to bring your own.
- Core in Rust, separate from the SQLite layer, so a Rust library stays possible later.
Out of scope: parsing source formats (PDF, Office, ...), answer generation and evaluation. Input is text/plain, text/markdown, text/html, or a DoclingDocument.
The chunker, the scoring algorithm, and the other presets are fixed. You cannot change how text is cut, how scores are combined, or similar choices from SQL. A build behaves the same way for every caller.
If you want different presets, fork the repository and change the requirements.
Where those presets live in the code, and how to add a document type, write or change a chunker, or change the fusion: docs/tinkering.md.
Version 1.0 delivers the interface above. Releases follow Semantic Versioning: a breaking change to the SQL interface, or one that requires re-indexing, comes only with a new major version. The current release is on the releases page. See ROADMAP.md for what version 2.0 will deliver.
The design lives in SPEC.md. Version 1 uses potion-retrieval-32M (512 dimensions; the release libragite.so is about 135 MB (129 MiB) because the weights are embedded), chunks of at most 512 Unicode scalars split on a word boundary with an overlap of 64, and takes the 50 best full-text chunks and up to 50 vector neighbors, then drops vector neighbors farther than cosine distance 0.8879346251487732.
How the default Model is chosen (quality on MTEB sets, parity, CPU costs, Pareto front) and how to run it: bench/README.md.
See CONTRIBUTING.md. Security issues: SECURITY.md.
RAGite is developed agent-first. AI coding agents write all code, tests, and documentation, and review each other's changes, under human direction: specs, design decisions, and acceptance based on observed behaviour and test results. No human reads the code line by line. This is a deliberate choice. Quality rests on automated tests, CI, and independent agent review.
Evaluate the code against your own requirements before you depend on it. Found a problem? Open an issue.
Licensed under either of MIT or Apache-2.0 at your option (SPDX: MIT OR Apache-2.0). Third-party software and its licenses: THIRD_PARTY_NOTICES.md.