01 // AI · DevOps · Multi-Agent Systems Oct 2025 – Feb 2026

Project Aegis

An agentic threat-intelligence prototype that combines rolling market anomaly signals with schema-constrained Gemini workflows, serverless API-key isolation, and model fallback behavior.

67Repository Commits
2Model Fallbacks
JSONStructured Outputs
4Swarm Agents
Overview

Aegis explores how a multi-agent interface can combine quantitative market anomalies with LLM-assisted investigation workflows for misinformation and reputation-risk review.

The current system is a research prototype, not a validated fact-checking authority. Its most defensible engineering contributions are the workflow orchestration, strict response contract, protected API gateway, fallback handling, and observable agent state. Licensed retrieval and labeled evaluation remain future work.

Tech Stack

Serverless Node Gateway (API Proxy)
🐳Docker / Render
🧠Gemini 2.5 Flash / 2.0 Fallback
🔗Supabase (PostgreSQL)
🐍Python / FastAPI
📈Vanilla JS / CSS Custom Props
⚙️ System Architecture & MLOps

How the System is Engineered

📥
Data Ingestion
Client Ticker Input / Live Feeds
API Gateway
Serverless Proxy · CORS · Rate Limiter
📈
Z-Score Engine
Rolling Std Dev · Fast Fallbacks
🧠
Gemini Swarm
Key Rotation · Semantic Inference
⚖️
Verdict Sink
Validated JSON · UI Hydration
Key RotationEnvironment-backed fallback keys
Model Cascading2.5-Flash → 2.0-Flash fallback
Containerized BackendsDockerized FastAPI on Render
Cache LayerPlanned response-cache boundary
Interaction Flow

Data Flow & Inference

01

Quantitative Correlation

The system fetches 5-day historical closing prices and volume via a proxy-routed Yahoo Finance request. It immediately calculates rolling Z-scores to distinguish organic market drift from coordinated algorithmic anomalies.

Z = (X - μ) / σ → Targets |Z| > 2.5
02

Context-Aware Prompts

The statistical state (ticker, Z-score, fast drop percentage) is injected into heavily constrained system prompts requiring strict roleplay and enforcing strict JSON schema bounds.

Injected Payload: { "ticker": "TATAMOTORS", "deviation": "-3.4σ", ... }
03

Serverless Inference Gateway

To avoid leaking API keys into the DOM, the frontend pushes the generated payload to a serverless Node gateway. The gateway selects an API key from a rotated array and dispatches the request to the Gemini v1beta endpoint.

Gateway Request → Round-Robin Key selection
04

Output Validation & Rendering

The AI returns a strict JSON array representing threats. The frontend strips Markdown fencing, validates the JSON shape via try-catch parsing, and dynamically renders the DOM.

[{ "target": "CEO", "severity": 8, "sentiment": -80 }]
DevOps & MLOps Problems Solved

Challenges & Solutions

Problem

Strict LLM Rate Limits (HTTP 429)

Google's free-tier Gemini API kept buckling under my Agent Swarms due to a strict 15 Requests Per Minute (RPM) limit.

Solution

Automated Key Rotation & Fallbacks

Engineered a serverless gateway that injects environment-backed API keys. If one route returns a rate-limit error, the workflow can try another key or model and surface a controlled failure when every route is exhausted.

Problem

CORS Errors & External API Blocks

Legacy APIs (like Yahoo Finance) actively block direct frontend fetch requests via strict CORS configurations, breaking the data pipeline.

Solution

Multi-Tier Proxy Routing

Built an array of proxy fallbacks (`AllOrigins`, `CORSProxy.io`) and specifically defined an `OPTIONS` preflight handler within the gateway to ensure secure browser invocations.

Problem

Backend Cold Starts on PaaS

Render's free tier spins down the backend after 15 minutes of inactivity, causing 50–90 second delays for the first user query.

Solution

Cron-based Heartbeats & Client Feedback

Implemented a `/api/claims` ping that acts as a live heartbeat to keep the container warm. The UI displays an elegant "Waking up cluster" banner if the delay exceeds 3 seconds, preserving user trust.