Skip to content

feat: support causal chain queries for mechanistic biological reasoning #143

@bhavyakeerthi3

Description

@bhavyakeerthi3

Problem

The Reactome Chatbot currently handles keyword-based queries well,
but fails on mechanistic questions like:

  • "What happens after protein phosphorylation?"
  • "What are the downstream consequences of BRCA1 mutation?"
  • "What reaction precedes ATP synthesis in glycolysis?"

Standard RAG retrieves relevant snippets but cannot reason about
order, causality, or sequence within biological pathways. The
chatbot either hallucinates a causal chain or gives a generic
non-answer.

Proposed Solution

Implement a Topological Flow Reasoning layer that:

  1. Detects mechanistic intent keywords (downstream, after,
    consequence, precedes, triggers)
  2. Fetches structured reaction participants and ordering from the
    Reactome Content Service API
  3. Verifies the extracted causal chain against the Reactome Graph
    before returning an answer

Feature Overview

  • ReactomeTopologyTool — retrieval tool that fetches reaction
    participants and preceding/subsequent events via the Reactome API
  • FlowReasoner task node — curator-level reasoning prompt that
    treats Reactome Graph data as ground truth for biological sequences
  • Intent-based routingCrossDatabaseGraphBuilder detects flow
    keywords and invokes the verification stack automatically

Why This Matters

Standard RAG treats all retrieved text equally. Biological pathways
have strict causal ordering — getting the sequence wrong produces
answers that are fluent but scientifically incorrect. This feature
makes the chatbot verifiably correct on mechanistic queries, not just
plausible-sounding.

Implementation Scope

  • src/tools/reactome_topology.py — new topology retrieval tool
  • src/agent/tasks/flow_reasoner.py — new reasoning task node
  • src/agent/profiles/cross_database.py — agent graph integration
  • tests/test_flow_reasoning.py — integration tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions