Inspiration

Treasury teams at mid-to-large corporations face a daily challenge: monitoring dozens of financial instruments across crypto, forex, and commodities while managing corporate currency exposure. Manual processes are slow, error-prone, and cannot scale. We asked: what if 10 specialized AI agents could collaborate in real-time to deliver institutional-grade risk analysis in under 10 seconds?

What it does

Airia Sentinel is a multi-agent orchestration platform for treasury risk management. It runs a 5-phase pipeline of 10 AI agents that work together to:

  1. Scan markets — Real-time data from 10 financial instruments (BTC, ETH, SOL, EUR/USD, XAU/USD, etc.)
  2. Detect anomalies — Z-score analysis, volume spikes, divergence detection, contagion alerts
  3. Score sentiment — Multi-factor sentiment analysis with AI classification
  4. Aggregate risk — Weighted fusion of all signals with cascade detection
  5. Build consensus — 3-way AI consensus (LM Studio M1 + M2 + Ollama + Airia cloud)
  6. Size positions — Kelly Criterion + Risk Parity optimal allocation
  7. Backtest strategies — Monte Carlo simulation (50 trajectories x 30 days, Sharpe/MaxDD/Calmar)
  8. Check compliance — Automated regulatory compliance via Airia
  9. Generate reports — 6-section executive report with Airia narrative enrichment
  10. Dispatch alerts — 4-severity alert system (INFO/WARNING/CRITICAL/EMERGENCY)

A real-time web dashboard displays the full pipeline: agent status, market signals, risk gauges, consensus strategies, cluster health, and audit trail. Human-in-the-Loop (HITL) approval gates ensure no strategy executes without human validation.

How we built it

Architecture

Phase 1 (parallel)    Phase 2        Phase 3 (parallel)   Phase 4        Phase 5 (parallel)
┌────────────┐       ┌──────────┐   ┌──────────────┐     ┌──────────┐   ┌────────────┐
│ Market     │──┐    │ Risk     │──►│ Consensus    │     │ Strategy │──►│ Compliance │
│ Intelligence│  │──►│Aggregator│   │ Strategy     │     │Backtester│   │ Report     │
│ Corporate  │──┘    │          │──►│ Position     │──►  │          │   │ Alert      │
│ Anomaly    │       └──────────┘   │ Sizer        │     └──────────┘   └────────────┘
│ Sentiment  │                      └──────────────┘
└────────────┘

Tech Stack

  • Airia SDK — Cloud AI pipelines for market analysis, compliance, consensus, backtesting, and report synthesis (10 bilingual prompts EN/FR)
  • LM Studio cluster — 3 nodes (M1: qwen3-30b on 6 GPUs, M2: deepseek-coder on 3 GPUs, M3: mistral-7b)
  • Ollama — Local lightweight inference (qwen3:1.7b) for fast sentiment and routing
  • Python asyncio — Parallel agent execution with asyncio.gather()
  • FastAPI + WebSocket — Real-time dashboard server with live pipeline events
  • SQLite — Full audit trail with WAL mode for concurrent access
  • NumPy — Monte Carlo GBM simulation, Kelly Criterion, Risk Parity calculations
  • Rich — Terminal UI with colored tables, panels, and progress indicators
  • CCXT — Multi-exchange market data (MEXC Futures)

Key Design Decisions

  • Hybrid AI: Every agent tries Airia cloud first, then falls back to local LM Studio/Ollama — ensuring the platform works even offline
  • Bilingual prompts: All 10 Airia prompts have FR and EN versions with a single PROMPT_LANG toggle
  • Pipeline Engine: Supports 3 orchestration patterns (Domino sequential, Vectorial parallel, Matrix grid scoring)

Challenges we ran into

  • LM Studio auth: API key headers were missing on cluster health checks and query calls — caused silent failures until we traced it with audit logs
  • Monte Carlo reproducibility: Needed deterministic seeds per strategy (hash(run_id + strategy_name)) while keeping simulations statistically meaningful
  • 10-agent coordination: Passing data between 5 pipeline phases required careful schema design — we standardized on StepResult dataclass with data dict, confidence, latency_ms
  • Dashboard without React: Built a 1800-line single-file HTML dashboard with vanilla JS, SVG gauges, and CSS animations to avoid build tooling complexity

Accomplishments that we're proud of

  • 10 agents, 5 phases, under 10 seconds — Full pipeline from market scan to executive report
  • Zero-dependency dashboard — Single HTML file with live WebSocket updates, no npm/build required
  • Monte Carlo backtester — 50 GBM simulations with Sharpe, MaxDD, Calmar metrics and letter grades
  • True multi-model consensus — 4 different AI providers vote on strategy with weighted scoring
  • Human-in-the-Loop — Real approve/reject buttons that gate strategy execution

What we learned

  • Airia SDK is remarkably flexible — the execute_pipeline() and execute_temporary_assistant() APIs let us integrate cloud AI at every pipeline stage while keeping local fallbacks
  • Multi-agent systems need strong contracts between agents — our StepResult pattern made it trivial to add new agents
  • Real-time dashboards massively improve the "Design" dimension — seeing agents complete in sequence is more convincing than any log file

What's next for Airia Sentinel

  • Live trading execution via MEXC Futures API (currently dry-run only)
  • PDF report generation with wkhtmltopdf for institutional delivery
  • Slack/Teams integration for alert dispatch
  • Fine-tuned local models — QLoRA training on our own trading signal dataset
  • Multi-tenant mode — Multiple treasury teams with isolated pipelines

Built With

  • airia-sdk
  • asyncio
  • ccxt
  • fastapi
  • httpx
  • lm-studio
  • numpy
  • ollama
  • pydantic
  • python
  • rich
  • sqlite
  • uvicorn
  • websocket
Share this project:

Updates