VectorDbQueryEngine
autogen.agentchat.contrib.rag.VectorDbQueryEngine #
Bases: Protocol
An abstract base class that represents a query engine on top of an underlying vector database.
This interface defines the basic methods for RAG.
init_db #
Initialize the database with the input documents or records.
This method initializes database with the input documents or records. Usually, it takes the following steps, 1. connecting to a database. 2. insert records 3. build indexes etc.
PARAMETER | DESCRIPTION |
---|---|
new_doc_dir | a dir of input documents that are used to create the records in database. |
new_doc_paths | a list of input documents that are used to create the records in database. a document can be a path to a file or a url. |
*args | Any additional arguments TYPE: |
**kwargs | Any additional keyword arguments TYPE: |
RETURNS | DESCRIPTION |
---|---|
bool | True if initialization is successful, False otherwise TYPE: |
Source code in autogen/agentchat/contrib/rag/query_engine.py
add_records #
Add new documents to the underlying database and add to the index.
Source code in autogen/agentchat/contrib/rag/query_engine.py
connect_db #
Connect to the database.
PARAMETER | DESCRIPTION |
---|---|
*args | Any additional arguments TYPE: |
**kwargs | Any additional keyword arguments TYPE: |
RETURNS | DESCRIPTION |
---|---|
bool | True if connection is successful, False otherwise TYPE: |
Source code in autogen/agentchat/contrib/rag/query_engine.py
query #
Transform a string format question into database query and return the result.
PARAMETER | DESCRIPTION |
---|---|
question | a string format question TYPE: |
*args | Any additional arguments TYPE: |
**kwargs | Any additional keyword arguments TYPE: |