Metadata-Version: 2.4
Name: clamp-rag
Version: 1.2.0
Summary: Git-like version control for RAG vector databases
License: MIT
License-File: LICENSE
Keywords: rag,vector-database,qdrant,version-control,llm
Author: Clamp Team
Requires-Python: >=3.10,<3.14
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
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 :: Software Development :: Libraries :: Python Modules
Requires-Dist: click (>=8.1.7,<9.0.0)
Requires-Dist: httpx (>=0.27.0,<0.28.0)
Requires-Dist: qdrant-client (>=1.7.0,<2.0.0)
Requires-Dist: typer[all] (>=0.9.0,<0.10.0)
Project-URL: Homepage, https://github.com/athaapa/clamp-monorepo
Project-URL: Repository, https://github.com/athaapa/clamp-monorepo
Description-Content-Type: text/markdown

# Clamp - Version Control for RAG

Git-like versioning for vector databases. Rollback your knowledge base without losing data.

<p align="center">
  <img src="demo/clamp_demo.gif" alt="Clamp Demo showing RAG rollback" width="100%">
  <br>
  <em>Watch Clamp revert a poisoned RAG index instantly without re-embedding.</em>
</p>

## Install
```bash
pip install clamp-rag
```

## Quick Start (CLI)
```bash
# Initialize Clamp
clamp init

# Create and commit a document
echo "Your document content" > docs.txt
clamp commit docs.txt my_group "Added initial docs"

# View commit history
clamp history my_group

# Check current version
clamp status my_group

# Checkout previous commit
clamp checkout my_group HEAD~1   # or use commit hash

# List all tracked groups
clamp groups
```

## Why Clamp?
Vector DBs get stale when docs update. Old embeddings cause semantic conflicts in RAG retrieval.

Clamp adds git-style versioning:
- Commit your knowledge base
- Checkout any version instantly (no re-embed, no data copy, just metadata flags)
- Works on Qdrant (local sqlite history)

## Python API
```python
from qdrant_client import QdrantClient
from clamp import ClampClient

qdrant = QdrantClient("localhost", port=6333)
clamp_client = ClampClient(qdrant)

# Ingest with versioning
commit = clamp_client.ingest(
    collection="docs",
    group="my_group",
    documents=[{"text": "...", "vector": [...]}],
    message="Initial version"
)

# Rollback
clamp_client.rollback(collection="docs", group="my_group", commit_hash=commit)

# View history
clamp_client.history(group="my_group")
```

## How It Works
- Versions stored as separate points in Qdrant
- Metadata tracks commit hashes and active state  
- Rollback = flip active flags (instant, no data movement)
- Local SQLite stores commit history

## Status
🚀 v1.2.0 - Beta. Qdrant support only.

## Requirements
- Qdrant (local or cloud)
- Python 3.10+

# License
MIT - see [LICENSE](https://github.com/athaapa/clamp/blob/8514e7a86fc34378ea37aee915ca079935f9af5b/LICENSE) for more details.

