Skip to main content

ColBERT Live! implements efficient ColBERT and ColPaLi search on top of vector indexes that support live updates (without rebuilding the entire index)

Project description

ColBERT Live!

ColBERT Live! implements efficient ColBERT search on top of vector indexes that support live updates (without rebuilding the entire index) as well as arbitrary predicates against other indexed fields.

Background

ColBERT (Contextualized Late Interaction over BERT) is a state-of-the-art semantic search model that combines the effectiveness of BERT-based language models with the performance required for practical, large-scale search applications.

Compared to traditional dense passage retrieval (i.e. vector-per-passage) ColBERT is particularly strong at handling unusual terms and short queries.

It is reasonable to think of ColBERT as combining the best of semantic vector search with traditional keyword search a la BM25, but without having to tune the weighting of hybrid search or dealing with corner cases where the vector and keyword sides play poorly together.

However, the initial ColBERT implementation is designed around a custom index that cannot be updated incrementally, and can only be combined with other indexes with difficulty. Adding, modifying, or removing documents from the custom index requires reindexing the entire collection, which can be prohibitively slow for large datasets.

ColBERT Live!

ColBERT Live! implements ColBERT on any vector database. This means you can add, modify, or remove documents from your search system without the need for costly reindexing of the entire collection, making it ideal for dynamic content environments. It also means that you can easily apply other predicates such as access controls or metadata filters from your database to your vector searches. ColBERT Live! features

  • Efficient ColBERT search implementation
  • Support for live updates to the vector index
  • Abstraction layer for database backends, starting with AstraDB
  • State of the art ColBERT techniques including:
    • Answer.AI ColBERT model for higher relevance
    • Document embedding pooling for reduced storage requirements
    • Query embedding pooling for improved search performance

Installation

You can install ColBERT Live! using pip:

pip install colbert-live

Usage

  • Subclass your database backend and implement the required methods for retrieving embeddings:
    from colbert_live.db.astra import AstraCql
    
    class MyDB(AstraCql):
      ...
    
    db = MyDB()
    
  • Instantiate model = colbert_live.models.ColbertModel() or model = colbert_live.models.ColpaliModel()
  • Initialize colbert = ColbertLive(db, model)
  • Call colbert.search(query_str, top_k)

Two cheat sheets are available:

Supported databases

ColBERT Live! initially supports DataStax Astra out of the box. Adding support for other databases is straightforward; check out the Astra implementation for an example to follow. If you're not concerned about making it reusable, you just have to implement the two methods of the base DB class.

License

This project is licensed under the Apache License 2.0. See the LICENSE file for 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

colbert_live-0.4.1.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

colbert_live-0.4.1-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file colbert_live-0.4.1.tar.gz.

File metadata

  • Download URL: colbert_live-0.4.1.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.15

File hashes

Hashes for colbert_live-0.4.1.tar.gz
Algorithm Hash digest
SHA256 e6857f117ba273647b68fa758e6a78e7bba0a24edcbf7d1a9804efe7aceeb33c
MD5 f29fc6e391d48910cd89e75f5fe1670a
BLAKE2b-256 0fec5ac28e37e1480a68d3f81153723e853198ebb521530f0eea386f2ec82a7f

See more details on using hashes here.

File details

Details for the file colbert_live-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: colbert_live-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.15

File hashes

Hashes for colbert_live-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 da0f67143e330457fb62595840385917f3c06d4aba0e0340853864b0b04c704c
MD5 7c329109beb0505032d3e338d3fec17f
BLAKE2b-256 8aedb56d8635aaabb08ee967df0155681d740b4722e7f8eba9debde161e191f9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page