graph_query_engine
autogen.agentchat.contrib.graph_rag.graph_query_engine.GraphQueryEngine
GraphQueryEngine
An abstract base class that represents a graph query engine on top of a underlying graph database.
This interface defines the basic methods for graph-based RAG.
Parameters:Name | Description |
---|---|
*args | |
**kwargs |
Instance Methods
add_records
Add new records to the underlying database and add to the graph if required.
Parameters:Name | Description |
---|---|
new_records | Type: list |
init_db
This method initializes graph database with the input documents or records. Usually, it takes the following steps,
- connecting to a graph database.
- extract graph nodes, edges based on input data, graph schema and etc.
- build indexes etc.
Name | Description |
---|---|
input_doc | a list of input documents that are used to build the graph in database. Type: list[autogen.agentchat.contrib.graph_rag.document.Document] | None Default: None |
query
This method transform a string format question into database query and return the result.
Parameters:Name | Description |
---|---|
question | Type: str |
n_results | Type: int Default: 1 |
**kwargs |