https://github.com/ate329/vdbpy
A simple python vector database allows difference search methods (consine similarity and euclidean distance ect.)
https://github.com/ate329/vdbpy
database simple-project vector-database
Last synced: about 2 months ago
JSON representation
A simple python vector database allows difference search methods (consine similarity and euclidean distance ect.)
- Host: GitHub
- URL: https://github.com/ate329/vdbpy
- Owner: Ate329
- License: mit
- Created: 2023-07-18T15:27:38.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-04T19:38:19.000Z (over 2 years ago)
- Last Synced: 2025-09-25T13:51:42.432Z (10 months ago)
- Topics: database, simple-project, vector-database
- Language: Python
- Homepage:
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# VDBpy
A simple vector database allows difference search methods (consine similarity and euclidean distance ect.)
## Usage
View example.py for details
```python
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') # for some reasons jaccard similarity is not working
# Execute the query using Euclidean distance
results = query.execute([2,2,2], k=2, metric='euclidean')
'''
# Print the results
for id, similarity in results:
print(f"ID: {id}, Similarity: {similarity}")
```
## Installation
```bash
pip install VDBpy
```