Skip to main content

Clamp - Version Control for RAG

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

Clamp Demo showing RAG rollback
Watch Clamp revert a poisoned RAG index instantly without re-embedding.

Install

pip install clamp-rag

Quick Start (CLI)

# 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

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 for more details.

Metadata

Release files for clamp-rag 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for clamp-rag 1.2.0
File Size Uploaded
clamp_rag-1.2.0.tar.gz 14.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for clamp-rag 1.2.0
File Interpreter ABI Platform
clamp_rag-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 30.5 kB

Release files / clamp_rag-1.2.0.tar.gz

Download URL clamp_rag-1.2.0.tar.gz
Size 14.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d549cea3ee75b8b24d75aba2453bb57dc91967701d7431532b0aeb0947b35345
BLAKE2b-256 checksum
How to use checksums
92c91c732f0cb1eee5f306a6b937f88bf67fd93d95c965e80b1d01f7f220c724
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / clamp_rag-1.2.0-py3-none-any.whl

Download URL clamp_rag-1.2.0-py3-none-any.whl
Size 16.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bf2692093222411ba0f97321e9d0a6587981b240d6c78cecd1e42fa07fd3799c
BLAKE2b-256 checksum
How to use checksums
4eadca43621e8757da191a69e1573c0ff6699a1224b18a422205f3a32c7fce92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.0

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page