Skip to Content
Mind Palace 0.3.1-alpha is out. Check it out →
Mind Palace

Mind Palace

A deterministic context system for codebases, inspired by the Method of Loci .

Quick Links: Getting Started | CLI Reference | Features | Architecture


The Problem

AI agents working with codebases face three failures:

  1. Context rot - Agents receive stale snapshots that diverge from reality
  2. Scope drift - Without boundaries, agents wander into irrelevant code
  3. Heuristic fragility - File-matching guesses break as codebases evolve

Current solutions (RAG, embeddings, “just dump everything”) are probabilistic. They work until they don’t.

The Solution

Mind Palace provides a deterministic, schema-validated index that both humans and AI agents can trust.

┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │ You curate │ │ CLI indexes │ │ Agents query │ │ Rooms + │ ──► │ with hashes │ ──► │ with contracts │ │ Playbooks │ │ (SQLite+FTS5) │ │ (MCP protocol) │ └─────────────────┘ └─────────────────┘ └─────────────────┘

No embeddings. No guessing. Deterministic.

Method of Loci

The Method of Loci  (memory palace technique) is a mnemonic strategy from ancient Greece. You mentally place information in specific locations within an imagined building, then “walk through” to recall it.

Mind Palace applies this to code:

Memory PalaceMind Palace
Imagined buildingYour codebase
RoomsLogical groupings (auth, api, cli)
Objects in roomsEntry points, key files
Walking throughQuerying with Butler
RecallingAssembling context packs

The metaphor isn’t decorative—it’s the architecture.

Key Properties

PropertyHow
DeterministicSHA-256 hashes, SQLite with WAL, reproducible scans
Schema-firstJSON Schema validation on all artifacts
Verifiablepalace check proves freshness
Agent-readyMCP server for direct AI integration
Diff-scopedConstrain context to changed files only

Quick Start

# Install curl -L https://github.com/koksalmehmet/mind-palace/releases/latest/download/palace-darwin-arm64 -o palace chmod +x palace && sudo mv palace /usr/local/bin/ # Initialize palace init && palace scan # Explore palace explore "where is authentication handled" # Generate context for an AI agent palace explore "fix the login bug" --full

Components

ComponentPurpose
CLICore engine: palace scan, explore, check, store, serve
VS Code ExtensionHUD, sidebar, auto-sync
MCP ServerAI agent integration via JSON-RPC
DashboardWeb UI for visualization and monitoring

Features

Brain (Ideas & Decisions)

Track ideas, decisions, and their outcomes over time.

palace store "Let's use JWT for authentication" --as decision palace recall "auth" --type decision

Session Memory

Track agent work sessions, activities, and learnings. See Session Memory.

palace session start --agent claude --goal "Add authentication" palace store "Use bcrypt for password hashing" --as learning palace recall "authentication" palace brief src/auth.go

Call Graph

Explore function relationships in your codebase.

palace explore --map handleAuth --direction up palace explore --map processRequest --direction down --depth 3

Governance

Proposals workflow for human-in-the-loop approval. See Governance.

palace store "Use JWT for auth" --as decision # Creates proposal palace proposals --status pending # List pending proposals palace approve prop_abc123 # Approve proposal palace store --direct "Trust this source" --as learning # Direct write

Corridors

Share knowledge across projects. See Corridors.

palace corridor link api-service ~/code/api-service palace corridor search "error handling" --all palace corridor personal palace corridor promote learning_123

Dashboard

Visual exploration of your codebase. See Dashboard.

palace dashboard # Opens http://localhost:3001

Next Steps

Last updated on