Hey everyone! I want to share an experimental open-source boilerplate I’ve been working on called LangBrain, built on top of LangGraph.
The issue: Most multi-agent frameworks force you to build rigid, top-down organigrams. A "Boss Agent" decides everything, and sub-agents just blindly execute. That’s a terrible model for real-world autonomy.
Your body doesn't work like that. If you touch a hot stove, you don't wait for your brain to process the situation—your spinal cord reacts instantly via reflex. The brain is informed afterwards for strategic adjustments.
LangBrain replicates this biological logic (N-Level Hierarchy):
🧠 The Brain (Supreme Orchestrator): Thinks cyclically, solves complex conflicts, and handles macro-strategy.
🫀 Organs & Components (Sub-agents): Highly specialized agents that react autonomously to local sensors. They only escalate to the Brain when they hit a conflict or ambiguity they can't solve.
🩸 Nervous System (Event Log): A centralized DB ledger that prevents race conditions and conflicts.
Coolest Features:
Dynamic Human-in-the-Loop (HITL): Pause the graph and approve/reject critical actions via REST APIs.
Semantic "God Mode" Override: You can force a rejected action by explaining why in natural language (e.g., "Ignore the energy-saving lock, my grandma is freezing, turn the heater on to 22°C"). The LLM acts as an arbitrator and translates your reasoning into physical API execution.
100% headless FastAPI server with support for Local LLMs, OpenRouter, and Gemini.
The repo includes two out-of-the-box demos: a Smart Home conflict resolution and a Medical Homeostasis simulator (treating tachycardia and hypoxia).
⚠️ Disclaimer: This is a demonstrative prototype/boilerplate, not yet production-ready.
I’d love to hear your thoughts, roasts, or suggestions on this architectural approach!
GitHub Repo: https://github.com/youssouf994/LangBrain.git
Top comments (0)