Skip to content

IntelegixLabs/BioPath

Repository files navigation

BioPathAI v2

Agentic AI platform for microbial pathway engineering LangGraph agents, PELT fermentation monitoring, TFT forecasting, Neo4j knowledge graph, AlphaFold 3D structures.

Requirements

  • Python 3.11+
  • Neo4j (running locally or via Docker)
  • An OpenAI API key (GPT-4o)

Run locally (recommended)

# 1. Clone and enter the repo
git clone https://github.com/IntelegixLabs/BioPath.git
cd BioPath

# 2. Set up environment variables
cp .env.example .env
# Edit .env  set OPENAI_API_KEY and NEO4J_PASSWORD at minimum

# 3. Create Python virtual environment and install dependencies
cd backend
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

# 4. Start Neo4j (if not already running)
#    Default bolt://localhost:7687  user=neo4j  password=test1000
#    Or use Docker:
docker run -d --name neo4j \
  -p 7474:7474 -p 7687:7687 \
  -e NEO4J_AUTH=neo4j/test1000 \
  neo4j:5

# 5. Start the backend
uvicorn main:app --host 0.0.0.0 --port 8000 --reload

# 6. Open the app
#    http://localhost:8000

The frontend (HTML/CSS/JS) is served directly by FastAPI from backend/static/ no separate build step needed.

First steps in the UI

  1. Discovery Campaign tab → click ▶ Launch Discovery Campaign
  2. PELT Monitor tab → click ▶ Run PELT Analysis
  3. Forecast Dashboard tab → click ▶ Run Forecast Suite
  4. Candidate Ranker tab → click ⚗ Seed Demo Data (populates KG), then Fetch Ranked Mutations
  5. AI Assistant tab → ask anything about the results

Run with Docker Compose (full stack)

cp .env.example .env          # fill in OPENAI_API_KEY
docker-compose up --build
# Backend: http://localhost:8000
# Neo4j browser: http://localhost:7474

Application Screenshots



Environment variables (minimum required)

Variable Description
OPENAI_API_KEY GPT-4o key for AI Assistant and agents
NEO4J_URI e.g. bolt://localhost:7687
NEO4J_USER default neo4j
NEO4J_PASSWORD your Neo4j password

All other variables in .env.example are optional (BRENDA, HADDOCK, etc.).

Structure

Current implementation: the web UI is the static application in /backend/static, served by FastAPI. There is no separate /frontend directory or Compose service.

  • /backend : FastAPI app, its static web UI, API connectors, ML modules, and KG integration
  • /docker-compose.yml : Orchestrates the backend, Neo4j, and MLflow

Security

  • Never commit real API keys. Use environment variables for all secrets.

BioPathAI v2 : Detailed Overview & Architecture

Vision & Problem Context

BioPathAI v2 is an agentic AI platform purpose-built for GPS Renewables' Ethanol-to-Jet (ETJ) project. The core challenge is not ethanol supply, but the efficient microbial conversion of ethanol into C8–C16 hydrocarbons for jet fuel. Traditional approaches are limited by non-uniform rate-limiting steps, a vast mutation search space, lack of feedback, and fragmented data silos. BioPathAI v2 addresses these with a continuously improving, ontology-grounded, knowledge-graph-powered, forecasting-driven, and autonomously orchestrated discovery system.

Five-Layer Architecture

BioPathAI v2 is structured as five tightly integrated layers, each feeding into and learning from the others:

1. Bio-Ontology Semantic Foundation

  • Purpose: Provides a universal translation layer for data from KEGG, BRENDA, UniProt, AlphaFold, and GPS internal experiments.
  • Ontologies Used: GO, ChEBI, SBO, OBI, PRO, Relation Ontology.
  • Key Functions:
    • Semantic query resolution (e.g., cross-organism mutation transfer)
    • Mutation filtering by GO-annotated active sites
    • Condition-aware kinetic data normalization

2. Ontology-Grounded Knowledge Graph (KG)

  • Technology: Neo4j with RDF/OWL ontologies (Neosemantics), Cypher & SPARQL queries
  • Role: Central nervous system; all data, predictions, literature, and annotations become nodes/edges
  • Features:
    • GraphRAG: Automated literature mining (BioBERT NER) into KG
    • Contradiction detection and human alerts
    • Multi-hop semantic queries for rapid insight

3. Agentic AI Orchestration

  • Framework: LangGraph (stateful agent graphs)
  • Agents: Orchestrator, PathwayAnalysis, MutationGeneration, Docking, KineticsPredictor, Hypothesis, ExperimentPlanner, OntologyAgent
  • Principles:
    • Human-in-the-loop by exception (autonomous unless escalation needed)
    • Structured message passing, shared KG state
    • Task graph decomposition and parallel execution

4. PELT Change-Point Detection

  • Algorithm: Pruned Exact Linear Time (ruptures library)
  • Applications:
    • Real-time fermentation batch monitoring (OD600, titre, DO, pH)
    • Model drift detection (rolling RMSE)
    • Pathway flux regime shift detection (COBRApy FBA)
  • Integration: Change-points written to KG, trigger retraining, and inform TFT forecasts

5. Temporal Fusion Transformer (TFT) Forecasting

  • Purpose: Multi-horizon forecasting for R&D planning (yield, efficiency, resource needs)
  • Features:
    • Handles multiple covariates, missing data, and uncertainty quantification
    • PELT change-points as covariates prevent extrapolation past regime shifts
    • All forecasts written to KG with full provenance

Data Feedback & Continuous Learning

  • Experimental results logged via UI create Experiment nodes in KG
  • HypothesisAgent computes prediction-vs-actual delta, surfaces hypotheses
  • Retraining triggered by batch completion, PELT drift, or schedule
  • Negative results (REFUTES) are first-class data for model learning

Agent Workflow Example

  1. Researcher requests: "Optimise ethanol → alkanes in E. coli for 37°C, pH 7.2, target: C12–C14 alkanes > 2 g/L"
  2. OrchestratorAgent parses, checks KG, decomposes task graph
  3. PathwayAnalysisAgent identifies RDS, writes to KG
  4. MutationGenerationAgent proposes candidates, conditioned on KG priors
  5. DockingAgent & KineticsPredictor run in parallel, results merged
  6. Top candidates surfaced to researcher with KG evidence
  7. ExperimentPlannerAgent schedules wet-lab work
  8. HypothesisAgent analyzes results, triggers retraining if needed

Technology Stack

  • Backend: FastAPI (Python), Neo4j, ML modules (PELT, TFT), agent orchestration (LangGraph)
  • Frontend: Static HTML/CSS/JS served by FastAPI, with dashboards, structure viewer, and logbook
  • DevOps: Docker Compose, secure API key management

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages