DEV Community

near
near

Posted on

How I Implemented 88 Neuroscience-Inspired Brain Modules for Autonomous Scientific Reasoning

How I Implemented 88 Neuroscience-Inspired Brain Modules for Autonomous Scientific Reasoning

Most AI systems today are single-pass generators — you give them input, they produce output, and nothing persists. When I set out to build RUMI (Research & Unified Machine Intelligence), I wanted something fundamentally different: a system that thinks, remembers, learns, and reasons the way cognitive scientists believe biological brains do.

Here's how I translated decades of neuroscience research into 88 working Python modules.

The Theoretical Foundations

RUMI's architecture isn't arbitrary. Every module maps to a published neuroscience or cognitive science theory:

Global Workspace Theory (Baars, 1988)

The core of RUMI's cognition is a global workspace — a shared information bus that broadcasts events to all modules. Just like Baars proposed that consciousness arises from information being broadcast to a global workspace in the brain, RUMI's workspace broadcasts discoveries, contradictions, and hypotheses to all reasoning engines simultaneously.

class GlobalWorkspace:
    def __init__(self):
        self.subscribers = []
        self.event_log = []

    def broadcast(self, event: WorkspaceEvent):
        self.event_log.append(event)
        for subscriber in self.subscribers:
            subscriber.on_event(event)
Enter fullscreen mode Exit fullscreen mode

This means when the contradiction miner finds a conflict between two papers, every reasoning engine — causal, analogical, neurosymbolic — gets notified and can contribute their perspective.

Dual Process Theory (Kahneman, 2011)

RUMI implements both System 1 and System 2 reasoning:

  • System 1 — Fast, pattern-matching. Handles entity recognition, simple lookups, cached results. Uses the vector memory store with semantic search.
  • System 2 — Slow, deliberate. Handles multi-step causal reasoning, hypothesis generation, experiment planning. Uses the causal and analogical reasoning engines.

The metacognitive monitor decides which system to engage. Simple factual queries route to System 1. Complex analytical tasks trigger System 2 with its full reasoning chain.

Free Energy Principle (Friston, 2010)

RUMI's active inference module implements Friston's Free Energy Principle. The system maintains a generative model of the scientific domain and minimizes prediction error — the difference between what it expects to find in the literature and what it actually finds.

When prediction error is high (something unexpected appears in a paper), RUMI:

  1. Updates its internal model (Bayesian updating)
  2. Flags the finding as potentially novel
  3. Triggers the curiosity engine to explore further

This is how RUMI automatically identifies findings that don't fit existing models — exactly the kind of thing that leads to breakthrough discoveries.

Hebbian Learning

"Neurons that fire together wire together." RUMI's neural memory implements Hebbian learning: concepts that co-occur frequently across papers develop stronger associations. When "KRAS G12C" and "PI3K/AKT pathway" appear together in multiple papers, their connection weight increases, making RUMI more likely to surface this relationship in future analyses.

The 9-Type Memory System

Biological brains don't have one type of memory. Neither does RUMI:

Memory Type Implementation Purpose
Neural Hebbian association weights Concept co-occurrence patterns
Episodic Timestamped event log What happened and when
Vector Embedding-based semantic search "Find me similar findings"
Procedural Pipeline state machines How to execute multi-step processes
Working Active context window Current reasoning state
Global Workspace Broadcast event bus Cross-module communication
Associative Graph-based entity links Knowledge graph relationships
Predictive Bayesian generative models What to expect next
Consolidated Compressed long-term store Distilled knowledge from past sessions

The dreaming system runs offline consolidation — replaying past experiences, strengthening important connections, and pruning noise. This mirrors how biological sleep consolidates memories.

The Curiosity Engine

One of the most important modules is the curiosity engine. It tracks knowledge gaps — areas where RUMI's model has low confidence or high uncertainty. When the system is idle, the curiosity engine generates research questions designed to fill these gaps.

class CuriosityEngine:
    def generate_questions(self, knowledge_graph, uncertainty_threshold):
        gaps = []
        for node in knowledge_graph.nodes:
            if node.confidence < uncertainty_threshold:
                gaps.append(KnowledgeGap(
                    concept=node.label,
                    related_papers=node.connections,
                    question=f"What is the relationship between {node.label} and {self._find_weakest_link(node)}?"
                ))
        return sorted(gaps, key=lambda g: g.uncertainty, reverse=True)
Enter fullscreen mode Exit fullscreen mode

The Metacognitive Monitor

Perhaps the most unusual module: RUMI monitors its own thinking quality. The metacognitive tracker:

  • Detects when reasoning is going in circles
  • Identifies potential cognitive biases (confirmation bias, anchoring)
  • Measures confidence calibration (does the system's confidence match its accuracy?)
  • Triggers System 2 engagement when System 1 confidence is low

Why This Matters

These aren't just theoretical constructs. Each module contributes measurable value:

  • Curiosity-driven exploration found 3 additional relevant papers that keyword search missed in the KRAS analysis
  • Hebbian learning correctly identified PI3K/AKT as a convergence point across 4 independent resistance mechanisms
  • Active inference flagged the DHX9-RAC1-PAK1 axis as novel because it didn't match the expected resistance model
  • Contradiction mining (covered in a separate article) identified conflicting claims about AURKA's role that warranted further investigation

Try It Yourself

git clone https://github.com/subhansh-dev/Rumi
cd rumi
pip install -e .
playwright install chromium
rumi
Enter fullscreen mode Exit fullscreen mode

Then run /discover on any research topic and watch the cognitive architecture in action.

Links


I'm actively developing RUMI and looking for feedback from researchers in computational neuroscience, cognitive AI, and anyone interested in building more brain-like AI systems. What modules am I missing? What theories should I implement next?

— Subhansh

Top comments (0)