Skip to main content

Highly flexible vector store

Project description

VectorMass

VectorMass vector database

Vector databases are used to store vector embeddings for fast retrieval, similarity search, and other operations like crud operations. Simply, embedding is a numerical array that includes a huge number of features. So, using vector databases we can perform a lot of useful things on that numerical representation.

In traditional databases like MySQL, PostgreSQL, and SQL Server we are usually querying for rows in the database where the value matches our input query. In vector databases, we apply a similarity metric to find a vector that is the most similar to our query. There are a lot of dedicated vector databases out there such as VectorMass, Pinecone, Qdrant, Chroma DB, etc.

So, let’s learn how we can use VectorMass vector database…

# install vectormass library
pip install VectorMass
import VectorMass
import numpy as np

from sentence_transformers import SentenceTransformer
model = SentenceTransformer('all-mpnet-base-v2')

# Create a VectorStore instance
vector_store = VectorMass.Client()

# Define your sentences
sentences = [
    "I eat mango",
    "mango is my favorite fruit",
    "mango, apple, oranges are fruits",
    "fruits are good for health",
]
ids = ['id1', 'id2', 'id3', 'id4']

# create a collection
collection = vector_store.create_or_get_collection("test_collection")

# add ids, documents and embeddings to the collection
collection.add(
    ids= ids,
    documents=sentences,
    embedding_model=model
)

# retrive data from the collection
# result = collection.get_all()
# print(result)

# querying
res = model.encode(['healthy foods', 'I eat mango'])
result = collection.query(query_embeddings=res)
print(result)

Embeddings

Embeddings, in the context of machine learning and natural language processing (NLP), refer to numerical representations of words, sentences, or documents in a high-dimensional space. In VectorMass databse, use Sentence Transformer embeddings as default embeddings. Upto now, it supports only embedding models which is in Sentence Transformer.

License

Apache 2.0

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

VectorMass-0.0.2.tar.gz (12.0 kB view details)

Uploaded Source

File details

Details for the file VectorMass-0.0.2.tar.gz.

File metadata

  • Download URL: VectorMass-0.0.2.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for VectorMass-0.0.2.tar.gz
Algorithm Hash digest
SHA256 f684a2637edeeaa2e7f274cb811ff5e1b87bee94e9483f73c4ee77ba78d5de8c
MD5 a33acd384fe43aac275c191511c8c06e
BLAKE2b-256 d32c8aaa1b8988899f8bf1f5a031a808d3fb8ce12b985decd52f35cdd6c12fdf

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