AWS Builder Center
BioTrace AI: Multi-Omics Drug Repurposing via Graph-Vector Intelligence

BioTrace AI: Multi-Omics Drug Repurposing via Graph-Vector Intelligence

BioTrace AI leverages FalkorDB and multi-hop graph vector intelligence to provide autonomous, hallucination-free clinical drug repurposing and multi-omics discovery.

When building an autonomous clinical intelligence agent under tight hackathon timelines, the biggest hurdle is rarely just writing the model logic—it is bridging the gap between raw backend graph calculations, multi-omics data structures, and a high-performance production environment. For BioTrace AI, our multi-omics drug-repurposing agent built for Graph Hacks, we needed a rock-solid infrastructure that could manage FalkorDB vector-graph queries, asynchronous FastAPI reasoning loops, dynamic contradiction handling, and a responsive Next.js frontend without breaking a sweat.
In this article, we will take a deep dive into how we engineered and deployed BioTrace AI, breaking down our containerized GCP/Docker deployment strategy, core architectural pillars, and how we integrated complex graph-vector workflows into a seamless user experience.

1. The Architectural Blueprint & Technology Stack

BioTrace AI is designed to solve a critical failure in modern AI: general-purpose LLMs hallucinating drug pathways, inventing binding affinities, and fabricating scientific literature citations. To establish FalkorDB as an unyielding single source of truth, our property graph maps 126 nodes and 237 relationships across diseases, genes, proteins, small-molecule compounds, approved drugs, and peer-reviewed literature citations.
The application is structured into a high-performance, containerized single-VM architecture:
  • Database & Knowledge Graph (FalkorDB): Serves as our primary engine containing all 126 nodes and 237 relationships. It leverages native graph-vector indexing ( db.idx.vector.queryNodes ) and read-only execution enforcement ( GRAPH.RO_QUERY ).
  • Backend Agent (FastAPI & Python): Exposes an asynchronous API handling agent planning loops, tool execution, multi-hop routing, semantic anchoring, and Model Context Protocol (MCP) server bindings.
  • Frontend Dashboard (Next.js & React Flow): Provides a high-end glassmorphism interface featuring real-time agent trace streaming, interactive 126-node graph visualizations, side-by-side comparison matrices, and ephemeral sandbox controls.

2. Containerization and Production Deployment

To ensure clean execution and effortless scaling during evaluation, we packaged the entire stack into a containerized setup orchestrated via Docker Compose, built to run smoothly on a Google Compute Engine (GCE) VM instance ( e2-standard-2 ).

Container Orchestration ( docker-compose.prod.yml )

By containerizing the FastAPI service alongside our web frontend and database layer, we eliminated environment drift between local development and production.
YAML
version: '3.8'

services:
biotrace-backend:
build:
context: .
dockerfile: Dockerfile.backend
container_name: biotrace-backend
restart: always
ports:
- "8000:8000"
environment:
- PORT=8000
networks:
- biotrace-net

biotrace-frontend:
build:
context: .
dockerfile: Dockerfile.frontend
container_name: biotrace-frontend
restart: always
ports:
- "3000:3000"
depends_on:
- biotrace-backend
networks:
- biotrace-net

networks:
biotrace-net:
driver: bridge


3. Core Technical Innovations & Features (F1 – F7)

Deploying the code was only half the battle; the real engineering challenge lay in implementing robust features that guarantee clinical safety, transparency, and experimental interactivity:
  • Feature 1 (Hybrid Vector-Graph Semantic Anchor Routing): Clinical users often search using informal phrasing (e.g., "cardiac sugar control pill"). BioTrace bridges unstructured natural language straight into exact database entity IDs using FalkorDB’s native vector similarity procedure ( db.idx.vector.queryNodes ) over 384-dimensional embeddings before launching multi-hop traversals. Every step logs reasoning loops, parameterized Cypher, and raw rows under a read-only  GRAPH.RO_QUERY  guard.
  • Feature 2 (Ephemeral What-If Sandboxing): Static databases prevent researchers from testing hypothetical drug compounds without risking data corruption. Leveraging FalkorDB's multi-tenant isolation, clicking What-If Sandbox Mode instantly provisions an isolated session graph ( biotrace_sandbox_{session_id} ) seeded from the baseline. Researchers can inject synthetic drug hypotheses, define custom target interactions, and evaluate re-ranked candidate success without altering the core production graph.
  • Feature 3 (Dynamic Contradiction & Polarity Balancer): Traditional AI tools are optimistically blind to failed trials. BioTrace inspects the  polarity  property on every  CITES_EVIDENCE_FOR  edge. When a candidate path touches negative evidence—such as a failed clinical trial ( PAPER_MINO_HD )—the agent automatically applies a 40% score penalty and surfaces an amber contradiction warning.
  • Feature 4 (Natural-Language Cypher Storyteller): Converts raw Cypher execution tuples and node arrays into step-by-step narrative explanations. Clicking any sentence in the narrative interactively highlights that exact path segment on the React Flow knowledge graph canvas.
  • Features 5, 6, & 7 (Matrix, Exports, & Snapshots): BioTrace features a Side-by-Side Mechanism Comparison Matrix (F5), One-Click Clinical Brief Exports to publication-ready Markdown files with zero server latency (F6), and Shareable Sandbox Snapshot Links that encode custom lab experiments into compact URLs (F7).

4. Developer Standards & Interoperability

To ensure maximum utility across external developer ecosystems, all eleven core agent tools are exposed natively through the Model Context Protocol (MCP), allowing external agent runtimes to query the FalkorDB graph seamlessly. Furthermore, scoring is handled deterministically via geometric means of edge weights (affinities and expression levels) penalized strictly by hop counts, ensuring reproducible and verifiable research outputs.

5. Wrapping Up

Moving BioTrace AI from local experimentation to a fully deployed cloud architecture taught us invaluable lessons about managing graph-vector workloads, agentic tool orchestration, and strict safety guardrails under production constraints. By combining containerization, multi-tenant database isolation, and transparent agent tracing, we built a tool that offers genuine scientific utility without compromising on speed or reliability.
If you are interested in exploring the codebase, checking out the implementation details, or running your own multi-omics queries, check out our repository on GitHub:
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article