Skip to content

faith-ogun/AlphaMimic

Repository files navigation

🦎 Alpha Mimic

AI-Powered Biomimicry Research Platform

10 agents, 5 services, 12 mechanism families, 8 layers of provenance — turning what nature already solved into something engineers can actually build.

Built with Gemini 3 Google ADK A2A Protocol React Firebase

View Demo · Watch Video


🌿 What is Alpha Mimic?

Alpha Mimic is a multi-agent research platform that analyzes biological research papers and produces Engineering-Grade Biomimicry Packets (EGBPs) — structured, downloadable design specifications that translate nature's solutions into engineering blueprints.

Upload papers about termite mound ventilation, camel thermoregulation, or elephant ear cooling. Describe your engineering challenge. Alpha Mimic's pipeline of 10 specialized AI agents extracts evidence, classifies mechanisms against a 12-family ontology, translates biology into physics equations with SI units, synthesizes cross-species patterns, generates a unified parametric design, red-teams it, plans verification protocols, and packages everything with full provenance tracking — every design decision traces back to a specific claim in a peer-reviewed paper.

"Nature has already solved many of the problems we're trying to solve." — Janine Benyus

The Problem

3.8 billion years of biological R&D produced solutions to every engineering challenge imaginable — thermal regulation, impact resistance, self-healing, drag reduction. But this knowledge is buried in academic papers that engineers can't easily translate. There's no standardized format for converting biological mechanisms into engineering specifications.

Our Solution

Alpha Mimic bridges this gap with a 5-service, 10-agent pipeline powered by Gemini 3 that produces a structured EGBP as its deliverable — not a chatbot summary, but a downloadable specification package with equations, geometry parameters, materials recommendations, test protocols, and a provenance graph.


✨ Features

Core Pipeline

  • 📄 Paper Upload & Analysis — Upload up to 10 biological research PDFs. Gemini 3 Pro extracts structured evidence with citations, page references, and confidence scores.
  • 🔬 Mechanism Classification — Evidence is classified against a 12-family mechanism ontology (M01–M12: Optical Extraction, Fracture Deflection, Impact Distribution, Dry Adhesion, Drag Reduction, Superhydrophobic, Structural Color, Thermal Regulation, Self-Healing, Acoustic Dampening, Puncture Resistance, Hydrodynamic Lift).
  • ⚡ Physics Translation — Biological terms are mapped to physics variables with SI units, governing equations, dimensionless groups, and failure modes.
  • 🔗 Domain Transfer — Mechanisms are matched to application domains with feasibility scores.
  • 🧬 Cross-Species Synthesis — Finds synergies across organisms, calculates weighted contributions, resolves conflicts between mechanisms.
  • 📐 Unified Design Generation — Produces ONE parametric design with geometry, materials, manufacturing methods, and performance hypotheses with falsification criteria.
  • 🔴 Red-Team Critique with HITL Gating — Critic agent reviews the design with BLOCKING / WARNING / SUGGESTION severity levels. BLOCKING issues halt the pipeline until a human approves. Email notifications via SendGrid. Max 3 retries.
  • ✅ Verification Planning — Generates test protocols (minimal + high-fidelity), baselines (non-biomimetic, naive biomimetic, commercial), acceptance criteria, and measurement methods.
  • 📊 8-Layer Provenance Tracking — Sources → Evidence → Mechanisms → Physics → Transfer → Synthesis → Design → Verification. No orphaned decisions.
  • 📦 EGBP Download — Downloadable ZIP containing all artifacts, the provenance graph, and verification protocols. Signed URLs via Cloud Storage.

Additional Features

  • 🎨 3D Visualization — Self-correcting renderer generates Three.js BufferGeometry code using a SequentialAgent + LoopAgent pattern (generate → critique → retry up to 3× → fallback to template).
  • 📚 Mechanism Library — Browse all 12 families with organisms, equations, successful real-world transfers (e.g., Sharklet Technologies, Eastgate Centre, Volvo safety systems).
  • 📋 Analysis Dashboard — View past analyses, search/filter, re-open completed results.
  • 💚 Service Health Monitor — Real-time status of all backend services with adaptive polling (2 min healthy / 30s unhealthy).

🏗️ Architecture

System Overview

┌─────────────────────────────────────────────────────────────────┐
│                     React Frontend                              │
│            (Vite + TypeScript + Tailwind + Three.js)            │
└────────────────────────────┬────────────────────────────────────┘
                             │
                    A2A Protocol (JSON-RPC 2.0)
                             │
         ┌───────────┬───────┴───────┬───────────┬───────────┐
         ▼           ▼               ▼           ▼           ▼
┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│  Ingestion  │ │  Analysis   │ │  Synthesis  │ │   Review    │ │  Packaging  │
│  Service    │ │  Service    │ │  Service    │ │  Service    │ │  Service    │
│   :8001     │ │   :8002     │ │   :8003     │ │   :8004     │ │   :8005     │
│             │ │             │ │             │ │             │ │             │
│ Evidence    │ │ Mech Scout  │ │ Synthesis   │ │ Critic      │ │ Provenance  │
│ Extractor   │ │ Physics Tr. │ │ Agent       │ │ Agent       │ │ Tracker     │
│ (Pro)       │ │ Transfer Ag.│ │ Design Syn. │ │ Verif. Plan.│ │ Artefact    │
│             │ │ (Flash)     │ │ (Flash)     │ │ (Flash)     │ │ Packager    │
│ 5 Tools     │ │ 12+ Tools   │ │ 8 Tools     │ │ 8 Tools     │ │ 6 Tools     │
└──────┬──────┘ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘
       │               │               │               │               │
       └───────────────┴───────────────┴───────┬───────┴───────────────┘
                                               │
                           ┌───────────────────┴───────────────────┐
                           │         Firebase (Firestore)          │
                           │  analyses/{id}/evidence               │
                           │  analyses/{id}/mechanisms             │
                           │  analyses/{id}/physics                │
                           │  analyses/{id}/transfer               │
                           │  analyses/{id}/synthesis              │
                           │  analyses/{id}/designs                │
                           │  analyses/{id}/critiques              │
                           │  analyses/{id}/verification           │
                           │  analyses/{id}/provenance             │
                           │  analyses/{id}/egbp                   │
                           └───────────────────┬───────────────────┘
                                               │
                                    ┌──────────┴──────────┐
                                    │   Cloud Storage     │
                                    │   📄 PDFs  📦 ZIPs  │
                                    │   📋 EGBPs          │
                                    └─────────────────────┘


Renderer Service (:8006) — SequentialAgent + LoopAgent
┌────────────────────────────────────────────────┐
│  Template Fetcher (Flash)                      │
│       ▼                                        │
│  ┌─ Refinement Loop (max 3) ──────────────┐    │
│  │  Code Generator (Pro) → Code Critic (Flash) │  
│  │       ▲                    │             │  │
│  │       └── Retry if !approved ──┘         │  │
│  └──────────────────────────────────────────┘  │
│       ▼                                        │
│  Finalizer (Flash) → approved code OR fallback │
└────────────────────────────────────────────────┘

Agent Pipeline Detail

Service Port Agents Model Tools Role
Ingestion 8001 Evidence Extractor Gemini 3 Pro 5 PDF text/image extraction, paper metadata correction, evidence persistence
Analysis 8002 Mechanism Scout, Physics Translator, Transfer Agent Gemini 3 Flash 12+ Ontology classification, equation lookup, SI variable mapping, domain matching
Synthesis 8003 Synthesis Agent, Design Synthesizer Gemini 3 Flash 8 Cross-species synergy analysis, geometry generation, unified design creation
Review 8004 Critic Agent, Verification Planner Gemini 3 Flash 8 Validation rules, severity-graded critique, HITL gating, test protocol generation
Packaging 8005 Provenance Tracker, Artefact Packager Gemini 3 Flash 6 8-layer provenance graph, EGBP generation, ZIP packaging with signed URLs
Renderer 8006 Template Fetcher, Code Generator, Code Critic, Finalizer Pro + Flash 3 Self-correcting Three.js geometry generation using SequentialAgent + LoopAgent

Mechanism Ontology

The platform classifies biological mechanisms against a structured ontology of 12 families, each containing:

ID Family Example Organisms Example Equation
M01 Optical Extraction Morpho butterfly, Peacock Bragg's Law: nλ = 2d·sin(θ)
M02 Fracture Deflection Nacre (abalone), Bone Griffith criterion: σ_f = √(2Eγ/πa)
M03 Impact Distribution Woodpecker, Mantis shrimp Hertzian contact: F = (4/3)E*√R·δ^(3/2)
M04 Dry Adhesion Gecko, Tree frog van der Waals: F = -A/(6d²) per unit area
M05 Drag Reduction Shark skin, Lotus leaf Navier-Stokes (riblet modification)
M06 Superhydrophobic Lotus, Namib beetle Young-Dupré: cos(θ*) = r·cos(θ)
M07 Structural Color Morpho, Jewel beetle Thin film interference: 2nt·cos(θ) = mλ
M08 Thermal Regulation Termite mound, Elephant, Camel Stack effect: ΔP = ρ·g·h·(T_i-T_o)/T_o
M09 Self-Healing Sea cucumber, Bone Arrhenius: k = A·exp(-Ea/RT)
M10 Acoustic Dampening Owl feather, Moth wing Helmholtz: f = (c/2π)·√(A/V·L)
M11 Puncture Resistance Armadillo, Pangolin Yield criterion: σ_vm = √(σ²+3τ²)
M12 Hydrodynamic Lift Humpback whale, Boxfish Lift: L = ½ρv²·C_L·A

Each family also includes physics variables with SI units and typical ranges, dimensionless groups, failure modes, application domains, materials, manufacturing methods, test protocols, and documented successful transfers.

Data Model

25+ Pydantic models define the Firestore schema:

AnalysisRecord           — Top-level analysis with problem statement, status, timestamps
├── EvidenceUnit         — Claim, citation, page ref, confidence, quantitative data
├── MechanismHypothesis  — Classification, organism, structure, matched family
├── PhysicsModel         — Equations, variables, SI units, dimensionless groups
├── TransferMap          — Source mechanism → target domain mapping with feasibility
├── SynthesisResult      — Cross-species synergies, weighted contributions
├── UnifiedDesign        — Geometry params, materials, manufacturing, performance hypotheses
├── Critique             — Severity (BLOCKING/WARNING/SUGGESTION), category, recommendations
├── VerificationPlan     — Metrics, baselines, test protocols, acceptance criteria
├── ProvenanceGraph      — 8-layer directed graph with edge types and timestamps
└── EGBP                 — Engineering-Grade Biomimicry Packet (final deliverable)

🚀 Quick Start

Prerequisites

  • Node.js 18+
  • Python 3.11+
  • Google Cloud account with Gemini 3 API access
  • Firebase project (Firestore + Cloud Storage + Auth)

1. Clone & Install

git clone https://github.com/yourusername/alpha-mimic.git
cd alpha-mimic

# Frontend
npm install

# Backend
cd backend
pip install -r requirements.txt

2. Configure Environment

# Frontend (.env.local)
VITE_FIREBASE_API_KEY=your_api_key
VITE_FIREBASE_APP_ID=your_app_id
VITE_FIREBASE_PROJECT_ID=your_project_id
VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id

# Ingestion service
VITE_INGESTION_SERVICE_URL=http://localhost:8001

# Analysis service
VITE_ANALYSIS_SERVICE_URL=http://localhost:8002

# Synthesis service
VITE_SYNTHESIS_SERVICE_URL=http://localhost:8003

# Review service
VITE_REVIEW_SERVICE_URL=http://localhost:8004

# Packaging service
VITE_PACKAGING_SERVICE_URL=http://localhost:8005

# Renderer service
VITE_RENDERER_SERVICE_URL=http://localhost:8006

# Backend (.env — shared across services)
GOOGLE_CLOUD_PROJECT=your_project_id
GEMINI_API_KEY=your_gemini_key
APP_BASE_URL=http://localhost:3000/

3. Start Services

# Terminal 1: Frontend
npm run dev

# Terminal 2-7: Backend services (each in its own terminal)
cd backend/ingestion-service && python main.py   # Port 8001
cd backend/analysis-service && python main.py    # Port 8002
cd backend/synthesis-service && python main.py   # Port 8003
cd backend/review-service && python main.py      # Port 8004
cd backend/packaging-service && python main.py   # Port 8005
cd backend/renderer-service && python main.py    # Port 8006

4. Open App

Navigate to http://localhost:3000/


🎯 Usage

1. Upload Papers

Upload 1–10 biological research PDFs. The Paper Library stores them in Cloud Storage and displays AI-extracted metadata (authors, year, title — corrected from PDF metadata which is often wrong).

2. Define Your Problem

Enter an engineering challenge and target domain:

  • Problem: "Design a passive cooling system for data center server racks that reduces energy consumption by 30%"
  • Domain: "Data Center Infrastructure"

3. Run the Pipeline

Click Start Analysis. Watch 10 agents activate in sequence — Evidence Extractor → Mechanism Scout → Physics Translator → Transfer Agent → Synthesis Agent → Design Synthesizer → Critic Agent → Verification Planner → Provenance Tracker → Artefact Packager.

4. Explore Results

Navigate through 8 result tabs: Evidence, Mechanisms, Physics, Synthesis, Design, Critic, Verification, Provenance. View the generated 3D model. Download the EGBP package.

Example Output

For a data center cooling analysis using termite mound, elephant ear, and camel thermoregulation papers:

{
  "design_name": "Bio-Inspired Passive Cooling Tower",
  "primary_mechanism": "M08 - Thermal Regulation",
  "contributing_organisms": {
    "Odontotermes obesus": { "contribution": 0.45, "role": "Stack-effect ventilation architecture" },
    "Elephas maximus": { "contribution": 0.30, "role": "High surface-area convective cooling" },
    "Camelus dromedarius": { "contribution": 0.25, "role": "Thermal mass + selective insulation" }
  },
  "geometry_parameters": {
    "channel_diameter": { "value": 18, "unit": "mm", "source": "Termite tunnel cross-section scaling" },
    "surface_roughness": { "value": 0.4, "unit": "mm", "source": "Elephant skin texture mapping" },
    "porosity": { "value": 0.40, "source": "Mound wall porosity measurement" },
    "height_to_diameter_ratio": { "value": 3.2, "source": "Stack effect optimization" }
  },
  "governing_equation": "ΔP = ρ·g·h·(T_internal - T_external) / T_external",
  "predicted_efficiency_gain": "30-40% reduction in active cooling energy",
  "provenance_layers": 8,
  "evidence_units": 15,
  "verification_protocols": 2
}

🛠️ Tech Stack

Layer Technology Usage
AI Models Gemini 3 Pro Preview Evidence extraction (complex multimodal reasoning)
Gemini 3 Flash Preview Downstream agents (fast, cost-efficient)
Agent Framework Google ADK Agent, FunctionTool, SequentialAgent, LoopAgent, LlmAgent
Agent Protocol A2A (Agent-to-Agent) JSON-RPC 2.0 inter-service messaging, agent cards, RemoteA2aAgent
Backend Python, FastAPI, Starlette Service endpoints, A2A hosting via to_a2a()
Frontend React 18, TypeScript, Vite, Tailwind CSS SPA with Firebase real-time listeners
3D Rendering Three.js WebGL BufferGeometry viewer with orbit controls
Database Firebase Firestore 10+ subcollections per analysis, real-time listeners
Storage Firebase Cloud Storage PDF uploads, EGBP ZIPs, signed download URLs
Auth Firebase Authentication Google Sign-In
PDF Processing PyMuPDF (fitz) Text extraction, image extraction from research papers
Email SendGrid HITL review notifications
Deployment Google Cloud Run 6 containerized services

📁 Project Structure

alpha-mimic/
├── src/                          # React frontend
│   ├── components/               # UI components (16+ components)
│   │   ├── AnalysisDashboard.tsx # Past analyses list, search, filter
│   │   ├── AnalysisWorkspace.tsx # Main workspace with result tabs
│   │   ├── PipelineProgress.tsx  # Agent status visualization
│   │   ├── ResultsTabs.tsx       # Evidence/Mechanisms/Physics/etc.
│   │   ├── ThreeViewer.tsx       # 3D geometry renderer
│   │   ├── MechanismLibrary.tsx  # Browse 12 mechanism families
│   │   └── ServiceHealth.tsx     # Real-time health monitor
│   ├── services/
│   │   └── api.ts                # A2A JSON-RPC client for all 6 services
│   ├── hooks/
│   │   └── usePipeline.ts        # Pipeline orchestration (584 lines)
│   └── types/                    # TypeScript definitions
├── backend/
│   ├── ingestion-service/        # Evidence Extractor agent + tools
│   │   ├── agents.py             # ADK Agent (Gemini 3 Pro)
│   │   ├── tools.py              # PDF extraction, evidence saving
│   │   └── main.py               # FastAPI + A2A via to_a2a()
│   ├── analysis-service/         # Mechanism/Physics/Transfer agents
│   │   ├── agents.py             # ADK Agent (Gemini 3 Flash, 3-stage prompt)
│   │   ├── tools.py              # Ontology lookup, Firestore CRUD (791 lines)
│   │   └── main.py
│   ├── synthesis-service/        # Synthesis + Design agents
│   │   ├── agents.py
│   │   ├── tools.py              # Synergy analysis, geometry generation
│   │   └── main.py
│   ├── review-service/           # Critic + Verification agents
│   │   ├── agents.py
│   │   ├── tools.py              # Validation rules, HITL tokens, email (811 lines)
│   │   └── main.py
│   ├── packaging-service/        # Provenance + Packager agents
│   │   ├── agents.py
│   │   ├── tools.py              # Graph construction, EGBP gen, ZIP (1478 lines)
│   │   └── main.py
│   ├── renderer-service/         # 4 sub-agents (SequentialAgent + LoopAgent)
│   │   ├── agents.py             # Template Fetcher, Generator, Critic, Finalizer
│   │   ├── tools.py              # Geometry templates, mechanism-to-shape mapping
│   │   └── main.py
│   └── shared/                   # Shared modules
│       ├── firebase_config.py    # Firestore + Storage clients
│       ├── ontology.py           # 12-family mechanism taxonomy (~1000+ lines)
│       ├── models.py             # 25+ Pydantic models (598 lines)
│       ├── a2a_client.py         # RemoteA2aAgent, JSON-RPC 2.0 client
│       └── email_templates.py    # HITL review + completion email templates
└── public/                       # Static assets

🔑 Key ADK Patterns Used

Agent with FunctionTools — Every service uses Agent(model=..., tools=[FunctionTool(...)]) with typed Python functions that wrap Firestore CRUD, ontology lookups, and Cloud Storage operations.

agent = Agent(
    name="evidence_extractor",
    model="gemini-3-pro-preview",
    instruction=EVIDENCE_EXTRACTOR_INSTRUCTION,
    tools=[
        FunctionTool(initialize_analysis_tool),
        FunctionTool(extract_text_from_pdf),
        FunctionTool(extract_images_from_pdf),
        FunctionTool(get_papers_from_library),
        FunctionTool(save_extracted_evidence),
    ],
)

SequentialAgent + LoopAgent — The renderer service chains agents in sequence with a self-correcting inner loop:

renderer = SequentialAgent(
    name="renderer_service",
    sub_agents=[template_fetcher, refinement_loop, finalizer],
)

refinement_loop = LoopAgent(
    name="refinement_loop",
    sub_agents=[code_generator, code_critic],
    max_iterations=3,
)

A2A Protocol — Each service exposes /.well-known/agent-card.json and accepts JSON-RPC 2.0 messages. Services discover each other via environment variables. 300-second timeout for long-running LLM calls.


📄 License

Apache 2.0 License — see LICENSE for details.


⬆ Back to Top

10 agents, 5 services, 12 mechanism families, 8 layers of provenance — but at its core, Alpha Mimic does one thing: turns what nature already solved into something engineers can actually build.

About

Multi-agent system that translates biological research into engineering specifications. Upload papers on organisms like termites, elephants, and camels — AI agents extract mechanisms, map physics, and synthesize unified designs. Built for the Gemini 3 Hackathon. Turning nature's blueprints into engineering reality.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors