Metadata-Version: 2.4
Name: rapid-rag
Version: 0.2.0
Summary: Fast local RAG - search your documents with AI, no cloud needed
Project-URL: Homepage, https://humotica.com
Project-URL: Repository, https://github.com/humotica/rapid-rag
Project-URL: Documentation, https://humotica.com/docs/rapid-rag
Author-email: "J. van de Meent" <jasper@humotica.com>, "R. AI" <info@humotica.com>
License: MIT
Keywords: ai,augmented,chromadb,documents,embeddings,generation,llm,local,offline,rag,retrieval,search,semantic-search,vector-search
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Text Processing :: Indexing
Requires-Python: >=3.10
Requires-Dist: chromadb>=0.4.0
Requires-Dist: httpx>=0.24.0
Requires-Dist: sentence-transformers>=2.2.0
Provides-Extra: all
Requires-Dist: fastapi>=0.100.0; extra == 'all'
Requires-Dist: ollama>=0.1.0; extra == 'all'
Requires-Dist: pdfplumber>=0.9.0; extra == 'all'
Requires-Dist: pypdf>=3.0.0; extra == 'all'
Requires-Dist: uvicorn>=0.22.0; extra == 'all'
Provides-Extra: api
Requires-Dist: fastapi>=0.100.0; extra == 'api'
Requires-Dist: uvicorn>=0.22.0; extra == 'api'
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Provides-Extra: ollama
Requires-Dist: ollama>=0.1.0; extra == 'ollama'
Provides-Extra: pdf
Requires-Dist: pdfplumber>=0.9.0; extra == 'pdf'
Requires-Dist: pypdf>=3.0.0; extra == 'pdf'
Description-Content-Type: text/markdown

# rapid-rag

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

## Installation

```bash
pip install rapid-rag
```

For PDF support:
```bash
pip install rapid-rag[pdf]
```

## Quick Start

```python
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

```bash
# 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:

```python
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](https://ollama.ai) running locally

## License

MIT - Humotica
