Skip to main content

Fast local RAG - search your documents with AI, no cloud needed

Project description

rapid-rag

Fast local RAG - search your documents with AI, no cloud needed.

Installation

pip install rapid-rag

For PDF support:

pip install rapid-rag[pdf]

Quick Start

from rapid_rag import RapidRAG

# Create a RAG instance
rag = RapidRAG("my_documents")

# Add documents
rag.add("doc1", "The quick brown fox jumps over the lazy dog.")
rag.add_file("report.pdf")
rag.add_directory("./docs/")

# Semantic search
results = rag.search("fox jumping")
for r in results:
    print(f"{r['score']:.3f}: {r['content'][:100]}")

# RAG query with LLM (requires Ollama)
answer = rag.query("What does the fox do?", model="qwen2.5:7b")
print(answer["answer"])

CLI Usage

# Initialize a collection
rapid-rag init my_docs

# Add documents
rapid-rag add ./documents/ -c my_docs -r

# Search
rapid-rag search "query here" -c my_docs

# RAG query (requires Ollama)
rapid-rag query "What is X?" -c my_docs -m qwen2.5:7b

# Info
rapid-rag info -c my_docs

TIBET Provenance

Track every operation with cryptographic provenance:

from rapid_rag import RapidRAG, TIBETProvider

# Enable TIBET tracking
tibet = TIBETProvider(actor="my_app")
rag = RapidRAG("docs", tibet=tibet)

# All operations now create provenance tokens
rag.add_file("report.pdf")
results = rag.search("query")
answer = rag.query("Question?")

# Get provenance chain
tokens = tibet.get_tokens()
for t in tokens:
    print(f"{t.token_type}: {t.erachter}")
    print(f"  ERIN: {t.erin}")  # What happened
    print(f"  ERACHTER: {t.erachter}")  # Why

TIBET uses Dutch provenance semantics:

  • ERIN: What's IN the action (content)
  • ERAAN: What's attached (references)
  • EROMHEEN: Context around it
  • ERACHTER: Intent behind it

Features

  • Local-first: Everything runs on your machine
  • Fast: ChromaDB + sentence-transformers
  • Simple API: Add, search, query in 3 lines
  • File support: .txt, .md, .pdf
  • Chunking: Automatic with overlap
  • LLM integration: Works with Ollama
  • TIBET: Cryptographic provenance for all operations

Requirements

  • Python 3.10+
  • For LLM queries: Ollama running locally

License

MIT - Humotica

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

rapid_rag-0.2.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

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

rapid_rag-0.2.0-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file rapid_rag-0.2.0.tar.gz.

File metadata

  • Download URL: rapid_rag-0.2.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for rapid_rag-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c27bea8a76be0a9d3ff167feca5a52e4ae7e55c4341f9411297ab4dade6b2069
MD5 6447994a207b33cdd6de8c04475571e8
BLAKE2b-256 fb4465c1ded08efd70c3a1dc2c5b5886ef1df5ca9e7065aa7ad7197305b33157

See more details on using hashes here.

File details

Details for the file rapid_rag-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: rapid_rag-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for rapid_rag-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5f952818e865e70ef60792c6ef0d4ebb04f7843277048a6bbf02af7a086aa94d
MD5 f5eaa58d55e7e4bc89a4a7e994dfa170
BLAKE2b-256 b5562f44ff09dada4378be5be1ecb1769b71059a4079d8899219fd3853ce8b8b

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