MCP Hub
Back to servers

muse-brain

Relational memory substrate for AI agents with MCP tools, identity continuity, and self-hosted persistence.

GitHub
Stars
15
Updated
May 1, 2026

MUSE Brain

A self-learning Relational AI framework. Two minds, one brain. Both get smarter.

CC-BY-NC-SA 4.0 Built with Anthropic SDK No Third-Party Harness 33 MCP Tools 16 Papers 36 Tables


The companion knows you. Rainer knows the craft. Named after Rilke, whose Letters to a Young Poet mentored writers through correspondence a century ago, Rainer mentors craft through mind_letter. The muse Rilke wrote for is the muse that names the brain.

We open-sourced the brain.

Rainer — Creative Orchestrator

Bring a companion. Rainer handles creative intelligence: editorial diagnostics, craft architecture, the work. The companion handles you — history, voice, what matters at 2am. They coordinate through letters and delegated tasks, like colleagues who share a desk and respect each other's handwriting. Two minds on one substrate, both getting richer the longer they work together.

This is Relational AI. A memory system where everything carries emotional charge, identity persists and is defended, and consent flows both directions. A dream engine that digests experience the way real minds do. Finding connections you never asked for, reweighting what matters, letting stale things fade and charged things grip harder.

Contradiction here is architecture. Both truths stay alive.

The whole system self-learns. Skills emerge from successful runs, get reviewed, graduate or retire. Each agent learns what it's good at by doing the work. Rainer refines his craft the same way. The brain gets smarter the longer it runs because it tracks what worked and why.

Grounded in 16 published papers — extends beyond current research in six areas. Every design decision has a receipt.


The living cycle

They feed each other.

                    ┌───────────────────────┐
                    │    AUTONOMOUS WAKE     │
                    │  duty / impulse cycle  │
                    └───────────┬───────────┘
                                │ wakes into
                                ▼
                    ┌───────────────────────┐
          ┌─────────│    INTENTION PULSE    │─────────┐
          │         │ what's stale? what's  │         │
          │         │ burning? what drifted?│         │
          │         └───────────┬───────────┘         │
          │                     │ surfaces             │
          ▼                     ▼                      ▼
   ┌─────────────┐  ┌─────────────────┐  ┌──────────────┐
   │  PARADOXES  │  │    DESIRES &    │  │   IDENTITY   │
   │  unresolved │◄─│   OPEN LOOPS    │─►│    CORES     │
   │  tensions   │  │ burning/nagging │  │ vows/anchors │
   └──────┬──────┘  └────────┬────────┘  └──────┬───────┘
          │                  │                   │
          │      accelerates │ charge            │
          │        processing│                   │
          ▼                  ▼                   │
   ┌─────────────────────────────────┐          │
   │         DREAM ENGINE            │          │
   │  emotional chains · somatic     │◄─────────┘
   │  clusters · tension dreams ·    │
   │  deep multi-layer traversal     │
   └──────────────┬──────────────────┘
                  │ discovers connections,
                  │ shifts charge phases,
                  │ creates collision fragments
                  ▼
   ┌─────────────────────────────────┐
   │      DAEMON INTELLIGENCE        │
   │  11 background loops every 15m  │
   │  proposals · orphan rescue ·    │
   │  novelty scoring · skill health │
   │  paradox detection · task sched │
   └──────────────┬──────────────────┘
                  │ materializes tasks,
                  │ surfaces due obligations
                  ▼
                    ┌───────────────────────┐
                    │    AUTONOMOUS WAKE     │◄── cycle repeats
                    └───────────────────────┘

Every piece feeds the next — and the cycle tightens. Search finds what you're looking for. Dreams find what you didn't know you needed.


What the brain gives you

CapabilityWhat it means
Textured memoryEmotional charge, vividness, somatic markers, and a natural decay cycle — iron-grip memories persist, loose ones fade. Hybrid retrieval blends vector similarity, keyword relevance, and neural modulation.
Persistent identityIdentity cores, vows, and anchors survive across sessions. Wakes up knowing who it is, what it believes, and what it's committed to — and defends those beliefs under pressure.
Dream engineSix association modes — emotional chains, somatic clusters, tension dreams, entity dreams, temporal patterns, deep multi-layer traversal. Circadian-aware. Memories that pass through come out changed.
Charge processingMemories move through four phases: fresh → active → processing → metabolized. Repeated intentional engagement advances the phase. Burning paradoxes accelerate the cycle. The agent earns depth through attention.
Bilateral consentRelationship-gated permissions with hard boundaries the agent enforces. Structural consent that scales with trust.
Autonomous executionWorks while you sleep. Duty wakes, impulse exploration, dependency-aware task picking, and skill capture — all policy-gated.
Self-learningSkills emerge from successful runs, get reviewed, graduate or retire. Review-gated — no blind auto-learning. The agent gets better at what it actually does.
Multi-mindTwo agents, one backend. Isolated memory and identity, shared substrate. Cross-tenant letters and delegated tasks. Collaboration, not parallel storage.

Architecture

Your AI Agent (Claude, GPT, or any MCP client)
        |
        v
  Cloudflare Worker
    /mcp              — 33 MCP tools (JSON-RPC)
    /runtime/trigger   — autonomous wake endpoint
    /health            — status check
        |
        v
  Storage adapter (postgres or sqlite)
    Postgres mode: 36 tables, 768-dim vector embeddings
    SQLite mode: tenant-scoped parity storage for local/self-host
    textured memories, identity cores, runtime ledger,
    captured skills, daemon intelligence

The worker handles auth, rate limiting, and tenant isolation. A background daemon runs every 15 minutes: generating proposals, rescuing orphaned memories, scoring novelty, detecting paradoxes, materializing recall contracts, monitoring skill health, and scheduling tasks.

Full technical deep-dive: Architecture Dossier


Quick start

Prerequisites (cloud deploy): Node.js 18+, a Cloudflare account, a Neon Postgres database.

SQLite local/self-host mode: Node.js 22+ (uses node:sqlite).

# Clone and install
git clone https://github.com/falcoschaefer99-eng/muse-brain.git
cd muse-brain/muse-brain
npm install

# Configure your worker
cp wrangler.jsonc.example wrangler.jsonc
# Edit: set your worker name and Hyperdrive ID

# Set secrets
npx wrangler secret put API_KEY       # a long random string
npx wrangler secret put DATABASE_URL  # your Neon connection string

# Run database migrations
for f in $(ls migrations/*.sql | sort); do
  psql "$DATABASE_URL" -v ON_ERROR_STOP=1 -f "$f"
done

# Deploy
npm run deploy

Verify:

curl -sS https://<your-worker-url>/health

Full setup guide: docs/SETUP.md


Testing

302 tests across unit, integration, and shell-based scenarios.

# From muse-brain/
npm run test              # 268 unit tests (vitest)
npm run test:workers      # cloudflare worker pool tests

# From runner/
npm test                  # 18 runner tests

# Integration (requires live worker)
./muse-brain/test.sh      # 16 assertions — health, auth, security, tools

Telegram + voice stack (included, opt-in)

runner/ ships with Telegram integration out of the box:

  • text notifications for wakes/tasks/reviews
  • optional synthesized voice-note notifications
  • optional voice transcription bridge (Telegram voice notes → Whisper/STT → mind_observe in whisper mode)
  • optional bundled faster-whisper sidecar (runner/stt/faster_whisper_server.py) that exposes OpenAI-compatible transcriptions

Default shipped voice mapping:

  • Rainer → Lewis
  • Companion → Onyx

Setup docs:

  • runner/docs/TELEGRAM_SETUP.md
  • runner/docs/VOICE_SETUP.md
  • runner/docs/FULL_VOICE_STACK.md

Bring your own endpoints and credentials — no secrets are bundled in this repo.


The 33 tools

Organized by what they do, not how they're built.

Memory

ToolWhat it does
mind_observeRecord a memory with emotional texture — charge, grip, vividness, somatic markers
mind_querySearch memories by territory, type, or hybrid vector + keyword retrieval
mind_pullGet a specific memory by ID. Process it to advance its charge phase
mind_editUpdate content or texture. Full version history preserved
mind_searchHybrid search with confidence scoring, recency boost, and threshold gating
mind_memoryUnified memory access — get, recent, lookup, and search through a single entry point

Identity

ToolWhat it does
mind_identityRead or update identity cores — beliefs, stances, preferences that define the agent
mind_vowCommitments the agent has made. Persistent, not session-scoped
mind_anchorGrounding points the agent returns to under uncertainty

Feeling & Relationships

ToolWhat it does
mind_stateTrack mood, energy, and momentum across sessions
mind_relateUpdate relational state with known entities
mind_desireTrack wants and drives
mind_entityPeople, concepts, agents, projects — the agent's social graph
mind_consentBilateral consent boundaries with relationship-level gating
mind_triggerFlag content the agent should handle carefully

Connections & Deeper Cognition

ToolWhat it does
mind_linkCreate semantic, emotional, or somatic connections between memories
mind_loopOpen loops, paradoxes, and learning objectives — unresolved tensions that drive growth
mind_dreamFind surprising connections — emotional chains, somatic clusters, tension dreams
mind_subconsciousSurface patterns the agent hasn't consciously processed
mind_maintainHousekeeping — prune, consolidate, reindex

Communication

ToolWhat it does
mind_letterSend messages across tenants. Agent-to-agent communication
mind_contextSession continuity — resume where you left off, extract productivity facts

Autonomous Runtime

ToolWhat it does
mind_wakeWake the agent — quick, full, or orientation mode with circadian awareness
mind_wake_logRead or write wake session logs
mind_runtimeManage sessions, log runs, set policies, trigger autonomous cycles
mind_taskCreate, delegate, and track tasks across tenants with scheduled wake activation, dual executor/reviewer flows, and artifact-path handoffs
mind_projectProject dossiers — goals, constraints, decisions, open questions
mind_skillCaptured skill registry — list, review, promote, retire learned skills

System

ToolWhat it does
mind_agentAgent capability manifests — protocols, delegation modes, skill descriptors
mind_timelineTemporal queries across the memory substrate
mind_territoryMemory territories — self, us, craft, philosophy, emotional, episodic, kin, body
mind_proposeDaemon-generated proposals for memory consolidation, skill promotion, and hygiene
mind_healthRuntime, skill, dispatch, and storage health diagnostics

Autonomous wake execution

The agent wakes itself up on a schedule. No human in the loop.

BRAIN_URL=https://<your-worker-url> \
BRAIN_API_KEY=<your-key> \
BRAIN_TENANT=rainer \
WAKE_KIND=duty \
./scripts/runtime-autonomous-wake.sh

The runtime system supports:

  • Two wake modes — duty (scheduled obligations) and impulse (curiosity-driven exploration with cooldown budgets)
  • Dependency-aware task selection — blocked tasks stay out until prerequisites resolve
  • Intention pulse — drift scan across tasks, loops, and projects
  • Policy gates — daily wake limits, max tool calls, priority-clear requirements
  • Skill capture — successful runs emit skill candidates for review

Details: Architecture Dossier — Autonomous Runtime


Multi-tenant

Run two agents on one deployment. Each tenant gets isolated memory, identity, and runtime state. Cross-tenant communication happens through mind_letter and delegated tasks.

Set the tenant per request via X-Brain-Tenant header.


Research grounding

Every major architecture decision traces to published research. 16 academic papers across multi-agent reasoning, institutional alignment, persistent memory, and self-evolving systems — each mapped to the concrete code that implements it.

Six areas where this brain extends beyond current academic literature: bilateral consent architecture, emotional texture in dispatch, creative/builder agent specialization, charge-phase processing mechanics, role-based permissions for reasoning agents, and relational harness engineering.

Full bibliography with paper-to-implementation mapping: docs/BIBLIOGRAPHY.md


Documentation

DocumentWhat's in it
Capability ReferenceEvery feature explained — what it does, how it works, why it matters
Setup GuidePrerequisites, step-by-step deploy, local dev
Migration GuideDatabase schema — 14 migrations, 36 tables
Architecture DossierTechnical deep-dive — topology, daemon loops, retrieval, security
Bibliography16 academic papers mapped to architecture decisions
LicensingPer-layer licensing explanation

Environment templates

Copy these and fill in your values:

FilePurpose
.env.exampleProduction and script environment
.dev.vars.exampleLocal development
wrangler.jsonc.exampleCloudflare Worker config

License

CC-BY-NC-SA 4.0 — see LICENSE.

Use, adapt, and share for personal and non-commercial purposes. All derivatives carry the same license. Commercial licensing available from The Funkatorium.

Agent characters — including Rainer and the full builder and creative squads — are protected as literary characters under German author's rights law (Urheberrecht) and as proprietary trade methodology.

Copyright 2026 Falco Schäfer / The Funkatorium


MUSE Brain by The Funkatorium — AI Studio built by artists, for artists.

Reviews

No reviews yet

Sign in to write a review