Skip to main content

Git-like version control for RAG vector databases

Reason this release was yanked:

broken

Project description

Clamp - Version Control for RAG

Git-like versioning for vector databases.

Install

pip install clamp-rag

Quick Start

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

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.0.3.tar.gz (11.9 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.0.3-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: clamp_rag-1.0.3.tar.gz
  • Upload date:
  • Size: 11.9 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.0.3.tar.gz
Algorithm Hash digest
SHA256 4b288ed80dae72b2a25f8734b9eed08da4ecbe594952827b6f0891607b9010aa
MD5 9121ec6726e2baf97241b6424e69677c
BLAKE2b-256 34f427890d8577f5773a6dc9025e76723446ff22569f306e0aeb4c0c09a20199

See more details on using hashes here.

File details

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

File metadata

  • Download URL: clamp_rag-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 14.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.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2bb3288aee52a6ba6fad564ae543757b33536319747c6827c830eeaa67a504b9
MD5 e7cb1368fad3691adf0e0bab31984d47
BLAKE2b-256 decd700b473ada37506e4bb3aa008568ff79d6d2e3a9f248a71da2b6527c0a1c

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