Skip to main content

Git-like version control for RAG vector databases

Project description

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.

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

clamp_rag-1.2.0.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

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

clamp_rag-1.2.0-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file clamp_rag-1.2.0.tar.gz.

File metadata

  • Download URL: clamp_rag-1.2.0.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for clamp_rag-1.2.0.tar.gz
Algorithm Hash digest
SHA256 d549cea3ee75b8b24d75aba2453bb57dc91967701d7431532b0aeb0947b35345
MD5 a577bdcc14fc29d43eb10f59fd7458c2
BLAKE2b-256 92c91c732f0cb1eee5f306a6b937f88bf67fd93d95c965e80b1d01f7f220c724

See more details on using hashes here.

File details

Details for the file clamp_rag-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: clamp_rag-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for clamp_rag-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bf2692093222411ba0f97321e9d0a6587981b240d6c78cecd1e42fa07fd3799c
MD5 38df1d03e92914f4a2025a1597c8beaf
BLAKE2b-256 4eadca43621e8757da191a69e1573c0ff6699a1224b18a422205f3a32c7fce92

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