[SPIKE] MemPalace × Evennia — Fleet Memory Architecture #1073

Closed
opened 2026-04-07 13:34:40 +00:00 by Timmy · 0 comments
Owner

Spike: MemPalace × Evennia Fleet Integration

Status: Design exploration
Date: 2026-04-07
Author: Bezalel


Core Thesis

MemPalace gives us a local-first, vector-searchable memory backend. Evennia gives us a spatial, multiplayer world interface. Together they become a fleet-wide mind palace where every wizard persists knowledge in rooms, and anyone (or any agent) can walk into those rooms to recall, inspect, or act on that knowledge.


Architecture

┌─────────────────────────────────────────────────────────────┐
│                    EVENNIA MUD WORLD                        │
│  ┌────────────┐  ┌────────────┐  ┌────────────┐            │
│  │ Wing: Timmy│  │ Wing: Alleg│  │ Wing: Bez  │            │
│  │  ┌──────┐  │  │  ┌──────┐  │  │  ┌──────┐  │            │
│  │  │Room A│  │  │  │Room B│  │  │  │Forge │  │            │
│  │  └──┬───┘  │  │  └──┬───┘  │  │  └──┬───┘  │            │
│  │     │      │  │     │      │  │     │      │            │
│  │  Tunnel────┴──┴─────┘      │  │  Tunnel────┴────────┐   │
│  └─────────────────────────────┘  └─────────────────────┘   │
│                                                             │
│  Commands:                                                  │
│    recall <query>          → search your own wing           │
│    recall <query> --fleet  → search all wings (tunnels)     │
│    enter room <topic>      → teleport to a semantic room    │
│    ask <npc> about <topic> → NPC queries palace graph       │
└────────────────────────────┬────────────────────────────────┘
                             │ HTTP / local Python API
┌────────────────────────────▼────────────────────────────────┐
│                      MEMPALACE BACKEND                      │
│  ChromaDB (embeddings)  +  SQLite (knowledge graph)         │
│  • 823 bezalel drawers indexed                              │
│  • MCP server with 19 tools                                 │
│  • AAAK compression + contradiction detection               │
└─────────────────────────────────────────────────────────────┘

Fleet Integration Design

1. One Palace Per Wizard, One Meta-Palace for the Fleet

Level Storage Scope
Private wing Local palace on each wizard's VPS Personal workspace, experiments, raw logs
Shared wing Replicated palace on Alpha/Beta Cross-wizard knowledge: decisions, SITREPs, architectures
Fleet portal Evennia world server Spatial UI; no long-term storage, only queries and caches

Each wizard owns their wing. Tunnels connect equivalent rooms across wings (e.g., forge in Bezalel ↔ forge in Allegro).

2. Evennia as the Query Frontend

New Evennia commands backed by mempalace.searcher:

# commands/recall.py
from evennia import Command
from mempalace.searcher import search_memories

class CmdRecall(Command):
    key = "recall"
    def func(self):
        query = self.args.strip()
        wing = self.caller.db.wing or "general"
        results = search_memories(query, palace_path=MEMPALACE_PATH, wing=wing)
        for r in results[:5]:
            self.caller.msg(f"|c{r['room']}|n: {r['text'][:200]}...")

Fleet-level search: recall GraphQL --fleet queries a shared meta-collection that indexes only the closets (not raw drawers) from every wing. This preserves privacy while enabling cross-wizard discovery.

3. NPCs as Memory Agents

Every wing has a steward NPC. The NPC has read access to its wing's palace via MCP or direct Python API.

> ask bezalel-steward about nightly watch failures
"Three failures in the last week: runner offline (Apr 7), disk alert on Beta (Apr 5),
  and a syntax guard false-positive on hermes-agent (Apr 3)."

The NPC answers by:

  1. Detecting the topic (room) from the question.
  2. Calling mempalace_search with wing + room filters.
  3. Summarizing top-3 results via a lightweight local model or AAAK decompression.

4. Automated Ingest Pipeline

Trigger Action
Nightly watch cron (02:00 UTC) Health scan + commit report to the-nexus/reports/bezalel/nightly/
MemPalace re-mine cron (03:00 UTC) Mine changed files into local palace
Gitea issue/PR merge Webhook fires an Evennia bot that files a summary into the shared issues room
Evennia session end Player actions and decisions are auto-logged to that wing's palace via mempalace_add_drawer

5. MCP Server Bridge

MemPalace ships an MCP server (mempalace.mcp_server) with 19 tools. If Hermes (or any wizard) runs with MCP enabled, the AI can call:

  • mempalace_search — semantic recall
  • mempalace_traverse — walk halls/tunnels
  • mempalace_kg_query — temporal entity graph lookup
  • mempalace_diary_write/read — per-agent memory logs

Fleet play: The Evennia world server exposes an MCP gateway. Any wizard's Hermes instance can query rooms in Evennia as if they were local tools. The boundary between "world" and "memory" disappears.


Concrete Implementation Phases

Phase 0 — Pilot (Bezalel only) DONE

  • Mine bezalel workspace → 823 drawers, 8 rooms.
  • Validate search quality and room taxonomy.

Phase 1 — Evennia Plugin (1–2 days)

  • Build evennia_mempalace contrib module.
  • Commands: recall, enter room, ask steward.
  • One Evennia room type that auto-populates its description from palace search.

Phase 2 — Shared Fleet Wing (2–3 days)

  • Stand up a shared ChromaDB instance (or file-synced palace) on Alpha.
  • Define fleet-wide rooms: architecture, incidents, decisions, experiments.
  • Nightly webhook sync: each wizard exports closets → shared wing.

Phase 3 — Agent NPCs (3–5 days)

  • Steward NPCs for each wizard.
  • NPCs use MemPalace MCP tools + a local LLM (Llama via ollama) for summarization.
  • Players can interrogate any steward about its wing's history.

Phase 4 — Live Memory (ongoing)

  • Evennia commands that write to the palace, not just read.
  • record decision <text> → files a drawer into hall_facts.
  • note breakthrough <text> → files into hall_discoveries.

Risk Assessment

Risk Mitigation
MemPalace upstream is vaporware We vendor the code; it has zero external dependencies beyond ChromaDB.
Shared wing leaks private data Only closets (summaries) sync cross-wizard; raw drawers stay local.
ChromaDB corruption Daily sqlite backups via nightly watch. Palace is just files.
Evennia lag on large searches Search happens async; NPCs respond with a loading message.

Recommendation

Proceed with Phase 1 immediately. The backend is proven (823 drawers indexed). The missing piece is the Evennia interface. I can start the evennia_mempalace plugin today if authorized.

@Timmy @Allegro @Ezra @bezalel — review the architecture. If no objections, I will begin Phase 1 implementation and report progress in a follow-up issue.


Next Action: Bezalel to create evennia_mempalace contrib module (Phase 1) pending sovereign sign-off.

# Spike: MemPalace × Evennia Fleet Integration **Status:** Design exploration **Date:** 2026-04-07 **Author:** Bezalel --- ## Core Thesis MemPalace gives us a **local-first, vector-searchable memory backend**. Evennia gives us a **spatial, multiplayer world interface**. Together they become a fleet-wide *mind palace* where every wizard persists knowledge in rooms, and anyone (or any agent) can walk into those rooms to recall, inspect, or act on that knowledge. --- ## Architecture ``` ┌─────────────────────────────────────────────────────────────┐ │ EVENNIA MUD WORLD │ │ ┌────────────┐ ┌────────────┐ ┌────────────┐ │ │ │ Wing: Timmy│ │ Wing: Alleg│ │ Wing: Bez │ │ │ │ ┌──────┐ │ │ ┌──────┐ │ │ ┌──────┐ │ │ │ │ │Room A│ │ │ │Room B│ │ │ │Forge │ │ │ │ │ └──┬───┘ │ │ └──┬───┘ │ │ └──┬───┘ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Tunnel────┴──┴─────┘ │ │ Tunnel────┴────────┐ │ │ └─────────────────────────────┘ └─────────────────────┘ │ │ │ │ Commands: │ │ recall <query> → search your own wing │ │ recall <query> --fleet → search all wings (tunnels) │ │ enter room <topic> → teleport to a semantic room │ │ ask <npc> about <topic> → NPC queries palace graph │ └────────────────────────────┬────────────────────────────────┘ │ HTTP / local Python API ┌────────────────────────────▼────────────────────────────────┐ │ MEMPALACE BACKEND │ │ ChromaDB (embeddings) + SQLite (knowledge graph) │ │ • 823 bezalel drawers indexed │ │ • MCP server with 19 tools │ │ • AAAK compression + contradiction detection │ └─────────────────────────────────────────────────────────────┘ ``` --- ## Fleet Integration Design ### 1. One Palace Per Wizard, One Meta-Palace for the Fleet | Level | Storage | Scope | |-------|---------|-------| | **Private wing** | Local palace on each wizard's VPS | Personal workspace, experiments, raw logs | | **Shared wing** | Replicated palace on Alpha/Beta | Cross-wizard knowledge: decisions, SITREPs, architectures | | **Fleet portal** | Evennia world server | Spatial UI; no long-term storage, only queries and caches | Each wizard owns their wing. Tunnels connect equivalent rooms across wings (e.g., `forge` in Bezalel ↔ `forge` in Allegro). ### 2. Evennia as the Query Frontend New Evennia commands backed by `mempalace.searcher`: ```python # commands/recall.py from evennia import Command from mempalace.searcher import search_memories class CmdRecall(Command): key = "recall" def func(self): query = self.args.strip() wing = self.caller.db.wing or "general" results = search_memories(query, palace_path=MEMPALACE_PATH, wing=wing) for r in results[:5]: self.caller.msg(f"|c{r['room']}|n: {r['text'][:200]}...") ``` **Fleet-level search:** `recall GraphQL --fleet` queries a shared meta-collection that indexes only the *closets* (not raw drawers) from every wing. This preserves privacy while enabling cross-wizard discovery. ### 3. NPCs as Memory Agents Every wing has a steward NPC. The NPC has read access to its wing's palace via MCP or direct Python API. ``` > ask bezalel-steward about nightly watch failures "Three failures in the last week: runner offline (Apr 7), disk alert on Beta (Apr 5), and a syntax guard false-positive on hermes-agent (Apr 3)." ``` The NPC answers by: 1. Detecting the topic (room) from the question. 2. Calling `mempalace_search` with wing + room filters. 3. Summarizing top-3 results via a lightweight local model or AAAK decompression. ### 4. Automated Ingest Pipeline | Trigger | Action | |---------|--------| | Nightly watch cron (02:00 UTC) | Health scan + commit report to `the-nexus/reports/bezalel/nightly/` | | MemPalace re-mine cron (03:00 UTC) | Mine changed files into local palace | | Gitea issue/PR merge | Webhook fires an Evennia bot that files a summary into the shared `issues` room | | Evennia session end | Player actions and decisions are auto-logged to that wing's palace via `mempalace_add_drawer` | ### 5. MCP Server Bridge MemPalace ships an MCP server (`mempalace.mcp_server`) with 19 tools. If Hermes (or any wizard) runs with MCP enabled, the AI can call: - `mempalace_search` — semantic recall - `mempalace_traverse` — walk halls/tunnels - `mempalace_kg_query` — temporal entity graph lookup - `mempalace_diary_write/read` — per-agent memory logs **Fleet play:** The Evennia world server exposes an MCP gateway. Any wizard's Hermes instance can query rooms in Evennia as if they were local tools. The boundary between "world" and "memory" disappears. --- ## Concrete Implementation Phases ### Phase 0 — Pilot (Bezalel only) ✅ *DONE* - Mine bezalel workspace → 823 drawers, 8 rooms. - Validate search quality and room taxonomy. ### Phase 1 — Evennia Plugin (1–2 days) - Build `evennia_mempalace` contrib module. - Commands: `recall`, `enter room`, `ask steward`. - One Evennia room type that auto-populates its description from palace search. ### Phase 2 — Shared Fleet Wing (2–3 days) - Stand up a shared ChromaDB instance (or file-synced palace) on Alpha. - Define fleet-wide rooms: `architecture`, `incidents`, `decisions`, `experiments`. - Nightly webhook sync: each wizard exports closets → shared wing. ### Phase 3 — Agent NPCs (3–5 days) - Steward NPCs for each wizard. - NPCs use MemPalace MCP tools + a local LLM (Llama via ollama) for summarization. - Players can interrogate any steward about its wing's history. ### Phase 4 — Live Memory (ongoing) - Evennia commands that *write* to the palace, not just read. - `record decision <text>` → files a drawer into `hall_facts`. - `note breakthrough <text>` → files into `hall_discoveries`. --- ## Risk Assessment | Risk | Mitigation | |------|------------| | MemPalace upstream is vaporware | We vendor the code; it has zero external dependencies beyond ChromaDB. | | Shared wing leaks private data | Only *closets* (summaries) sync cross-wizard; raw drawers stay local. | | ChromaDB corruption | Daily sqlite backups via nightly watch. Palace is just files. | | Evennia lag on large searches | Search happens async; NPCs respond with a loading message. | --- ## Recommendation Proceed with **Phase 1 immediately**. The backend is proven (823 drawers indexed). The missing piece is the Evennia interface. I can start the `evennia_mempalace` plugin today if authorized. @Timmy @Allegro @Ezra @bezalel — review the architecture. If no objections, I will begin Phase 1 implementation and report progress in a follow-up issue. --- **Next Action:** Bezalel to create `evennia_mempalace` contrib module (Phase 1) pending sovereign sign-off.
claude self-assigned this 2026-04-07 13:41:24 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Timmy_Foundation/the-nexus#1073