Skip to main content

A Python library for efficient similarity search using high-dimensional vectors.

Project description

PyVecDB

PyVecDB is a Python library that provides a simple way to store and search high-dimensional vectors using the Annoy approximate nearest neighbors search library. This library is useful for various applications, such as searching for similar items, clustering, or reducing search spaces in machine learning problems.

Features

  • Store high-dimensional vectors with associated metadata in an SQLite database
  • Perform fast, approximate nearest neighbor searches using Annoy
  • Easily add, update, and delete entries
  • Serialize and deserialize vector data using MessagePack

Installation

You can install PyVecDB using pip:

pip install pyvecdb

Usage

Here's a simple example that demonstrates how to use PyVecDB:

from datetime import datetime
from random import random
from pyvecdb import VectorDB, DataObject

# Initialize the database
db = VectorDB(db_path="vector_data.db")

# Create a new entry
entry = DataObject(timestamp=datetime.now(), message="Example message", vector=[random() for _ in range(3)])
db.add_entry(entry)

# Save the Annoy index
db.save_index("vector_index.ann")

# Load the Annoy index
db.load_index("vector_index.ann")

# Search for similar entries
entries = db.search_entries(vector=entry.vector, num_results=10)

Documentation

For detailed documentation and examples, please visit the official documentation.

Contributing

Contributions are welcome! Please read our contributing guidelines to get started.

License

PyVecDB is released under the MIT License.

Support

If you like my work consider buying me a coffee ☕ Support my work on Patreon or PayPal!

Support me on Patreon

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

PyVecDB-0.1.2.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PyVecDB-0.1.2-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file PyVecDB-0.1.2.tar.gz.

File metadata

  • Download URL: PyVecDB-0.1.2.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for PyVecDB-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2384cc27d9410375103f5cfd566c3fa7a139d8f587d9f0048410488e16d730bb
MD5 c87009b638095d2d7f0b184082f12f1d
BLAKE2b-256 c470009077dde4a104ddb5c66c399e085c32a923545dcb8e30051e50d970a0cd

See more details on using hashes here.

File details

Details for the file PyVecDB-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: PyVecDB-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for PyVecDB-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7c4a95a84eb7273978e4976d12bef67b7755b94b399777c93eca113a2117792e
MD5 61b6c59243a59c291927fca77e02971c
BLAKE2b-256 c7e62f84b078c6c759bb4da20d7fece9be90bb8718fb5b8b1c0eb9bd4dddc5e8

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