Skip to main content

A minimal, dependency-free Retrieval-Augmented Generation (RAG) engine using SQLite as a local vector store.

Project description

smallrag

A minimal RAG engine with zero external runtime dependencies. Stores documents and embeddings in SQLite, supports chunking, metadata filtering, caching, import/export, and a simple embedder interface.

Install

pip install small-rag

Quick example

from Smallrag import SmallRAG

# Provide a simple embedder (random stub or a real model)
def dummy_embed(text: str) -> list[float]:
    # Real users should plug SentenceTransformers, OpenAI embeddings, Ollama, etc.
    import hashlib
    bs = hashlib.sha256(text.encode()).digest()
    return [b/255 for b in bs]

rag = SmallRAG("./data/rag.db", verbose=True)
rag.set_embedder(dummy_embed)
rag.add_document("Kafka is a distributed streaming platform.")
rag.add_document("Spark is used for large-scale data processing.")
print(rag.query("stream processing"))

Features

  • Chunking
  • Metadata filtering
  • Caching of embeddings
  • Import / Export
  • Simple CLI

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

small_rag-0.1.1.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

small_rag-0.1.1-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file small_rag-0.1.1.tar.gz.

File metadata

  • Download URL: small_rag-0.1.1.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for small_rag-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e2019d4fc36e867b8fd4c3c8f168ee6c25cd6cb06e160767d1c5f115fdde11ea
MD5 b4968f564ccba5ef1d08afb39788d016
BLAKE2b-256 711ba887248197d87051b349115461ae7f49168ec6cd1d96b1ff42a220ca6e12

See more details on using hashes here.

File details

Details for the file small_rag-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: small_rag-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for small_rag-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2b039920b55ccbcfed23e345cd64806c838240d5a19fec0ecb10b96172aeb3c0
MD5 20503c47ef5a6be4d07e3d3f78abf9de
BLAKE2b-256 dd0a1b56b3e523733549a33431d6cad9200432d16ad3ae1582659fe86e99a748

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page