Skip to content

Repository files navigation

Agentic Genetic Assessment

A multi-agent workflow for genetics-informed health optimization that can run in multiple agent harnesses, including VS Code + GitHub Copilot Chat, OpenAI Codex, Anthropic Claude Code, and OpenCode. Based on the AgenticWorkflow pattern.

What This Is

This project splits a comprehensive genetic health assessment (originally a single monolithic prompt) into 7 specialist agents that can work in parallel where dependencies allow. Each agent has a focused role, clear inputs/outputs, and explicit handoff protocols.

This is NOT a software application. It's a prompt engineering framework — a structured set of agent definitions, knowledge bases, and orchestration rules that guide LLM-based analysis of personal genotype data.

Architecture

┌─────────────────────────────────────────────────────────────────┐
│                        PHASE 1 (parallel)                       │
│                                                                 │
│  ┌──────────────┐                    ┌──────────────────┐       │
│  │ Interviewer   │                    │  Data Engineer    │       │
│  │ (user intake) │                    │  (parse genotype) │       │
│  └──────┬───────┘                    └────────┬─────────┘       │
│         │                                     │                 │
└─────────┼─────────────────────────────────────┼─────────────────┘
          │                                     │
          │                          ┌──────────▼─────────┐
          │                          │    PHASE 2          │
          │                          │    Geneticist       │
          │                          │    (interpret SNPs) │
          │                          └──────────┬─────────┘
          │                                     │
          └──────────────┬──────────────────────┘
                         │
              ┌──────────▼─────────┐
              │     PHASE 3        │
              │     Clinician      │
              │  (correlate geno-  │
              │   type + phenotype)│
              └──────────┬─────────┘
                         │
              ┌──────────▼─────────┐
              │     PHASE 4        │
              │   Action Planner   │
              │  (staged plan +    │
              │   lab recs)        │
              └──────────┬─────────┘
                         │
              ┌──────────▼─────────┐
              │     PHASE 5        │
              │  Report Assembler  │
              │  (compile report)  │
              └──────────┬─────────┘
                         │
              ┌──────────▼─────────┐
              │     PHASE 6        │
              │     Reviewer       │
              │  (QA & approval)   │
              └──────────┬─────────┘
                         │
                    ✅ Final Report

Agent Roster

# Agent File Role Can Parallelize With
1 Interviewer specialists/interviewer.xml Structured intake interview (Sections A–C) Data Engineer
2 Data Engineer specialists/data-engineer.xml Parse, normalize, validate genotype CSV/TSV Interviewer
3 Geneticist specialists/geneticist.xml Variant extraction & functional interpretation —
4 Clinician specialists/clinician.xml Phenotype-genotype correlation & hypotheses —
5 Action Planner specialists/action-planner.xml Staged action plan & lab recommendations —
6 Report Assembler specialists/report-assembler.xml Compile final 7-section report —
7 Reviewer specialists/reviewer.xml QA: evidence quality, safety, consistency —

Project Structure

AgenticGeneticAssesment/
├── .github/
│   └── copilot-instructions.md     # Copilot-specific instructions (still supported)
├── .claude/
│   └── agents/                     # Claude Code project subagents
├── .codex/
│   ├── config.toml                 # Codex MCP + agent runtime config
│   └── agents/                     # Codex custom subagents
├── .opencode/
│   └── agents/                     # OpenCode project agents/subagents
├── .vscode/
│   ├── mcp.json                    # VS Code MCP configuration
│   └── settings.json               # Editor settings
├── .mcp.json                       # Claude Code project MCP configuration
├── AGENTS.md                       # Shared vendor-neutral agent instructions
├── CLAUDE.md                       # Claude Code instructions (imports AGENTS.md)
├── HARNESS-COMPATIBILITY.md        # Cross-tool setup and mapping details
├── opencode.json                   # OpenCode project configuration
├── specialists/
│   ├── interviewer.xml             # Phase 1: User intake
│   ├── data-engineer.xml           # Phase 1: Genotype parsing
│   ├── geneticist.xml              # Phase 2: Variant interpretation
│   ├── clinician.xml               # Phase 3: Clinical correlation
│   ├── action-planner.xml          # Phase 4: Action plan
│   ├── report-assembler.xml        # Phase 5: Report compilation
│   └── reviewer.xml                # Phase 6: Quality assurance
├── knowledge/
│   ├── variant-reference.md        # rsID reference tables by pathway
│   ├── lab-reference.md            # Confirmatory lab tests by pathway
│   └── pubmed-evidence-lookup.md   # Curated PMID lookup tables by pathway
├── data/
│   └── example-genotype.tsv        # Example genotype file for testing
├── specialists.code-snippets.json  # VS Code snippets for quick insertion
├── instructions.md                 # Global workflow instructions
├── MONO-AGENT-PROMPT.md            # Original monolithic prompt (reference)
└── README.md                       # This file

How to Use

Prerequisites

  • One supported harness: GitHub Copilot, OpenAI Codex, Anthropic Claude Code, or OpenCode
  • Node.js 18+ (for local MCP servers, if needed)

Setup

  1. Open this folder in VS Code.

  2. Configure MCP servers (optional but recommended): This repository includes harness-specific MCP config files that all point to the same evidence/documentation servers (context7 and pubmed):

    • VS Code/Copilot: .vscode/mcp.json
    • Claude Code: .mcp.json
    • Codex: .codex/config.toml
    • OpenCode: opencode.json
  3. Copy VS Code snippets (optional, Copilot only): Copy specialists.code-snippets.json to .vscode/ to enable /interviewer, /data-engineer, etc. as quick-insert snippets in Copilot Chat.

Harness-Specific Bootstrapping

  • GitHub Copilot (VS Code): Use .github/copilot-instructions.md and the specialist XML files directly.

  • OpenAI Codex: Run Codex in the repository root so .codex/config.toml, .codex/agents/, and AGENTS.md are discovered.

  • Anthropic Claude Code: Run Claude in the repository root so .mcp.json, .claude/agents/, and CLAUDE.md are loaded.

  • OpenCode: Run OpenCode in the repository root so opencode.json and .opencode/agents/ are active.

See HARNESS-COMPATIBILITY.md for exact mapping and doc references.

Running the Workflow

Phase 1 — Parallel Intake + Data Processing

Start two agent sessions (or run sequentially):

Session A: Interviewer

  1. Paste the contents of specialists/interviewer.xml into your agent chat
  2. The agent will walk through Sections A–C of the interview
  3. Save the structured intake summary

Session B: Data Engineer

  1. Paste the contents of specialists/data-engineer.xml into your agent chat
  2. Save your genotype file in data/ (CSV/TSV) and provide the file name or path
  3. Save the dataset quality report and clean data index

Phase 2 — Geneticist

  1. Clear chat context
  2. Paste specialists/geneticist.xml + the Data Engineer's output
  3. The agent produces: variant table, pathway summaries, confirmation tests
  4. Use the PubMed MCP tools to confirm evidence strength and capture key PMIDs for High/Medium claims
  5. Seed citations from knowledge/pubmed-evidence-lookup.md, then add pathway-specific recent papers as needed.

Phase 3 — Clinician

  1. Clear chat context
  2. Paste specialists/clinician.xml + the Interviewer's intake summary + the Geneticist's output
  3. The agent produces: clinical hypotheses, safety flags, prioritized findings
  4. Use the PubMed MCP tools to validate High/Medium hypotheses and cite PMIDs where possible
  5. Prefer PMIDs from knowledge/pubmed-evidence-lookup.md as anchors, then update with phenotype-specific literature.

Phase 4 — Action Planner

  1. Clear chat context
  2. Paste specialists/action-planner.xml + the Clinician's output + user constraints
  3. The agent produces: staged action plan + lab recommendations

Phase 5 — Report Assembler

  1. Clear chat context
  2. Paste specialists/report-assembler.xml + ALL previous outputs
  3. The agent compiles the complete 7-section report

Phase 6 — Reviewer

  1. Clear chat context
  2. Paste specialists/reviewer.xml + the assembled report
  3. Spot-check High-evidence claims with PubMed MCP; flag weak or missing citations
  4. The agent checks for over-interpretation, safety issues, consistency
  5. If "Pass" → deliver report. If "Needs revision" → send back to Report Assembler.

PubMed Evidence Support

Use the PubMed MCP server to support evidence checks and citations:

  • Search for gene/SNP associations and lab test evidence
  • Fetch abstracts/metadata and capture PMIDs for High/Medium claims
  • Pull full text only when open access and needed
  • Start from knowledge/pubmed-evidence-lookup.md for fast, consistent anchor citations

Using with a Single Chat Session

You can also run the entire workflow in a single long session by pasting specialist XMLs sequentially and explicitly handing off outputs. This uses more tokens but requires less context management.

Final Report Structure

The assembled report contains:

Section Content
I. Executive Summary 10–20 bullet top findings + highest ROI next steps
II. Interview-Based Personalization Goals, constraints, key symptoms, hypotheses
III. Variant Table All markers: Pathway, Gene, rsid, Genotype, Interpretation, Evidence, Actionability
IV. Pathway Deep Dives 9 pathway sections with genetics + clinical correlation + interactions
V. Action Plan Staged: Start Now / Next 30 Days / Next 90 Days
VI. Lab Recommendations Conditional: "If genotype + symptoms → labs"
VII. What I Need From You Next Missing data that would change the plan

Marker Coverage

The workflow analyzes 40+ key rsIDs across these pathways (and expands beyond):

  • Methylation/One-Carbon: MTHFR, MTRR, MTR, CBS
  • Neurotransmitters: COMT, BDNF, ADRA2A
  • Lipids/Neurodegeneration: APOE (haplotype)
  • Longevity: FOXO3
  • Inflammation: TNF-alpha, IL-6, IL-10
  • Blood Pressure: AGTR1
  • Weight/Metabolism: FTO, PPARG, ADRB2
  • Lactose: LCT/MCM6
  • Caffeine: CYP1A2
  • Detox/Oxidative Stress: GSTP1, NQO1, SOD2
  • Vitamin D: VDR (4 variants)
  • Iron: HFE (C282Y, H63D)
  • Histamine: DAO, HNMT
  • Celiac: HLA-DQ2.5, HLA-DQ8
  • Microbiome: FUT2
  • Circadian: CLOCK

Differences from the Mono-Agent Prompt

Aspect Mono-Agent Multi-Agent
Execution Single sequential prompt 7 specialists, parallel where possible
Context window Requires huge context Each agent gets focused context
Specialization One prompt does everything Each agent has domain expertise
Quality control Self-review Dedicated Reviewer agent
Reusability All-or-nothing Individual agents can be reused/swapped
Maintainability One massive prompt to edit Modular files, edit independently

Customization

  • Add markers: Edit the Data Engineer's rsid checklist and the Geneticist's interpretation rules
  • Add pathways: Add entries to knowledge/variant-reference.md and update the Report Assembler's pathway list
  • Change tools: Edit <tools> in each specialist XML and update all harness MCP configs (.vscode/mcp.json, .mcp.json, .codex/config.toml, opencode.json)
  • Adjust report format: Modify the Report Assembler's sequence steps

Disclaimer

This workflow produces educational genetic interpretation, not medical advice. Genetic variants are probabilistic signals, not diagnoses. Always confirm findings with laboratory tests and discuss with qualified healthcare providers before making changes to diet, supplements, or medications.

Credits

  • Agentic workflow pattern inspired by ant3869/AgenticWorkflow
  • Designed for use with GitHub Copilot Chat, OpenAI Codex, Anthropic Claude Code, OpenCode, and the Model Context Protocol (MCP)

About

A multi-agent workflow for genetics-informed health optimization, designed for use with Coding Agents.

Resources

Stars

25 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors