Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

100 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Transit 2.0

Scalable, Agentic, Graph-Based Supply Chain Resilience Platform

By CLIQUE x ACM MITS | NEXUS Hackathon 2026


Overview

Transit 2.0 transforms the original linear, file-based AI pipeline into a scalable, truly agentic, graph-based supply chain resilience platform. The system ingests real-time disruption data (GDACS), processes events via Celery/Redis task queues, models supply chain networks in Neo4j, runs agentic decision loops via LangGraph, and visualizes everything in Streamlit dashboards.


Key Features

Real-Time Data Ingestion

  • GDACS RSS feed polling for India-relevant natural disasters (earthquakes, floods, cyclones)
  • Mock event fallback when no live events are detected
  • Redis pub/sub event broadcasting to connected dashboards
  • Celery task queue for async Scout→Analyst processing

Neo4j Graph Database

  • 25 City nodes connected by 500 SHIPMENT_TO relationships from historical data
  • Cypher queries for downstream domino effect (*1..{n} variable-length path patterns)
  • Aggregated relationship properties: total_value_inr, cargo_types, total_shipments

LangGraph Agentic Loop

  • DisruptionState TypedDict for shared memory between agents (eliminates JSON file handoffs)
  • Conditional routing: HIGH/CRITICAL severity → Analyst + Simulator, MEDIUM → Simulator only, LOW → end
  • Tool binding: query_neo4j() and query_osrm() as LangChain @tool functions
  • Groq Llama 3 LLM integration for intelligent decision-making

Multi-Agent Pipeline

Agent Module Role
Scout 01_scout_module Detects disruptions, parses signals via LLM
Analyst 02_analyst_module Quantifies financial risk, filters affected shipments
Simulator 03_intel_module Runs Monte Carlo simulations, Neo4j downstream queries, OSRM route analysis

Interactive Dashboards

  • Main Dashboard (localhost:8501): Supply chain map, live disruption feed, agent intelligence feed, Telegram integration
  • Neo4j Visualizer (localhost:8502): pydeck-based supply chain graph with PathLayer + ScatterplotLayer, city selector, hop slider

Architecture

                    ┌─────────────────────────────────────────────────────┐
                    │                LIVE INGESTION ENGINE                │
                    │  GDACS RSS → Redis Queue → Celery Tasks (10min)    │
                    └────────────────────┬────────────────────────────────┘
                                         │
                                         ▼
                    ┌─────────────────────────────────────────────────────┐
                    │              LANGGRAPH AGENTIC LOOP                 │
                    │  ┌────────┐   ┌──────────┐   ┌──────────────┐      │
                    │  │ Scout  │──▶│ Analyst  │──▶│  Simulator   │      │
                    │  │ (LLM)  │   │ (Risk)   │   │ (Neo4j+OSRM) │      │
                    │  └────────┘   └──────────┘   └──────────────┘      │
                    │        │          │                │                │
                    │        ▼          ▼                ▼                │
                    │   LOW→END   MEDIUM→SIM     HIGH/CRIT→ALL           │
                    └─────────────────────────────────────────────────────┘
                                         │
                                         ▼
        ┌───────────────────────────────┴───────────────────────────────┐
        │                            DATA LAYER                        │
        │  ┌──────────┐   ┌──────────────┐   ┌────────────────────┐   │
        │  │  Redis   │   │   Neo4j      │   │  Shared Exchange   │   │
        │  │ (Queue)  │   │ (Graph DB)   │   │  (JSON handoffs)   │   │
        │  └──────────┘   └──────────────┘   └────────────────────┘   │
        └──────────────────────────────────────────────────────────────┘
                                         │
                                         ▼
        ┌──────────────────────────────────────────────────────────────┐
        │                     STREAMLIT DASHBOARDS                     │
        │  ┌─────────────────────┐   ┌──────────────────────────┐     │
        │  │  Main Dashboard     │   │  Neo4j Graph Visualizer  │     │
        │  │  (Port 8501)        │   │  (Port 8502)             │     │
        │  └─────────────────────┘   └──────────────────────────┘     │
        └──────────────────────────────────────────────────────────────┘

Project Structure

transit/
├── 01_scout_module/                  # Detection, UI & pipeline
│   ├── chaos_trigger.py              # Random disruption event generator
│   ├── scout_agent.py                # LLM-powered signal parser
│   └── dashboard.py                  # Main Streamlit control room
│
├── 02_analyst_module/               # Financial risk assessment
│   ├── analyst_agent.py              # Risk calculation & shipment filtering
│   └── shipments.json                # Shipment database (15 records)
│
├── 03_intel_module/                 # Simulation & graph queries
│   ├── simulator_agent.py            # Monte Carlo + OSRM + Neo4j + Domino Effect
│   ├── strategist_agent.py           # Historical pattern matching
│   ├── capacity_matcher.py           # Dynamic Load Pooling algorithm
│   ├── intel_coordinator.py          # Legacy pipeline orchestrator
│   └── past_events.json              # Experience buffer
│
├── 04_manager_module/               # ROI, alerts & Telegram integration
│   └── manager_agent.py              # Final decision, audio alerts
│
├── shared_exchange/                  # JSON data handoffs (legacy)
│   └── .gitkeep                      # Placeholder (runtime files gitignored)
│
├── live_ingestion.py                 # GDACS polling + Redis + Celery dispatch
├── graph_builder.py                  # CSV → Neo4j graph population + Cypher queries
├── langgraph_workflow.py             # LangGraph agentic loop (Scout→Analyst→Simulator)
├── neo4j_viz.py                      # Neo4j supply chain graph Streamlit viz
├── historical_shipments.csv          # 500 historical shipment records for Neo4j
├── routes_dict.py                    # Route definitions
├── generate_routes.py                # Route generator
├── debug_pipeline.py                 # Pipeline debugging tool
├── progress/                         # Hackathon progress screenshots
├── CHANGELOG.md                      # Development log
└── .env                              # GROQ_API_KEY (gitignored)

Tech Stack

Technology Version Purpose
Python 3.11 Core language
Celery 5.3.6 Distributed task queue (Scout→Analyst pipeline)
Redis (Docker) Message broker & pub/sub event bus
Neo4j (Docker) Graph database for supply chain network modeling
LangGraph 1.0.10 Agentic workflow graph with conditional routing
LangChain Groq 1.1.2 LLM tool binding (query_neo4j, query_osrm)
Groq API Llama 3 LLM inference for Scout, Analyst, Strategist
OSRM Public API Live road routing
Streamlit Latest Dashboards & visualizations
pydeck Latest Deck.gl-based supply chain graph visualization

Getting Started

Prerequisites

  • Python 3.11+
  • Docker (for Redis and Neo4j)
  • Groq API Key (free at groq.com)

Installation

# Clone the repository
git clone <repo-url>
cd transit

# Install dependencies
pip install -r requirements.txt

# Configure API key
echo "GROQ_API_KEY=your_key_here" > .env

Docker Services

# Redis (message broker)
docker run -d --name transit-redis -p 6379:6379 redis:7

# Neo4j (graph database)
docker run -d --name transit-neo4j -p 7687:7687 -p 7474:7474 \
  -e NEO4J_AUTH=neo4j/transit123 neo4j:5

Running the System

1. Populate Neo4j graph database

python graph_builder.py

2. Start the Celery worker (Windows)

python -m celery -A live_ingestion.celery_app worker --pool=solo --loglevel=info

3. Start the live ingestion engine

python live_ingestion.py

4. Start the main dashboard

python -m streamlit run 01_scout_module/dashboard.py --server.port 8501 --server.headless true

5. Start the Neo4j graph visualizer

python -m streamlit run neo4j_viz.py --server.port 8502 --server.headless true

Running the LangGraph Pipeline (Standalone)

python langgraph_workflow.py

Data Flow

  1. Ingestion: live_ingestion.py polls GDACS RSS every 10 minutes → Redis queue
  2. Celery Task: process_disruption task runs Scout + Analyst in sequence
  3. LangGraph: run_pipeline(event) executes Scout→Analyst→Simulator with conditional routing
  4. Neo4j Queries: Simulator queries Neo4j for downstream effects using Cypher
  5. Visualization: Dashboards poll Redis pub/sub and read shared JSON outputs in real time

Configuration

Environment Variables (.env)

GROQ_API_KEY=your_groq_api_key_here
REDIS_URL=redis://localhost:6379/0
NEO4J_URI=bolt://localhost:7687
NEO4J_USER=neo4j
NEO4J_PASSWORD=transit123
TELEGRAM_BOT_TOKEN=your_telegram_token
TELEGRAM_CHAT_ID=your_chat_id

Downstream Network (Domino Effect)

DOWNSTREAM_NETWORK = {
    "Electronics_Components": [
        {"facility": "Bangalore Assembly Line 1", "halts_after_hours": 24, "damage_per_hour_inr": 15000}
    ],
    "Medical_Supplies": [
        {"facility": "Coimbatore Hospital", "halts_after_hours": 12, "damage_per_hour_inr": 50000}
    ]
}

License

This project was built during NEXUS 2026 Hackathon by CLIQUE x ACM MITS.


Team

CLIQUE x ACM MITS


Build. Break. Innovate.

About

Agentic Supply Chain Swarm with Dynamic Load Pooling - An AI-driven multi-agent system that autonomously responds to Black Swan disruptions, simulates route alternatives, and monetizes empty cargo space to subsidize logistics costs.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages