10

BioGraphRAG

A multi-agent system that reads PubMed literature into a Neo4j knowledge graph and reasons over it to propose cited inhibitory-pathway hypotheses.

Agents
6
CDK stacks
6
Streaming
SSE

Proposing a drug-target pathway means tracing multi-hop relationships (compound to protein to pathway) across thousands of papers. Conventional vector retrieval returns similar passages but loses the relationships between entities, so the evidence chain behind a hypothesis has to be rebuilt by hand.

BioGraphRAG ingests PubMed articles, extracts biological entities and relationships, and stores them in a Neo4j graph alongside a Postgres metadata store. A six-agent LangGraph pipeline (query parser, graph explorer, evidence retriever, pathway synthesiser, validator and report generator) traverses the graph and streams its progress to the browser over Server-Sent Events, ending in a hypothesis with citations. Models sit behind a pluggable multi-provider LLM layer. The React 19 frontend renders the graph with Cytoscape.js, and the AWS CDK infrastructure is written as six stacks covering networking, secrets, data, messaging, storage and compute.

  • Six-agent LangGraph pipeline with real-time agent state streamed to the UI over Server-Sent Events
  • PubMed ingestion into a Neo4j knowledge graph, with scispaCy entity extraction and a rule-based fallback
  • Pluggable multi-provider LLM layer, so the reasoning model can change without touching the agents
  • AWS CDK infrastructure across six stacks (VPC, Secrets Manager, RDS, EFS, SQS, S3 + CloudFront, ECS Fargate), with OIDC-based CI/CD

Select a layer to read why it is there.

  1. Model provider chosen by configuration

    The reasoning layer sits behind a provider registry selected at startup from an environment variable, and each provider's SDK is loaded only when it is chosen. Changing provider is a deployment setting rather than a code change; the trade-off is one provider per deployment, not per request.

  2. Stream agent state instead of waiting for the answer

    A hypothesis takes several agent steps, so the API streams each step's state over Server-Sent Events and the interface shows progress as it happens. SSE covers the one-way flow from server to browser; WebSockets were left as an optional extra.

  3. Graph traversal instead of vector similarity

    Retrieval walks multi-hop paths in Neo4j, from compound to protein to pathway, so each hypothesis arrives with the path that supports it. Similarity search over passages was left out of the first version: it finds related text but not the relationships between entities.

  4. One Neo4j writer

    In the infrastructure code, Neo4j runs as a single task on a shared file system and is never started twice during a deploy, which avoids two writers on one volume at the cost of a short gap while it updates.

Turns a manual cross-paper review into a traceable pipeline: every proposed pathway arrives with the graph path and the literature that support it, ready for a researcher to check.

  • A six-agent pipeline from question to cited hypothesis, with a loop back for more data when the evidence is thin.
  • About 140 tests across unit, integration and performance suites.
  • Infrastructure written as six CDK stacks that synthesise without cloud credentials; not yet deployed.