Knowledge Graph Operations
create_graph
Create a graph from documents
Parameters
name
(str): Name of the graph to createfilters
(Dict[str, Any], optional): Optional metadata filters to determine which documents to includedocuments
(List[str], optional): Optional list of specific document IDs to includeprompt_overrides
(GraphPromptOverrides | Dict[str, Any], optional): Optional customizations for entity extraction and resolution prompts
Returns
Calling create_graph
now returns a placeholder Graph
immediately.
graph
(Graph): Graph stub withsystem_metadata["status"] = "processing"
. Entities and relationships will be empty until processing completes.
Use db.wait_for_graph_completion("<name>")
(sync) or
await db.wait_for_graph_completion("<name>")
(async) to block until the
graph is done, or poll graph.is_processing
/ graph.is_completed
.
Examples
Graph Properties
The returned Graph
object has the following properties:
id
(str): Unique graph identifiername
(str): Graph nameentities
(List[Entity]): List of entities in the graphrelationships
(List[Relationship]): List of relationships in the graphmetadata
(Dict[str, Any]): Graph metadatadocument_ids
(List[str]): Source document IDsfilters
(Dict[str, Any], optional): Document filters used to create the graphcreated_at
(datetime): Creation timestampupdated_at
(datetime): Last update timestampowner
(Dict[str, str]): Graph owner informationaccess_control
(Dict[str, List[str]]): Access control information