agents.vectordbs

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#

ChromaDB

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.

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")