Skip to main content

Victo - a vector database

Project description

Victo

Victo is a AI Native, Lightweight, Plugable, Portable, Scalable Vector Database.

Introduction

Vector embeddings are the integral part of AI applications. There is a need for a database to store and effeciently retrive vectors. For which, Victo is a best choice.

The highlevel architecture of Victo is,

Database -> contains Collections -> contains Vectors

The DB operations supported by Victo are:

  • Add a Collection
  • Delete a Collection
  • Get the count of collections
  • List the collections in a database
  • Add a Vector Record
  • Delete a Vector Record
  • Retrive a Vector Record
  • Query Vector
  • Get the count of vectors in a collection
  • Get the list of vectors in a collection

The Query vector works based on the vector distance calculation. Supported methods:

  • Euclidean Distance
  • Cosine Similarity
  • Manhattan Distance
  • Minkowski Distance Method

Some of the usecases for Victo are:

  • NLP
  • Generative AI
  • Recommender System
  • Image Search
  • eCommerce
  • Machine Learning
  • Social Networks

Built With

  • Python 3.6
  • C

Getting Started

Pip Install

pip install victo

Facade

Facade is the interface to execute DB operations on Victo

from victo import facade as fd

Add a new Collection

fd.newCollection(db, collection)

Arguments:
    db          : string    : Eg: /path/tp/victodb/data
    collection  : string    : Eg: reports
Returns:
    returns a result set object (rs)
    rs.errCode  : int       
    rs.errMsg   : string

Delete a Collection

fd.deleteCollection(db, collection)

Arguments:
    db          : string    : Eg: /path/tp/victodb/data
    collection  : string    : Eg: reports
Returns:
    returns a result set object (rs)
    rs.errCode  : int       
    rs.errMsg   : string

Get the count of Collections in a DB

fd.collectionCount(db)

Arguments:
    db          : string    : Eg: /path/tp/victodb/data
Returns:
    returns a result set object (rs)
    rs.errCode  : int       
    rs.errMsg   : string
    rs.count    : int

Get the list of Collections in a DB

fd.collectionList(db)

Arguments:
    db          : string    : Eg: /path/tp/victodb/data    
Returns:
    returns a result set object (rs)
    rs.errCode      : int       
    rs.errMsg       : string
    rs.collections  : Array of string

Add a vector records to a Collection

fd.putVector(db, collection, ai_model, hash, vdim, vp, is_normal, overwrite)

Arguments:
    db          : string            : Eg: /path/tp/victodb/data
    collection  : string            : Eg: reports
    ai_model    : string            : Eg: any_ai_model_used_for_vector_embedding (Max. 64 chars)
    hash        : string            : Eg: vector_id (Max. 64 chars)
    vdim        : int               : 768 (size of vector dimension - Max. 2048)
    vp          : Array of float    : Vector Embeddings
    is_normal   : bool              : True or False (normalize before save)
    overwrite   : bool              : True or False (overwrite if vector already exist) 
Returns:
    returns a result set object (rs)
    rs.errCode  : int       
    rs.errMsg   : string
    rs.hash     : string    : Eg: vector_id

Query a single vector recors from a Collection

fd.getVector(db, collection, hash)

Arguments:
    db          : string            : Eg: /path/tp/victodb/data
    collection  : string            : Eg: reports
    hash        : string            : Eg: vector_id (Max. 64 chars)
Returns:
    returns a result set object (rs)
    rs.errCode  : int       
    rs.errMsg   : string
    rs.node     : vector node
        node.ai_model   :   string
        node.hash       :   string
        node.normal     :   int     : 0 - normalized, 1 - not normalized
        node.vdim       :   int
        node.vp         :   array of float

Query vector records based on a condition from a Collection

fd.queryVector(db, collection, ai_model, vdim, vp, vector_distance_method, query_limit, logical_op, k_value, p_value, do_normal, include_fault)

Arguments:
    db                      : string            : Eg: /path/tp/victodb/data
    collection              : string            : Eg: reports
    ai_model                : string            : Eg: any_ai_model_used_for_vector_embedding (Max. 64 chars)
    vdim                    : int               : 768 (size of vector dimension - Max. 2048) (input vector)
    vp                      : Array of float    : Vector Embeddings (input_vector)
    vector_distance_method  : int               : 0 - Euclidean, 1 - CosineSimilarity, 2 - Manhattan, 3 - Minkowski (Default: 0)
    query_limit             : int
    logical_op              : int               : 0 - equal, 1 - greater than, 2 - greater than or equal, -1 - less than, -2 - less than or equal (Default: 0)
    k_value                 : float             : value used for comparison while query (Default: 0)
    p_value                 : float             : (Default: 0)
    do_normal               : bool              : Do normalize before search (Default: False)
    include_fault           : bool              : (Default: False)
Returns:
    returns a result set object (rs)
    rs.errCode          : int       
    rs.errMsg           : string
    rs.queryCount       : int
    rs.faultCount       : int
    rs.queryVectorRS    : Array of vector result
        queryVectorRS.errCode   : int
        queryVectorRS.errMsg    : string
        queryVectorRS.ai_model  : string
        queryVectorRS.normal    : int
        queryVectorRS.hash      : string
        queryVectorRS.vdim      : int
        queryVectorRS.distance  : double      
    rs.faultVectorRS    : Array of vector result
        faultVectorRS.errCode   : int
        faultVectorRS.errMsg    : string
        faultVectorRS.ai_model  : string
        faultVectorRS.normal    : int
        faultVectorRS.hash      : string
        faultVectorRS.vdim      : int
        faultVectorRS.distance  : double  

Delete a vector record in a Collection

fd.deleteVector(db, collection, hash)

Arguments:
    db          : string    : Eg: /path/tp/victodb/data
    collection  : string    : Eg: reports 
    hash        : string    : Eg: vector_id   
Returns:
    returns a result set object (rs)
    rs.errCode  : int       
    rs.errMsg   : string

Get the count of vector records in a Collection

fd.vectorCount(db, collection)

Arguments:
    db          : string    : Eg: /path/tp/victodb/data
    collection  : string    : Eg: reports    
Returns:
    returns a result set object (rs)
    rs.errCode  : int       
    rs.errMsg   : string
    rs.count    : int

Get the list of vector records in a Collection

fd.vectorList(db, collection)

Arguments:
    db          : string    : Eg: /path/tp/victodb/data    
    collection  : string    : Eg: reports  
Returns:
    returns a result set object (rs)
    rs.errCode  : int       
    rs.errMsg   : string
    rs.vectors  : Array of string

Usage

The sample project listed here is a command line utility makes use of Cohere for vector embedings and victo for storing and processing vector embeddings.

Roadmap

  • The project right now is supported is only in MacOS. Work is in progress to be supported in Linux and Windows
  • Add support for additional Vector distance calculation methods such as: Jaccard Similarity and Hamming Distance

Contributing

Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Adding AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Authors

Sree Hari - hari.tinyblitz@gmail.com

Version History

Latest: v0.0.19

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

victo-0.0.19.tar.gz (27.1 kB view details)

Uploaded Source

Built Distribution

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

victo-0.0.19-py3-none-any.whl (43.6 kB view details)

Uploaded Python 3

File details

Details for the file victo-0.0.19.tar.gz.

File metadata

  • Download URL: victo-0.0.19.tar.gz
  • Upload date:
  • Size: 27.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for victo-0.0.19.tar.gz
Algorithm Hash digest
SHA256 4dc640fd467774d2bbdc578b35789e11ee2b43715dadd44ed70fe2f86d2ad0a1
MD5 5bb67992be555c4b5875d64e620a59e3
BLAKE2b-256 89d6da950f23c5a8903d61691d15e07a867806e336122da02276641321f958b1

See more details on using hashes here.

File details

Details for the file victo-0.0.19-py3-none-any.whl.

File metadata

  • Download URL: victo-0.0.19-py3-none-any.whl
  • Upload date:
  • Size: 43.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for victo-0.0.19-py3-none-any.whl
Algorithm Hash digest
SHA256 67db140e2a2024dfdd25f4f091cf0bc3416cc8f08531e08156d8eaded10f8998
MD5 d19f3ae3de8e69c92e41d1b0be00ebab
BLAKE2b-256 90a65e1653217df2f2f2430c3442a56024239380cb0941284b0178831dde9870

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