Metadata-Version: 2.4
Name: clamp-rag
Version: 1.0.3
Summary: Git-like version control for RAG vector databases
License: MIT
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.

## Install
```
pip install clamp-rag
```
## Quick Start
```Python
from qdrant_client import QdrantClient, models

from clamp import ClampClient

# Local Qdrant instance
qdrant = QdrantClient(":memory:")

# Create a test collection (you might need to set up the schema properly)
qdrant.create_collection(
    collection_name="test_docs",
    vectors_config=models.VectorParams(
        size=384, distance=models.Distance.COSINE
    ),  # adjust as needed
)

# Initialize Clamp
clamp_client = ClampClient(qdrant)

# Ingest v1
docs_v1 = [{"text": "First version", "vector": [0.1] * 384}]  # dummy vector
commit1 = clamp_client.ingest(
    collection="test_docs", group="docs", documents=docs_v1, message="Initial version"
)
print(f"Commit 1: {commit1}")

# Ingest v2
docs_v2 = [{"text": "Second version", "vector": [0.2] * 384}]
commit2 = clamp_client.ingest(
    collection="test_docs", group="docs", documents=docs_v2, message="Updated docs"
)
print(f"Commit 2: {commit2}")

# Check status
status = clamp_client.status(collection="test_docs", group="docs")
print(f"Current status: {status}")

# Rollback to v1
clamp_client.rollback(collection="test_docs", group="docs", commit_hash=commit1)
print("Rolled back to commit 1")

# Verify rollback worked
status_after = clamp_client.status(collection="test_docs", group="docs")
print(f"Status after rollback: {status_after}")

# Check history
history = clamp_client.history(group="docs")
print(f"History: {[h.hash[:8] for h in history]}")
```

## How It Works
- Versions are tracked via metadata in your vector DB
- Rollbacks flip active/inactive flags (no data movement)
- Local SQLite stores commit history

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

## Status
Early alpha. Qdrant only. Expect bugs.

## License
MIT

