Documentation Index
Fetch the complete documentation index at: https://databridge-add-core-funcs.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
def list_graphs(
folder_name: Optional[Union[str, List[str]]] = None,
folder_depth: Optional[int] = None,
end_user_id: Optional[str] = None,
) -> List[Graph]
async def list_graphs(
folder_name: Optional[Union[str, List[str]]] = None,
folder_depth: Optional[int] = None,
end_user_id: Optional[str] = None,
) -> List[Graph]
Parameters
folder_name (str | List[str], optional): Optional folder scope. Accepts canonical paths or a list of paths/names.
folder_depth (int, optional): Folder scope depth. None/0 = exact match, -1 = include all descendants, n > 0 = include descendants up to n levels deep.
end_user_id (str, optional): Optional end-user scope.
Returns
List[Graph]: List of graph objects
Examples
from morphik import Morphik
db = Morphik()
# List all accessible graphs
graphs = db.list_graphs()
for graph in graphs:
status = graph.status or "completed"
print(
f"Graph: {graph.name} (status={status}), "
f"Entities: {len(graph.entities)}, Relationships: {len(graph.relationships)}",
)
# Scope to a nested folder subtree
nested_graphs = db.list_graphs(folder_name="/projects/alpha", folder_depth=-1)
# Find the most recent graph
latest_graph = max(graphs, key=lambda g: g.updated_at)
print(f"Most recently updated: {latest_graph.name} (updated {latest_graph.updated_at})")
from morphik import AsyncMorphik
async with AsyncMorphik() as db:
# List all accessible graphs
graphs = await db.list_graphs()
for graph in graphs:
status = graph.status or "completed"
print(
f"Graph: {graph.name} (status={status}), "
f"Entities: {len(graph.entities)}, Relationships: {len(graph.relationships)}",
)
nested_graphs = await db.list_graphs(folder_name="/projects/alpha", folder_depth=-1)
# Find the most recent graph
latest_graph = max(graphs, key=lambda g: g.updated_at)
print(f"Most recently updated: {latest_graph.name} (updated {latest_graph.updated_at})")
Graph Properties
Each Graph object in the returned list has the following properties:
id (str): Unique graph identifier
name (str): Graph name
entities (List[Entity]): List of entities in the graph
relationships (List[Relationship]): List of relationships in the graph
metadata (Dict[str, Any]): Graph metadata
document_ids (List[str]): Source document IDs
filters (Dict[str, Any], optional): Document filters used to create the graph
created_at (datetime): Creation timestamp
updated_at (datetime): Last update timestamp
owner (Dict[str, str]): Graph owner information
folder_path (Optional[str]): Canonical folder path for the graph (if scoped)