memory_inspect_graph_tool
Analyze memory relationships by exploring connected nodes and edges to visualize graph structures for AI memory systems.
Instructions
Inspect the graph structure around a memory node.
Performs read-only breadth-first search from the origin memory, collecting all nodes and edges within max_depth hops. Returns structured data for visualization including Mermaid diagram generation.
Args: memory_id: ID of the memory to start inspection from max_depth: Maximum number of hops to traverse (default: 2) direction: Edge traversal direction - "outgoing", "incoming", or "both" (default: "both") edge_types: Optional list of edge types to include (None means all). Valid types: relates_to, supersedes, caused_by, contradicts include_scores: If True, compute relevance scores for paths (default: True) decay_factor: Factor by which relevance decays per hop (default: 0.7) output_format: Output format - "json" or "mermaid" (default: "json")
Returns: Dictionary with: - success: Boolean indicating operation success - origin_id: The starting memory ID - nodes: List of node dicts with id, content_preview, type, confidence, importance - edges: List of edge dicts with id, source_id, target_id, edge_type, weight - paths: List of path dicts with node_ids, edge_types, total_weight, relevance_score - stats: Dict with node_count, edge_count, max_depth_reached, origin_id - mermaid: Mermaid diagram string (only when output_format='mermaid') - error: Error message (if failed)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| memory_id | Yes | ||
| max_depth | No | ||
| direction | No | both | |
| edge_types | No | ||
| include_scores | No | ||
| decay_factor | No | ||
| output_format | No | json |