Cognitive-state-aware adaptive multi-agent system
NeuroFlow
Reads your cognitive workload from EEG and reshapes a LangGraph agent team around it.
- 3
- Workload states
- 4
- Agents
- 14
- EEG channels
Problem
LLM assistants answer the same way whether you are relaxed or overloaded. Under high cognitive load, long verbose answers add friction — and that is exactly when correctness matters most.
Solution
A five-layer closed loop. An EEG classifier decodes workload (LOW / MEDIUM / HIGH) from 14-channel signals, a workload manager selects a routing policy, and a LangGraph agent graph scales its depth: more verification and stricter confidence thresholds — delivered in a lighter format — as load rises.
Architecture
Key engineering decisions
- Verification scales with load: 0 loops at LOW, 1 at MEDIUM, 2 plus a Final Verification agent at HIGH — with confidence thresholds of 70 / 80 / 95%.
- Output format is part of the policy: verbose with examples at LOW, bullet points only at HIGH for cognitive relief.
- One compiled LangGraph serves all three topologies via conditional edges, instead of three separate pipelines.
- The Verifier → Solver retry is a bounded cycle (an explicit loop-counter node), so quality retries can never run away.
- A single shared ChatOllama instance is reused by every agent to avoid repeated model loads and memory exhaustion.
Features
- Workload prediction endpoint returning state, confidence and processing time
- Adaptive chat that reports which agents ran, verification loops used and the threshold applied
- Next.js dashboard visualising agent execution paths, workload state and system metrics
- Fully local inference with Ollama (qwen3:8b); Docker Compose for the whole stack
Hardest problem
- Turning noisy, high-dimensional EEG windows (14 channels × 1280 samples) into a stable three-class signal: Butterworth band-pass + notch + common average reference, then band powers, differential entropy, Hjorth parameters and entropy, optimised down to a 5-component PCA projection for an RBF-kernel SVM.
Tech stack
My role
Designed and built the EEG pipeline, classifier, FastAPI backend, LangGraph orchestration and Next.js dashboard.
Academic guidance: Dr. Mitul Kumar Ahirwal, Department of CSE, MANIT Bhopal. EEG data: STEW dataset.