RAGQueryEngine
autogen.agentchat.contrib.rag.RAGQueryEngine #
Bases: Protocol
A protocol class that represents a document ingestation and query engine on top of an underlying 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:
-
connecting to a database.
-
insert records.
-
build indexes etc.
Args:
new_doc_dir (Optional[Union[Path, str]]): A directory containing documents to be ingested.
new_doc_paths_or_urls (Optional[Sequence[Union[Path, str]]]): A list of paths or URLs to documents to be ingested.
*args: Any additional arguments
**kwargs: Any additional keyword arguments
Returns:
bool: True if initialization is successful, False otherwise
Source code in autogen/agentchat/contrib/rag/query_engine.py
add_docs #
Add new documents to the underlying data store.
Source code in autogen/agentchat/contrib/rag/query_engine.py
connect_db #
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: |