Skip to content
tara-kasPublic

About

autonomous AI surgical monitoring and clinical workflow agent

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

34 Commits

Folders and files

Repository files navigation

Aegis β€” Autonomous Surgical AI Agent

An autonomous AI agent that monitors robotic surgery, generates clinical documentation, manages its own infrastructure costs, and enforces EU regulatory compliance β€” without human intervention.

Quick Start β€’ Architecture β€’ Demo β€’ Testing β€’ Challenges

Build Tests TypeScript License: MIT


πŸ’‘ Why Aegis?

Surgeons in the operating theatre face an impossible multitasking burden: perform complex robotic procedures while manually documenting every clinical observation, managing device telemetry, and remaining compliant with EU AI Act regulations. Meanwhile, hospital legacy systems (SAP IS-H, i.s.h.med) are approaching end-of-life by 2030–2035, creating an urgent need for modern, interoperable data infrastructure.

Aegis solves this. It acts as an autonomous digital co-pilot that:

  1. Eliminates manual documentation β€” Listens to the surgeon and auto-generates structured FHIR R4 clinical notes
  2. Monitors the robot in real-time β€” Detects kinematic anomalies before they become dangerous
  3. Pays for its own compute β€” Autonomously leases GPU resources and settles invoices via Stripe and Solana
  4. Enforces compliance by design β€” Continuously audits against EU AI Act, DORA, and MDR requirements

Zero real patient data is used anywhere in this project. All clinical data is synthetically generated.


🎯 What It Does

Capability How Technology
Listens to the surgeon Hallucination-free medical speech-to-text β†’ auto-generated FHIR notes ElevenLabs Scribe v2
Sees pre-op imaging Zero-shot anatomical classification on DICOM scans Google HAI-DEF MedSigLIP
Monitors the robotic arm 6-axis kinematic telemetry at 10 FPS, anomaly scoring Webots simulation
Reasons clinically 685B-parameter inference with ultra-low latency DeepSeek-R1 on Crusoe Cloud
Responds to failures Autonomous triage, alerting, and remediation incident.io agents
Bills per outcome Outcome-based billing, not per token Paid.ai
Pays for itself Macro-transactions + privacy-preserving micropayments Stripe + Solana Token-2022

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        AEGIS AGENT                               β”‚
β”‚                                                                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚  Voice       β”‚  β”‚  Vision      β”‚  β”‚  Robotic Telemetry      β”‚ β”‚
β”‚  β”‚  ElevenLabs  β”‚  β”‚  HAI-DEF     β”‚  β”‚  Webots 6-axis sim      β”‚ β”‚
β”‚  β”‚  Scribe v2   β”‚  β”‚  MedSigLIP   β”‚  β”‚  Anomaly detection      β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚         β”‚                 β”‚                      β”‚               β”‚
β”‚         β–Ό                 β–Ό                      β–Ό               β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚              Clinical Reasoning Engine                      β”‚ β”‚
β”‚  β”‚         DeepSeek-R1-0528 on Crusoe Cloud                    β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                         β”‚                                        β”‚
β”‚         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                     β”‚
β”‚         β–Ό               β–Ό                  β–Ό                     β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β”‚
β”‚  β”‚ FHIR R4    β”‚  β”‚ Financial  β”‚  β”‚ Compliance       β”‚           β”‚
β”‚  β”‚ Supabase   β”‚  β”‚ Stripe +   β”‚  β”‚ EU AI Act, DORA  β”‚           β”‚
β”‚  β”‚ PostgreSQL β”‚  β”‚ Solana     β”‚  β”‚ incident.io      β”‚           β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Technology Stack

Layer Technology
Frontend React 18 + TypeScript 5.8, Tailwind CSS, React Router
Backend Supabase (PostgreSQL + RLS + Auth + Edge Functions)
Voice ElevenLabs Scribe v2 (medical-grade speech-to-text)
Vision Google HAI-DEF MedSigLIP (zero-shot medical imaging)
Robotics Webots (Da Vinci–style 6-axis surgical arm simulation)
Inference Crusoe Cloud β€” DeepSeek-R1, DeepSeek-V3.1, Kimi-K2, Llama-3.3-70B
Clinical Data HL7 FHIR R4 (Patient, Encounter, Observation, Device, Procedure)
Reliability incident.io (SLA Guardian + Incident Commander agents)
Payments Stripe Checkout Sessions Β· Solana Token-2022 Β· Paid.ai
Governance Red Hat OpenShift AI (EU AI Act compliance)

πŸ“‚ Project Structure

aegis/
β”œβ”€β”€ aegis-core/                           # 🧠 Python β€” Core AI & Robotics
β”‚   β”œβ”€β”€ main.py                           #    Agent entrypoint
β”‚   β”œβ”€β”€ config.py                         #    Environment configuration
β”‚   β”œβ”€β”€ reasoning/                        #    LLM orchestration (Crusoe Cloud)
β”‚   β”‚   └── crusoe_client.py              #    DeepSeek-R1 inference client
β”‚   β”œβ”€β”€ robot/                            #    Webots surgical arm controller
β”‚   β”‚   β”œβ”€β”€ surgical_arm_controller.py    #    6-axis kinematic control + anomaly detection
β”‚   β”‚   β”œβ”€β”€ protos/                       #    Webots proto files (PSM robot)
β”‚   β”‚   └── worlds/                       #    Simulation environments
β”‚   β”œβ”€β”€ vision/                           #    Medical imaging pipeline
β”‚   β”‚   └── dicom_analyser.py             #    HAI-DEF MedSigLIP DICOM analysis
β”‚   └── tests/                            #    Python test suite
β”‚       β”œβ”€β”€ inject_anomaly.py             #    Anomaly injection for testing
β”‚       └── mock_data.py                  #    Synthetic clinical data
β”‚
β”œβ”€β”€ src/                                  # βš›οΈ  TypeScript β€” Frontend Dashboard
β”‚   β”œβ”€β”€ api/                              #    API clients (FHIR, Stripe, Solana, etc.)
β”‚   β”œβ”€β”€ components/                       #    React components
β”‚   β”‚   β”œβ”€β”€ clinical/                     #    Vital signs, telemetry, alerts
β”‚   β”‚   β”œβ”€β”€ financial/                    #    Margins, transactions, charts
β”‚   β”‚   β”œβ”€β”€ compliance/                   #    EU AI Act checklist, audit trail
β”‚   β”‚   └── shared/                       #    Layout, sidebar, theme
β”‚   β”œβ”€β”€ hooks/                            #    Custom React hooks
β”‚   β”œβ”€β”€ types/                            #    TypeScript interfaces (FHIR, telemetry)
β”‚   β”œβ”€β”€ mock/                             #    Synthea-style synthetic FHIR data
β”‚   └── utils/                            #    Logging, metrics, validation
β”‚
β”œβ”€β”€ docs/                                 # πŸ“š Documentation
β”‚   β”œβ”€β”€ DEPLOYMENT.md                     #    Production deployment guide
β”‚   └── HACKATHON_DEMO.md                 #    5-minute demo script for judges
β”‚
β”œβ”€β”€ supabase/                             #    Database migrations & config
└── scripts/                              #    Dev tooling (data mode, wallet setup)

Judges: The core AI logic lives in aegis-core/. The React dashboard in src/ visualises everything in real time.


πŸš€ Quick Start

Prerequisites

  • Node.js 18+ (20+ recommended)
  • Python 3.11+ (for aegis-core/)
  • npm 8+

Installation

# Clone the repository
git clone https://github.com/<your-org>/aegis.git
cd aegis

# ── Frontend ──
npm install

# ── Backend (Python) ──
cd aegis-core
pip install -r requirements.txt
cd ..

# ── Environment ──
cp .env.example .env
# Edit .env with your API keys (see docs/DEPLOYMENT.md for details)

Run

# Start the dashboard
npm run dev
# β†’ http://localhost:5173

# Run all tests
npm test

# Start the Python agent (requires Webots)
cd aegis-core && python main.py

Available Scripts

Command Purpose
npm run dev Start Vite dev server (port 5173)
npm run build Production build to dist/
npm test Run all 86 tests once
npm run test:watch Watch mode
npm run test:coverage Generate coverage report
npm run type-check TypeScript type checking
npm run dev:mock Dev server with mock data only
npm run dev:live Dev server with live API connections

🎬 Demo

5-minute walkthrough: See docs/HACKATHON_DEMO.md for the full demo script.

Key Screens

  1. Clinical Dashboard β€” Live FHIR patient data, 6-axis robotic telemetry, vital signs with threshold alerts
  2. Financial Dashboard β€” Paid.ai outcome margins, Solana confidential transactions, Stripe checkout status
  3. Compliance Panel β€” EU AI Act checklist (12 items), incident.io alert log, audit trail

πŸ§ͺ Testing

86/86 tests passing Β· Zero TypeScript errors Β· Production build verified

npm test
Suite Tests Coverage
FHIR R4 validation 21 Resource schemas, search params, error handling
Stripe Checkout Sessions 23 $1,000 limit, credential protection, session lifecycle
Solana Token-2022 42 ZK proofs, ElGamal auditor keys, HIPAA privacy (7 critical)
Mock data integrity 26+ Synthea-style synthetic FHIR resources
Components β€” Render tests for all dashboard panels
Hooks & utils β€” WebSocket reconnection, FHIR validation, metrics

πŸ”’ Security & Compliance

Payment Safeguards

Failsafe Description Verified By
Credential Protection Payment credentials (card numbers, CVVs) are NEVER included in API payloads Automated scanning in test suite
Purchase Limit Hard-coded $1,000 maximum for autonomous purchases 23 Stripe tests
ZK Privacy Solana transaction amounts encrypted via zero-knowledge proofs 7 critical privacy tests

Regulatory Compliance

  • EU AI Act β€” 12 compliance items: transparency (Art. 52), human oversight (Annex IV), risk management (Art. 9), data governance (Art. 10)
  • DORA β€” Cybersecurity posture, incident reporting, third-party risk management
  • MDR β€” Model governance, version control, bias monitoring
  • HIPAA Β§164.312(a)(2)(iv) β€” ElGamal auditor keys ensure only authorised parties (hospital finance, FDA) can decrypt transaction amounts
  • GDPR β€” Zero real PHI; all patient data is synthetically generated

πŸ† Hackathon Challenges

Aegis targets the Agentic AI Track and 11 sponsor challenges at HackEurope 2026:

# Challenge Aegis Implementation
1 Agentic AI Track (Paid.ai) Outcome-based billing with real-time margin tracking
2 Best AI-Powered Healthcare (Avelios Medical) FHIR R4 data layer replacing legacy SAP IS-H systems
3 Best Use of Gemini (Google DeepMind) HAI-DEF MedSigLIP for zero-shot medical imaging
4 Best Autonomous Consulting Agent (BearingPoint) Embedded compliance auditor agent
5 Best Adaptable Agent (incident.io) Adaptive reliability agents with auto-remediation
6 Best Stripe Integration Autonomous Checkout Sessions with security failsafes
7 Best 'Built on Solana' (Superteam IE) Token-2022 confidential transfers for transaction privacy
8 Best Use of Paid (Paid.ai) Telemetry trace calls for outcome-based billing
9 Best Use of Crusoe Inference API DeepSeek-R1 clinical reasoning on Crusoe Cloud
10 Best Use of ElevenLabs Scribe v2 hallucination-free medical transcription
11 Best Use of Miro AI & Lovable Architectural context β†’ AI-generated React frontend
12 Best Use of OpenShift AI (Red Hat) Model registry and governance for EU compliance

πŸ“š Documentation

Document Description
docs/HACKATHON_DEMO.md 5-minute demo script for judges
docs/DEPLOYMENT.md Production deployment & environment setup
docs/ENV_STRUCTURE.md Environment variable reference
.env.example Template with all required keys

🀝 Contributing

See CONTRIBUTING.md for guidelines. We welcome issues and pull requests.


πŸ“„ Licence

This project is licensed under the MIT Licence.


Built for HackEurope 2026

About

autonomous AI surgical monitoring and clinical workflow agent

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages