Skip to content

Latest commit

Β 

History

30 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ChayRa AI Logo

ChayRa AI


Watch Demo Video Vercel Live Demo Mission Critical 3 Brains & 7 Agents Swarm Copyright Ranajit Dhar 2026

Engineered by Ranajit Dhar β€’ When the World Breaks, ChayRa Responds.


⚑ 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.

🌍 The Mission & Inspiration: Why build ChayRa AI?

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.

πŸ’₯ I refused to accept that. I asked myself: "What if an AI system could act before panic spreads?"

  • 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?

That vision became ChayRa AI. It is not just another conversational dashboard; it is an autonomous multi-agent crisis response swarm engineered to assist humanity during its most vulnerable seconds. From active threat detection to polyglot emergency broadcasting, every line of code serves one mission: protecting lives when traditional infrastructure fails.

In a future where disasters are accelerating, intelligent coordination systems will become essential digital infrastructure.


πŸ›‘οΈ 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/)

  1. πŸ›‘οΈ 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.
  2. πŸ•΅οΈβ€β™‚οΈ Scavenger: Extracts critical context, calculates the Threat Level (CRITICAL, HIGH, LOW), and tags required agents dynamically.
  3. πŸ“‘ Radar: Scans external environment APIs and environment parameters to establish the physical context of the crisis.
  4. βš–οΈ Verifier: The Fact-Checker. Cross-references the victim's claim with Radar Intel to prevent hallucinations and establish an intelligence confidence score.
  5. πŸ₯ Medical: Generates immediate, life-saving triage protocols based on the extracted injury/disaster context.
  6. πŸ—ΊοΈ Navigator: Processes exact GPS coordinates or manual pin drops to map out tactical evacuation and routing protocols.
  7. πŸ”’ 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.

ChayRa AI Agentic Swarm Architecture
The Multi-Brain Swarm Intelligence & Auto-Failover Circuit Breaker

Click Here to Expand the Technical Mermaid Blueprint

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;
Loading

βš™οΈ 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: Next.js Tailwind CSS Leaflet
  • The Intelligence Swarm (3-Tier): Gemini Pro Llama 3 Qwen
  • Live Intel & Radar APIs: Overpass API SerpAPI
  • Polyglot & Telemetry: Voice API Kyber-1024
  • Partner Backend: MongoDB
  • Infrastructure: Vercel TypeScript

πŸ“‚ 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)


Live Demo

Note: Judges can test the system's full polyglot voice capabilities and swarm intelligence directly via the Live Edge URL above.
This section is strictly for open-source technical verification.

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.

About

An autonomous 7-Agent crisis response swarm powered by Gemini 3 Pro & MongoDB MCP. Features a 3-tier LLM failover circuit for zero-hour disaster routing.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages