Skip to main content

No project description provided

Project description

Verus

Verus is a powerful, lightweight and flexible vector store that is designed to work seamlessly with multiple databases. It is built with LLM in mind, making it an ideal choice for natural language processing, information retrieval, and recommendation systems.

One of the key benefits of Verus is its agnostic design, which allows it to integrate with a wide range of databases. This means that you can use Verus with your existing database infrastructure, without having to worry about compatibility issues.

Installation

You can install VerusDB using pip:

pip install verusdb

Usage

from verusdb.settings import Settings
from verusdb.client import VerusClient

# Create a new VerusDB client
settings = Settings(folder='data', engine='polars')
client = VerusClient(settings)

# Add some documents to the database
client.add(
    collection='MyCollection',
    texts=['This is my first document', 'This is my second document'],
    metadata=[{'source': 'input', 'pages': '3'}, {'source': 'input', 'pages': '5'}]
)

# Search for documents
response = client.search(text='what is my first document?')

This will output a list of documents that match the search query, along with their metadata and a cosine similarity score. You can adjust the the number of results you obtain by relevance

[
  {
    "collection": "MyCollection",
    "text": "This is my first document",
    "metadata": {
      "source": "input",
      "pages": "5"
    },
    "score": 0.937450967393278
  },
  {
    "collection": "MyCollection",
    "text": "This is my second document",
    "metadata": {
      "source": "input",
      "pages": "5"
    },
    "score": 0.8927016698439493
  }
]

Configuration

You can configure VerusDB by passing a Settings object to the VerusClient constructor. The Settings object allows you to specify the folder where the database files will be stored, the storage engine to use (currently Polars and Redis are supported),

Polars

from verusdb.settings import Settings
from verusdb.client import VerusClient
from verusdb.embeddings.openai import OpenAIEmbeddingsEngine

# Create a new VerusDB client with custom settings
settings = Settings(
    folder='data',
    engine='polars',
    embeddings=OpenAIEmbeddingsEngine(key='my-openai-api-key')
)
client = VerusClient(settings)

Redis

from verusdb.settings import Settings
from verusdb.client import VerusClient
from verusdb.embeddings.openai import OpenAIEmbeddingsEngine

# Create a new VerusDB client with custom settings
settings = Settings(
    engine='redis',
    redis = {
                'host': 'localhost',
                'port': 6379,
                'db': 0,
                'password': None,
                'prefix': 'doc:',
                'index': 'verusdb'
    },
    embeddings=OpenAIEmbeddingsEngine(key='my-openai-api-key')
)
client = VerusClient(settings)

PostgreSQL

from verusdb.settings import Settings
from verusdb.client import VerusClient
from verusdb.embeddings.openai import OpenAIEmbeddingsEngine

# Create a new VerusDB client with custom settings
settings = Settings(
    engine='redis',
    postgres = {
                "host": "localhost",
                "port": 5432,
                "db": "verus",
                "username": "verus",
                "password": "verus",
                "table": "verusdb"
    },
    embeddings=OpenAIEmbeddingsEngine(key='my-openai-api-key')
)


client = VerusClient(settings)

Contributing

If you find a bug or have a feature request, please open an issue on the GitHub repository. Pull requests are also welcome!

License

VerusDB is licensed under the MIT License.

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

verusdb-0.0.1.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

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

verusdb-0.0.1-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file verusdb-0.0.1.tar.gz.

File metadata

  • Download URL: verusdb-0.0.1.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.8.10 Linux/5.15.90.1-microsoft-standard-WSL2

File hashes

Hashes for verusdb-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f7cb31fa22b2869c13cd1debcae1400ff0a71239a2b7c5dfe2106ef0a2745c53
MD5 d813bab393c5f5ef313953d8966626fd
BLAKE2b-256 bd33c6469fefb7257493bb1af1b67e85cbfb4e2c2c0a0f9a969eaad72072ea9b

See more details on using hashes here.

File details

Details for the file verusdb-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: verusdb-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.8.10 Linux/5.15.90.1-microsoft-standard-WSL2

File hashes

Hashes for verusdb-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 818bf905360292279e151b9c9263379db8879f6bad04144e2cd1de72323eaba9
MD5 441f0b7cc2e38f2c0843cc30710c5ba8
BLAKE2b-256 0ffee960753dee00ab6e088df29344efa66f22a9225e6190cbc24116e04d8508

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