Problem
ReactomeTopologyTool provides only immediate "local" context for any given reaction — direct inputs, outputs, and direct preceding events. For complex mechanistic queries (e.g., "What is the ultimate trigger for Apoptosis through this specific cascade?"), the agent lacks the ability to look further back into causal chains.
This "tunnel vision" limits reasoning quality, as many biological questions require traversing several steps to answer correctly.
Proposed Enhancement
Extend ReactomeTopologyTool to support recursive multi-hop traversal.
Key Requirements
- Upstream Traversal: Follow
precedingEvent links recursively to establish causal history (A ← B ← C).
- Hierarchical Traversal: Explore
hasEvent relationships for Pathway objects to find sub-pathways and specific reactions.
- Safety & Token Management:
- Cycle detection to avoid infinite loops in circular pathway structures
- Configurable
max_depth (default=2) to balance data richness against LLM context window limits
- Breadth limiting to cap events fetched per level
Impact
Provides the flow reasoner with a complete causal process map instead of isolated reactions — directly improving answer quality for mechanistic queries like "What happens after X?" or "What triggers Y?"
Files Affected
src/tools/reactome_topology.py
tests/test_flow_reasoning.py
Problem
ReactomeTopologyToolprovides only immediate "local" context for any given reaction — direct inputs, outputs, and direct preceding events. For complex mechanistic queries (e.g., "What is the ultimate trigger for Apoptosis through this specific cascade?"), the agent lacks the ability to look further back into causal chains.This "tunnel vision" limits reasoning quality, as many biological questions require traversing several steps to answer correctly.
Proposed Enhancement
Extend
ReactomeTopologyToolto support recursive multi-hop traversal.Key Requirements
precedingEventlinks recursively to establish causal history (A ← B ← C).hasEventrelationships forPathwayobjects to find sub-pathways and specific reactions.max_depth(default=2) to balance data richness against LLM context window limitsImpact
Provides the flow reasoner with a complete causal process map instead of isolated reactions — directly improving answer quality for mechanistic queries like "What happens after X?" or "What triggers Y?"
Files Affected
src/tools/reactome_topology.pytests/test_flow_reasoning.py