hyrax.verbs.database_connection

Attributes

logger

Classes

DatabaseConnection

Verb to insert inference results into a vector database index for fast

Module Contents

logger[source]
class DatabaseConnection(config)[source]

Bases: hyrax.verbs.verb_registry.Verb

Verb to insert inference results into a vector database index for fast similarity search.

__init__()[source]

Overall initialization for all verbs that saves the config

cli_name = 'database_connection'[source]
add_parser_kwargs[source]
static setup_parser(parser: argparse.ArgumentParser)[source]

Stub of parser setup

run_cli(args: argparse.Namespace | None = None)[source]

Stub CLI implementation

run(database_dir: pathlib.Path | str | None = None)[source]

Create a connection to the vector database for interactive queries.

Parameters:

database_dir (str or Path, Optional) – The directory containing the database that will be connected to. If None, attempt to connect to the most recently created …-vector-db-… directory. If specified, it can point to either an empty directory or a directory containing an existing vector database. If the latter, the database will be updated with the new vectors.

_get_database_type_from_config(database_dir: pathlib.Path)[source]

Internal function that will read a config file from a directory and return the name of the vector database from it. i.e. “chromadb”, “qdrant”.

Parameters:

database_dir (Path) – The directory containing the vector database and the config file that be used as reference.

Returns:

The config value for [“vector_db”][“name”] in the reference config.

Return type:

str