Skip to main content

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

Release files for vecsim 0.0.62

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vecsim 0.0.62
File Size Uploaded
vecsim-0.0.62.tar.gz 10.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vecsim 0.0.62
File Interpreter ABI Platform
vecsim-0.0.62-py3-none-any.whl Python 3 none any Details

Total release size: 18.9 kB

Release files / vecsim-0.0.62.tar.gz

Download URL vecsim-0.0.62.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
067f5ca5e573abcf423e1f10b8682c9e8081eb5a0ba533c27cbabfdc8454212f
BLAKE2b-256 checksum
How to use checksums
de14d37e75e0f05caa74fea3c15270cca699f1ac1c10c199453c2f0009f4f90e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / vecsim-0.0.62-py3-none-any.whl

Download URL vecsim-0.0.62-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0864cd2cc3e1483d117e00858a2c00b8ab37f9ad4ebd4693d39215be67d60cb6
BLAKE2b-256 checksum
How to use checksums
b26b64cb7ae88a1abcefda84f4bfbd340926b35c42f86c367b29d087a3cf7b16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release history Release notifications | RSS feed

This release

0.0.62 This release

2 release files

0.0.56

2 release files

0.0.55

2 release files

0.0.52

2 release files

0.0.51

2 release files

0.0.41

2 release files

0.0.37

2 release files

0.0.36

2 release files

0.0.21

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page