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})")