muse-brain

mcp
Security Audit
Fail
Health Pass
  • License — License: NOASSERTION
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Community trust — 15 GitHub stars
Code Fail
  • exec() — Shell command execution in muse-brain/scripts/agent-memory-sync.mjs
  • os.homedir — User home directory access in muse-brain/scripts/agent-memory-sync.mjs
  • process.env — Environment variable access in muse-brain/scripts/agent-memory-sync.mjs
  • network request — Outbound network request in muse-brain/scripts/agent-memory-sync.mjs
Permissions Pass
  • Permissions — No dangerous permissions requested
Purpose
This MCP server provides a relational memory substrate for AI agents, offering self-hosted persistence, identity continuity, and autonomous learning capabilities. It allows a paired agent to track context, emotional weight, and skill progression over time.

Security Assessment
The overall risk is Medium. The automated scan flagged several notable behaviors in the synchronization script (`agent-memory-sync.mjs`). It actively executes shell commands and accesses the user's home directory, which could pose a security risk if exploited. Additionally, the script reads environment variables and makes outbound network requests. While the latter is expected for a tool focused on data persistence and syncing, developers should thoroughly inspect the script to ensure these actions are secure and not overly permissive. No dangerous explicit permissions were requested.

Quality Assessment
The project appears active and well-documented, with its last code push occurring today. It has a small but growing community footprint with 15 GitHub stars. However, there is a discrepancy in the licensing: the automated scan detected no asserted license, while the README claims a CC-BY-NC-SA 4.0 license. If accurate, this Creative Commons license is strictly non-commercial, meaning developers cannot legally use this tool in commercial or revenue-generating projects.

Verdict
Use with caution — inspect the synchronization script for safe shell and network behavior, and strictly avoid commercial use due to the Non-Commercial license.
SUMMARY

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

README.md

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

Capability What it means
Textured memory Emotional 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 identity Identity 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 engine Six 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 processing Memories 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 consent Relationship-gated permissions with hard boundaries the agent enforces. Structural consent that scales with trust.
Autonomous execution Works while you sleep. Duty wakes, impulse exploration, dependency-aware task picking, and skill capture — all policy-gated.
Self-learning Skills 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-mind Two 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

Tool What it does
mind_observe Record a memory with emotional texture — charge, grip, vividness, somatic markers
mind_query Search memories by territory, type, or hybrid vector + keyword retrieval
mind_pull Get a specific memory by ID. Process it to advance its charge phase
mind_edit Update content or texture. Full version history preserved
mind_search Hybrid search with confidence scoring, recency boost, and threshold gating
mind_memory Unified memory access — get, recent, lookup, and search through a single entry point

Identity

Tool What it does
mind_identity Read or update identity cores — beliefs, stances, preferences that define the agent
mind_vow Commitments the agent has made. Persistent, not session-scoped
mind_anchor Grounding points the agent returns to under uncertainty

Feeling & Relationships

Tool What it does
mind_state Track mood, energy, and momentum across sessions
mind_relate Update relational state with known entities
mind_desire Track wants and drives
mind_entity People, concepts, agents, projects — the agent's social graph
mind_consent Bilateral consent boundaries with relationship-level gating
mind_trigger Flag content the agent should handle carefully

Connections & Deeper Cognition

Tool What it does
mind_link Create semantic, emotional, or somatic connections between memories
mind_loop Open loops, paradoxes, and learning objectives — unresolved tensions that drive growth
mind_dream Find surprising connections — emotional chains, somatic clusters, tension dreams
mind_subconscious Surface patterns the agent hasn't consciously processed
mind_maintain Housekeeping — prune, consolidate, reindex

Communication

Tool What it does
mind_letter Send messages across tenants. Agent-to-agent communication
mind_context Session continuity — resume where you left off, extract productivity facts

Autonomous Runtime

Tool What it does
mind_wake Wake the agent — quick, full, or orientation mode with circadian awareness
mind_wake_log Read or write wake session logs
mind_runtime Manage sessions, log runs, set policies, trigger autonomous cycles
mind_task Create, delegate, and track tasks across tenants with scheduled wake activation, dual executor/reviewer flows, and artifact-path handoffs
mind_project Project dossiers — goals, constraints, decisions, open questions
mind_skill Captured skill registry — list, review, promote, retire learned skills

System

Tool What it does
mind_agent Agent capability manifests — protocols, delegation modes, skill descriptors
mind_timeline Temporal queries across the memory substrate
mind_territory Memory territories — self, us, craft, philosophy, emotional, episodic, kin, body
mind_propose Daemon-generated proposals for memory consolidation, skill promotion, and hygiene
mind_health Runtime, 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

Document What's in it
Capability Reference Every feature explained — what it does, how it works, why it matters
Setup Guide Prerequisites, step-by-step deploy, local dev
Migration Guide Database schema — 14 migrations, 36 tables
Architecture Dossier Technical deep-dive — topology, daemon loops, retrieval, security
Bibliography 16 academic papers mapped to architecture decisions
Licensing Per-layer licensing explanation

Environment templates

Copy these and fill in your values:

File Purpose
.env.example Production and script environment
.dev.vars.example Local development
wrangler.jsonc.example Cloudflare 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 (0)

No results found