Skip to main content

Git-like version control for RAG vector databases

Reason this release was yanked:

broken

Project description

Clamp

Git-like version control for RAG vector databases.

Clamp gives you commit, rollback, and history tracking for your Qdrant vector databases.

Installation

git clone https://github.com/athaapa/clamp-monorepo.git
cd clamp-monorepo/packages/sdk
pip install -e .

Quick Start

from qdrant_client import QdrantClient
from clamp import ClampClient

# Setup
qdrant = QdrantClient(":memory:")
clamp = ClampClient(qdrant)

qdrant.create_collection(
    collection_name="docs",
    vectors_config={"size": 3, "distance": "Cosine"}
)

# Commit documents
documents = [
    {"id": 1, "vector": [0.1, 0.2, 0.3], "text": "Hello world"}
]
commit = clamp.ingest(
    collection="docs",
    group="my_docs",
    documents=documents,
    message="Initial commit"
)

# Query with version filter
filter_obj = clamp.get_active_filter("my_docs")
results = qdrant.search(
    collection_name="docs",
    query_vector=[0.1, 0.2, 0.3],
    query_filter=filter_obj,
    limit=5
)

# View history
history = clamp.history("my_docs")

# Rollback
clamp.rollback("docs", "my_docs", commit)

Key Concepts

  • Groups: Organize documents with independent version histories
  • Commits: Each ingest creates a commit with a message
  • Active Filter: Automatically query the current version
  • Rollback: Instantly switch to any previous version

CLI

# View history
clamp history my_docs

# Check status
clamp status docs my_docs

# Rollback
clamp rollback docs my_docs <commit-hash>

# List groups
clamp list-groups

API

ClampClient(qdrant_client)

Initialize the client with a Qdrant instance.

ingest(collection, group, documents, message)

Commit documents to a group. Returns commit hash.

rollback(collection, group, commit_hash)

Rollback group to a previous commit.

history(group, limit=10)

Get commit history for a group.

get_active_filter(group)

Get filter object for querying active documents.

status(collection, group)

Show current state and statistics.

Requirements

  • Python 3.8+
  • Qdrant Client
  • SQLite3

License

MIT

Links

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.2.tar.gz (12.1 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.2-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: clamp_rag-1.0.2.tar.gz
  • Upload date:
  • Size: 12.1 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.2.tar.gz
Algorithm Hash digest
SHA256 aff32eaf7605e2a0723273a347984f82e72539a5e208a07acde288297b80253d
MD5 8f68dbcdaa6ac8a325a638530648cabf
BLAKE2b-256 b128102b40975011176e3dce14640da08690a354ec47b3195199938660ba4a7d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: clamp_rag-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 14.8 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 faee202ac0ffe2b72524c6341efda52f404d107bad2a84ee9d7c30a2a701d5df
MD5 1393ef3f42364207d839ad57c5d6cea8
BLAKE2b-256 c706fecf9162c33db6bee9ce61bcdb3134955018bcdd2ebcd620ed1e86065c17

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