Skip to content

human-again/biowizard

Repository files navigation

Invictus Prototype

AI-Assisted Biotech Method Development Platform

Overview

Invictus is a full-stack platform for semi-automated, literature-backed method design and optimization for biotech R&D. The system follows a 12-step workflow from PIF capture through troubleshooting, supporting 5 project types:

  1. Protein Purification
  2. Fermentation Optimization
  3. Strain Engineering
  4. Assay Development
  5. HPLC Method Development

Architecture

  • Backend: FastAPI + LangGraph + PostgreSQL (pgvector)
  • Frontend: Next.js 14 (App Router) + Tailwind CSS + Radix UI
  • AI: OpenAI/Anthropic/Azure (configurable) + LangChain
  • Orchestration: LangGraph with human-in-the-loop gates

Project Structure

prototype-biowizard/
├── backend/              # FastAPI application
│   ├── app/
│   │   ├── api/          # REST endpoints
│   │   ├── models/       # SQLAlchemy models
│   │   ├── workflow/     # LangGraph workflow
│   │   ├── ai/           # LLM and extraction pipeline
│   │   └── ...
│   ├── migrations/       # Alembic migrations
│   └── tests/
├── frontend/             # Next.js application
│   └── src/
│       ├── app/          # Pages and routes
│       ├── components/   # React components
│       └── lib/          # Utilities and API client
├── libraries/            # Reference data (JSON)
│   ├── pif/              # PIF schemas
│   ├── parameters/       # Parameter tables
│   ├── micro_protocols/  # Protocol library
│   └── kpi/              # KPI definitions
├── prompts/              # System prompts (12 steps)
└── docs/                 # Documentation

Quick Start

Prerequisites

  • Docker and Docker Compose
  • (For local development) Python 3.11+ and Node.js 20+

Using Docker (Recommended)

  1. Clone the repository

  2. Copy .env.example to .env and add your API keys:

    cp .env.example .env
    # Edit .env and add your OPENAI_API_KEY or ANTHROPIC_API_KEY
  3. Start the services:

    docker-compose up
  4. Access the application:

Local Development

Backend

cd backend

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Run migrations
alembic upgrade head

# Start the server
uvicorn app.main:app --reload

Frontend

cd frontend

# Install dependencies
npm install

# Start the dev server
npm run dev

12-Step Workflow

  1. Capture PIF: Collect project information from user
  2. Normalize PIF: Standardize field names and values
  3. Infer Missing: Fill in missing PIF fields with AI
  4. Validate PIF: Human review gate for inferred values
  5. Literature Search: Find and rank papers by parameter coverage
  6. Parameter Extraction: Extract values from literature with verification
  7. MCM Construction: Build Method Configuration Matrix (single-choice)
  8. Feasibility Review: Human review gate, re-extract rejected parameters
  9. EP Assembly: Assemble Experimental Protocol from micro protocols
  10. ETR Generation: Generate Experimental Trial Record template
  11. KPI Evaluation: Calculate KPIs from trial results
  12. Troubleshooting: Map problems to solutions, iterate or finalize

Key Features

Human-in-the-Loop Gates

User review and approval at critical steps:

  • Step 4: PIF validation
  • Step 7-8: MCM review and re-extraction
  • Step 10: ETR submission
  • Step 12: Iteration decision

Source Hierarchy

Strict priority order for parameter selection:

  1. PIS (Primary Information Source)
  2. Reference (papers cited by PIS)
  3. SIS (Supplementary Information Source)
  4. Inferred (AI estimation, only as last resort)

Advanced Extraction Pipeline

Multi-stage verification for accuracy:

  • Section parsing
  • Structured LLM extraction
  • Two-pass verification
  • Quote verification (embedding similarity)
  • Unit normalization
  • Range validation

Full Audit Trail

Complete traceability:

  • All AI decisions logged
  • Provenance for every parameter
  • Token usage tracking
  • Error logging

Environment Variables

See .env.example for all configuration options. Key variables:

# Required
DATABASE_URL=postgresql+asyncpg://postgres:postgres@localhost:5432/invictus
OPENAI_API_KEY=sk-...  # Or ANTHROPIC_API_KEY

# Optional
LLM_PROVIDER=openai  # openai, anthropic, or azure
DEBUG=false

Testing

# Backend tests
cd backend
pytest

# Frontend tests
cd frontend
npm test

Implementation Status

Phase 1 (Foundation) - ✅ Complete:

  • Backend scaffolding
  • Frontend scaffolding
  • Docker Compose setup
  • Database schema
  • Environment configuration

Next Steps:

  • Library system (JSON schemas)
  • Prompt library (12 step prompts)
  • LangGraph workflow engine
  • Workflow step implementations
  • Frontend UI components
  • Testing and deployment

Documentation

License

Proprietary - All rights reserved

Support

For issues and questions, please contact the development team.

About

AI-assisted biotech R&D platform for literature-backed method development with human-in-the-loop workflow automation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors