OpenViSTAI · Agents · Blockchain · Crypto
Menu
RAG & Knowledge Systems

Softrag

Softrag is an open-source Python library for building embedded retrieval-augmented generation systems. It stores text chunks, metadata, vector indexes and full-text indexes in a SQLite file, and combines dense-vector retrieval with BM25 full-text search using Reciprocal Rank Fusion. Model backends are optional and pluggable, including local options.

Independent OpenViST project profile, based on linked sources.

Softrag — OpenViST project profile in RAG & Knowledge Systems.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use Softrag when an application needs hybrid retrieval in an embedded SQLite database and a separate vector database service would add unnecessary infrastructure.

Who it is for

  • Python developers embedding retrieval and question-answering features in applications.
  • Teams building local knowledge bases or repository search tools.
  • Desktop and test-tool developers who want an index without a separate database service.

Documented uses

  • Ingest files, URLs or raw text into a local retrieval index.
  • Search with both semantic similarity and exact-term matching.
  • Query indexed material and retrieve an answer with associated source names.
  • Keep an index and its metadata together in a portable SQLite database file.
Before you choose

Requirements & limits

Softrag is an MIT-licensed open-source Python library. Its README specifies Python 3.10 or later and installation with pip.

  • The core engine uses sqlite-vec; model backends are optional, and provider integrations or local embeddings can require separate extras.
  • PDF ingestion requires the softrag[files] extra; enhanced URL fetching and web extraction are available through softrag[web].
  • Vector search is exact rather than approximate; the README describes its fit as up to a few hundred thousand chunks.
  • The library does not provide sharding, replication or a multi-writer cluster, and concurrent writes serialize on SQLite's write lock.
  • Retrieval combines vector and FTS5/BM25 rankings with Reciprocal Rank Fusion; optional stages include MMR diversity and neighbouring-chunk expansion.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Install Softrag and add a source to a SQLite index

Set up the library, create a database connection, and ingest a documented file, URL or text input.

Before you start

  • Python 3.10 or later
  • Install Softrag with pip

Steps

  1. Run the command below.

    Documented command
    pip install softrag
  2. Import softrag in Python and call softrag.connect("kb.db") to open or create the index database.

  3. Call rag.add(...) with a file path, URL or raw text.

Expected outcome

A SQLite database connection with the supplied source added to the index.

Guide limitations

  • PDF reading requires the softrag[files] extra.
  • A model backend may be detected from the environment; otherwise Softrag falls back to a hash embedder with a warning.
Source-based practical guide

Query an indexed source and inspect answer sources

Submit a question to an existing Softrag index and access the returned answer and source list.

Before you start

  • Python 3.10 or later
  • Softrag installed
  • A Softrag SQLite index and an ingested source

Steps

  1. Import softrag and connect to the database with softrag.connect("kb.db").

  2. Call rag.query("your question") and store the returned answer.

  3. Print the answer and inspect answer.sources.

Expected outcome

A string answer and an accessible list of source names associated with it.

Guide limitations

  • The selected model backend affects answer generation; Softrag may detect a configured backend or use its hash-embedder fallback.
COMPARE OPTIONS

Compare options for Retrieval-augmented applications

These projects document a common task and share a project role. This is a source-based comparison, not an execution benchmark or a guarantee of interchangeability.

ProjectDocumented purposePlatformAccess and requirements
SoftragIngest files, URLs or raw text into a local retrieval index.Linux, macOS, Self-hosted, WindowsSoftrag is an MIT-licensed open-source Python library. Its README specifies Python 3.10 or later and installation with pip.
LangsearchCrawl website or local data for a knowledge base.CLI, Self-hosted, Server
Hybrid Search RagCombine document retrieval and language-model generation in a configurable workflow.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
15 October 2026
Original website title
JulioPeixoto/softrag · Official homepage title · retained in its source language