agents.vectordbs
#
The following vector DB specification classes are meant to define a comman interface for initialization of vector DBs. Currently the only supported vector DB is Chroma.
Module Contents#
Classes#
API#
- class agents.vectordbs.ChromaDB#
Bases:
agents.vectordbs.DB
Chroma is the open-source AI application database. It provides embeddings, vector search, document storage, full-text search, metadata filtering, and multi-modal retreival support.
- Parameters:
name (str) β An arbitrary name given to the database.
db_location (str, optional) β The on-disk location where the database will be initialized. Defaults to β./dataβ.
username (Optional[str], optional) β The username for authentication. Defaults to None.
password (Optional[str], optional) β The password for authentication. Defaults to None.
encoder (Optional[Encoder], optional) β An optional encoder model to use for text encoding. Defaults to None.
init_timeout (int, optional) β The timeout in seconds for the initialization process. Defaults to 10 minutes (600 seconds).
host (str, optional) β The hostname or IP address of the database server. Defaults to β127.0.0.1β.
port (Optional[int], optional) β The port number to connect to the database server. Defaults to None.
Example usage:
from agents.models import Encoder db_config = DB(name='my_database', username='user123', password='pass123') db_config.db_location = '/path/to/new/location' db_config.encoder = Encoder(checkpoint="BAAI/bge-small-en")