Skip to main content

A simple vector database allows difference search methods (consine similarity and euclidean distance ect.)

Project description

VDBpy

A simple vector database allows difference search methods (consine similarity and euclidean distance ect.)

Usage

View example.py for details

from VDBpy.indexing import VectorIndex
from VDBpy.query import VectorQuery

# Create a new vector index
index = VectorIndex()

# Add some vectors to the index
index.add_vector([1, 2, 3], 'vector1')
index.add_vector([4, 5, 6], 'vector2')

# Create a new vector query
query = VectorQuery(index)

# Execute the query
results = query.execute([2, 2, 2], k=2)
'''
# Execute the query using cosine similarity
results = query.execute([2,2,2], k=2, metric='cosine')
# Execute the query using Manhattan distance
results = query.execute([2,2,2], k=2, metric='manhattan')
# Execute the query using Jaccard similarity
results = query.execute([2,2,2], k=2, metric='jaccard')
'''

# Print the results
for id, similarity in results:
  print(f"ID: {id}, Similarity: {similarity}")

Installation

pip install VDBpy

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

VDBpy-0.1.4.tar.gz (2.6 kB view hashes)

Uploaded Source

Built Distribution

VDBpy-0.1.4-py3-none-any.whl (3.2 kB view hashes)

Uploaded Python 3

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