hyrax.verbs.database_connection#
Attributes#
Classes#
Verb to insert inference results into a vector database index for fast |
Module Contents#
- class DatabaseConnection(config)[source]#
Bases:
hyrax.verbs.verb_registry.VerbVerb to insert inference results into a vector database index for fast similarity search.
Overall initialization for all verbs that saves the config
- 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