ChayRa AI – Swarm de Resposta a Crises Autônomo
ranajitdharpersonal/chayra-ai
Enxame de 7 agentes para resposta autônoma a crises com roteamento tático e failover inteligente
Ver no GitHubMCP Server que orquestra um enxame de 7 agentes autônomos especializados em resposta a emergências, com processamento de voz multilíngue, roteamento tático de 25km e circuit breaker com 3 camadas de fallback LLM. Integrado com MongoDB para logging seguro e projetado para funcionar offline via mesh networks quando infraestrutura celular colapsa.
Instalação
npx convez-ai ranajitdharpersonal/chayra-ai1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
Casos de uso
- Resposta autônoma a desastres e emergências médicas com roteamento de evacuação
- Processamento de comandos de voz em múltiplos idiomas sob alta pressão
- Fact-checking em tempo real e combate a desinformação durante crises
Veredito

Projeto ambicioso com arquitetura de swarm agents bem estruturada e mecanismos de resiliência sérios (failover LLM, offline-first mesh). A complexidade é alta e o foco em crises/emergências é nicho, mas a implementação técnica do circuit breaker e integração MongoDB MCP é sólida para quem precisa orquestração autônoma crítica.
README
A tradução para o português deste README ainda está na fila.
⚡ Judge TL;DR (30-Second Overview)
ChayRa AI is not just a chatbot. It is an autonomous, hyper-local crisis response swarm.
We are building the ultimate digital safety net for zero-hour emergencies, turning panicked, multilingual voice commands into coordinated survival intelligence.
- 🎙️ Polyglot Voice-to-Action Protocol: Built-in military-grade voice command processing. Victims can speak naturally in extreme stress (100+ Local Languages), and the system autonomously decodes, translates, and triggers the rescue swarm.
- 🗺️ 25km Tactical Routing (Navigator): Automatically scans a 25km radius via OpenStreetMap to pinpoint verified hospitals, civilian shelters, or military bunkers, generating a secure evacuation route from the user's live location.
- ⚕️ Live AI Triage (Medical Agent): Instantly analyzes trauma context to generate life-saving first-aid steps and medication suggestions. Features a robust offline fallback lifeline protocol if connectivity drops.
- 🔌 3-Tier Auto-Failover Circuit Breaker: Robust backend logic ensures that if the primary LLM brain fails or hallucinates, the system seamlessly falls back to a secondary module or a "Trust-User" default state(Gemini 3 Pro
➔Groq Llama 3➔HF Qwen). False negatives are fatal in emergencies, so ChayRa guarantees uninterrupted execution. - 📍 Tactical Pin Drop & Live GPS: Victims can transmit their live location via secure GPS handshakes or utilize the "Drop Pin" feature on a tactical map when GPS is spoofed or compromised.
- 💾 Partner Integration (MongoDB MCP): The Vault Agent autonomously connects to the MongoDB Model Context Protocol (MCP) to securely log and encrypt emergency victim data (Threat Level, Location, Circuit Status) as a secure backend crisis-registry.
- 🔍 Live Rumor Verification: A dedicated intel search bar allows victims to instantly fact-check local news and dispel panic-inducing misinformation during the chaos of a crisis.
- 🛡️ Offline-First Mesh Network (Vault Agent): Generates secure alphanumeric emergency beacons. While this prototype currently simulates the rescue beacon workflow, the architecture is explicitly designed for future offline peer-to-peer communication through Bluetooth mesh and WiFi Direct when traditional cell towers collapse.
- 💻 Glassmorphism Tactical Console: A premium, dark-themed, military-grade UI with dynamic glow states, real-time latency tracking, and autonomous agent processing indicators.
Every year, millions are caught in the chaotic crossfire of natural disasters, wars, and humanitarian crises. In these zero-hour moments, the greatest enemy isn't just the disaster itself—it is the delay of information, the collapse of networks, and paralyzing language barriers.
If a standard AI denies help because it "couldn't find recent news" about a hyper-local drone strike, that false negative is fatal.
- What if trapped civilians could instantly receive tactical evacuation routes?
- What if life-saving medical triage could be generated instantly, bypassing overloaded human dispatchers?
- What if a refugee could transmit distress signals in their native tongue and be understood flawlessly?
🛡️ I am not building AI for convenience. I am building AI for resilience.
🚀 The Architecture: Autonomous Multi-Agent Swarm
Unlike traditional monolithic LLMs, ChayRa AI operates on a Swarm Architecture. It utilizes an Evaluator-Optimizer loop where specialized micro-agents communicate, verify, and execute critical tasks in parallel.
🧠 The Core Agents (src/core/agents/)
- 🛡️ MindGuard (The Firewall): The gatekeeper. Prevents system abuse and features an Omni-Disaster Fast-Pass. It uses heuristic regex bypasses to instantly approve critical physical threats (bombings, earthquakes, tsunami) without waiting for slow news/API validations.
- 🕵️♂️ Scavenger: Extracts critical context, calculates the Threat Level (CRITICAL, HIGH, LOW), and tags required agents dynamically.
- 📡 Radar: Scans external environment APIs and environment parameters to establish the physical context of the crisis.
- ⚖️ Verifier: The Fact-Checker. Cross-references the victim's claim with Radar Intel to prevent hallucinations and establish an intelligence confidence score.
- 🏥 Medical: Generates immediate, life-saving triage protocols based on the extracted injury/disaster context.
- 🗺️ Navigator: Processes exact GPS coordinates or manual pin drops to map out tactical evacuation and routing protocols.
- 🔒 Vault: Manages secure identity and generates emergency beacons. (Powered by MongoDB MCP for secure, offline-ready data logging).
🧬 High-Level Architecture (The Swarm & The Shield)
ChayRa AI is powered by a modular, self-healing architecture that guarantees 100% uptime and zero hallucinations.
graph TD
%% Global APIs & Autonomous Radar (Top Right)
LiveFeeds((🌐 Live Global APIs)) -->|Continuous Scan| Radar[📡 Radar Agent <br> Scans Environment]
Radar -->|Live Threat Map| UI(((💻 Tactical Console / UI)))
%% The Brain Router (Standalone Top Left)
subgraph "🧠 BRAIN ROUTER (Multi Brain Auto Failover)"
direction LR
G{"Gemini 3 Pro"} -->|ANY ERROR| L{"Groq (Llama 3)"}
L -->|ANY ERROR| Q{"HF (Qwen)"}
end
%% Core Input Flow (Top Center)
User((🎙️ Victim Input <br> Voice/Text)) -->|Polyglot Decode| MG[🛡️ MindGuard Agent Firewall]
%% Brain Connections (Dotted lines to show cognitive powering)
G -.->|Powers| MG
G -.->|Powers| Swarm
G -.->|Powers| Scav
%% Firewall Logic
MG -->|Spam / Prank| Deny[❌ Request Denied]
MG -->|Omni-Disaster Bypass ⚡| Swarm{⚙️ Swarm Orchestrator}
MG -->|Validated Crisis| Swarm
%% Extraction & Orchestration
Swarm --> Scav[🕵️♂️ Scavenger Agent <br> Extracts Threat Level]
%% Radar Intel Distribution
Radar -->|Live Intel Feed| Verifier[⚖️ Verifier Agent <br> Fact-Checks Intel]
Radar -->|Danger Zones| Nav[🗺️ Navigator Agent <br> Tactical Routing]
%% Scavenger Data Distribution
Scav -->|Injury Data| Med[🏥 Medical Agent <br> Triage Protocols]
Scav -->|Secure ID| Vault[🔒 Vault Agent <br> Key Generation]
Scav -->|Context| Verifier
Scav -->|Coords| Nav
%% Final Output to UI (Bottom)
Med --> UI
Vault --> UI
Verifier --> UI
Nav --> UI
%% --- 🛑 NEW MONGODB INTEGRATION (Partner MCP) ---
MongoDB[(💾 MongoDB MCP <br> Secure Crisis Log)]
Vault -.->|Background Sync| MongoDB
%% Styling to match your colors
classDef firewall fill:#dc2626,stroke:#ef4444,stroke-width:2px,color:#fff;
classDef core fill:#0ea5e9,stroke:#38bdf8,stroke-width:2px,color:#fff;
classDef agent fill:#fef08a,stroke:#eab308,stroke-width:2px,color:#000;
classDef brain fill:#fee2e2,stroke:#f87171,stroke-width:2px,color:#000;
classDef radar fill:#e0e7ff,stroke:#818cf8,stroke-width:2px,color:#000;
class MG firewall;
class Swarm,Scav core;
class Verifier,Nav,Med,Vault agent;
class Radar radar;
class G,L,Q brain;
classDef db fill:#064e3b,stroke:#34d399,stroke-width:2px,color:#fff;
class MongoDB db;
⚙️ The Tech Stack & Directory Structure
ChayRa AI relies on a highly modular, serverless edge-optimized infrastructure. We bypassed monolithic designs for pure cloud-native speed and 100% uptime.
- Frontend & Console:
- The Intelligence Swarm (3-Tier):
- Live Intel & Radar APIs:
- Polyglot & Telemetry:
- Partner Backend:
- Infrastructure:
📂 Core Directory Architecture
📦 CHAYRA-AI
┣ 📂 src
┃ ┣ 📂 app
┃ ┃ ┣ 📂 api # Serverless Edge Endpoints (crisis-zones, swarm, verify, voice)
┃ ┃ ┣ 📜 globals.css # Custom Tailwind & Glassmorphism styles
┃ ┃ ┣ 📜 layout.tsx # Root Next.js layout structure
┃ ┃ ┗ 📜 page.tsx # Main Command Center UI
┃ ┣ 📂 components # UI Modules (ActionPanel, HelpBar, MapCore, MapWidget)
┃ ┣ 📂 core
┃ ┃ ┣ 📂 agents # The Micro-Agents (medical, mindguard, navigator, radar, scavenger, vault, verifier, base.ts)
┃ ┃ ┗ 📂 brain # Central LLM processing (brain.ts) & 3-Tier failover logic
┃ ┗ 📂 lib # Shared utility functions (utils.ts)
┣ 📜 .env.local # Master API Keys (Gemini, Groq, HF, SerpAPI)
┣ 📜 AGENTS.md # Documentation for Agent prompts and behaviors
┗ 📜 package.json # Project dependencies & scripts
🚀 Quick Start & Technical Verification (For Judges)
1. Clone & Install
git clone https://github.com/ranajitdharpersonal/chayra-ai
cd chayra-ai
npm install
2. The Master Keys (.env.local)
To ignite the 3-Brain Swarm locally, create a .env.local file and configure the following environment variables:
GEMINI_API_KEY=your_primary_brain_key
GROQ_API_KEY=your_llama3_failover_key
HF_TOKEN=your_survival_key
SERPAPI_API_KEY=live_rumor_verification_key
MONGODB_URI=your_database_key
# Note: Overpass API (OpenStreetMap) is used for routing and does not require an API key!
3. Ignite the Engine
npm run dev
👨💻 The Architect
Ranajit Dhar
- AI & Multi-Agent Systems Architect | Pioneering Autonomous Crisis Response
- Copyright (c) 2026 Ranajit Dhar.
⭐ Final Note:
ChayRa AI is not just a tool; it is a proof-of-concept for a future where humanity is protected by intelligent, autonomous swarms when traditional infrastructure collapses. Welcome to the next generation of crisis response.