Skip to main content

Vector Similarity Search Engine

Project description

VecSim - A unified interface for similarity servers

A standard, light-weight interface to all popular similarity servers.

The problems we are trying to solve:

  1. Standard API - Different vector similarity servers have different APIs - so switching is not trivial.
  2. Identifiers - Some vector similarity servers support string IDs, some do not - we keep track of the mapping.
  3. Partitions - In most cases, pre-filtering is needed prior to querying, we abstract this concept away.
  4. Aggregations - In some cases, one item is being indexed to multiple vectors.

Supported engines:

  1. Scikit-learn, via NearestNeighbors
  2. RediSearch
  3. Faiss
  4. ElasticSearch
  5. Pinecone

QuickStart example

import numpy as np
# Import a similarity server of your choice:
# SKlearn (best for small datasets or testing)
from vecsim import SciKitIndex
sim = SciKitIndex(metric='cosine', dim=32)

user_ids = ["user_"+str(1+i) for i in range(100)]
user_data = np.random.random((100,32))
item_ids=["item_"+str(101+i) for i in range(100)]
item_data = np.random.random((100,32))
sim.add_items(user_data, user_ids, partition="users")
sim.add_items(item_data, item_ids, partition="items")
# Index the data
sim.init()
# Run nearest neighbor vector search
query = np.random.random(32)
dists, items = sim.search(query, k=10) # returns a list of users and items
dists, items = sim.search(query, k=10, partition="users") # returns a list of users only

For more examples, please read our documentation

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

vecsim-0.0.62.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

vecsim-0.0.62-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file vecsim-0.0.62.tar.gz.

File metadata

  • Download URL: vecsim-0.0.62.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for vecsim-0.0.62.tar.gz
Algorithm Hash digest
SHA256 067f5ca5e573abcf423e1f10b8682c9e8081eb5a0ba533c27cbabfdc8454212f
MD5 375ead8da1c22f7d5f52bc1b8273ea37
BLAKE2b-256 de14d37e75e0f05caa74fea3c15270cca699f1ac1c10c199453c2f0009f4f90e

See more details on using hashes here.

File details

Details for the file vecsim-0.0.62-py3-none-any.whl.

File metadata

  • Download URL: vecsim-0.0.62-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for vecsim-0.0.62-py3-none-any.whl
Algorithm Hash digest
SHA256 0864cd2cc3e1483d117e00858a2c00b8ab37f9ad4ebd4693d39215be67d60cb6
MD5 7ac302bfcf457ceddf58134e70b662d3
BLAKE2b-256 b26b64cb7ae88a1abcefda84f4bfbd340926b35c42f86c367b29d087a3cf7b16

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