Skip to content

FuFicFac/ej-palace-wiki

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EJ Palace Wiki

A personal knowledge system built on two open ideas: Karpathy's LLM-Wiki and MemPalace.

The wiki gives you curated, cross-linked knowledge — the ~5% worth synthesizing. MemPalace gives you searchable recall across everything else. Together, they form a two-layer memory system for AI agents that compounds over time instead of resetting every session.


The Problem

Every time you open a new AI chat, it wakes up with no memory of you. No context, no history, no relationship. You are a stranger. Every. Single. Time.

The companies are working on it — Claude has Projects and Memory, ChatGPT has its memory checkbox — but these are partial solutions you can't audit, can't edit meaningfully, and can't port to another system.

This project is the alternative: a knowledge system made of markdown files that lives on your machine, works with any LLM that can read files, and gets richer every day because the LLM does all the maintenance.


What This Is

EJ Palace Wiki is a working implementation of Karpathy's LLM-Wiki pattern, extended with three ideas that aren't in the original:

  1. MemPalace as the long-tail substrate. Karpathy's pattern has a wiki and raw sources, but no answer for "how do I search the 95% that didn't make it into the wiki?" MemPalace handles that — 10,000+ semantic drawers, searchable via CLI or MCP, indexed automatically from your files.

  2. HARVEST — the verb Karpathy didn't spec. When multiple AI agents work across multiple machines, each one accumulates knowledge in its own session. HARVEST is a scheduled job that mines agent session memory, promotes wiki-worthy facts to the shared wiki, and syncs via your file system. Without it, agents are islands. With it, what Alice learns at 3 AM is available to every agent by morning.

  3. The 5% rule. An explicit editorial standard: only durable entities get wiki pages. Active projects, real people, recurring concepts, key decisions with their reasoning. Everything else stays as raw sources in MemPalace. Target at steady state: 200–400 active pages. Not 10,000.


Architecture

┌─────────────────────────────────────────────────┐
│                   YOU                            │
│         (source, question, or session)           │
└──────────────────────┬──────────────────────────┘
                       │
                       ▼
┌─────────────────────────────────────────────────┐
│                  INBOX                           │
│        Drop a file. That's it.                   │
└──────────────────────┬──────────────────────────┘
                       │
              ┌────────┴────────┐
              ▼                 ▼
┌──────────────────┐  ┌──────────────────────────┐
│   WIKI (~5%)     │  │   MEMPALACE (everything)  │
│                  │  │                            │
│  Curated pages   │  │  Raw sources indexed for   │
│  Cross-linked    │  │  semantic search. CLI and  │
│  LLM-maintained  │  │  MCP access. The long tail │
│  Markdown files  │  │  lives here.               │
└──────────────────┘  └──────────────────────────┘
        │                        │
        └────────┬───────────────┘
                 │
                 ▼
┌─────────────────────────────────────────────────┐
│            ANY LLM WITH FILE ACCESS              │
│                                                  │
│  Claude Code · Codex · Claude Desktop · ChatGPT  │
│  OpenClaw · Cursor · Any MCP-capable client      │
│                                                  │
│  Reads the wiki for synthesis.                   │
│  Searches MemPalace for recall.                  │
│  Maintains both as you add sources.              │
└─────────────────────────────────────────────────┘

The Two Layers

Layer What it holds Who writes it How you search it
Wiki Curated synthesis — durable entities, decisions with reasoning, cross-references The LLM, guided by the schema index.md + [[wiki-links]]
MemPalace Everything — raw sources, session logs, notes, the full corpus mempalace mine (automated) mempalace search (CLI) or MemPalace MCP

MemPalace is a required dependency. Without it, you have a wiki — useful, but limited to what's been curated. With it, you have a system — curated knowledge on top, searchable recall across everything underneath. The wiki is the 5%. MemPalace is the 100%.


The Four Verbs

These are the only operations agents perform on the wiki. Everything else is reading.

INGEST

A new source arrives (dropped into Inbox/ or handed to the LLM directly). The LLM reads it, decides if it introduces a durable entity, updates relevant wiki pages, and files the source. MemPalace indexes it for search.

QUERY

You ask a question. The LLM reads index.md, finds relevant pages, synthesizes an answer with [[citations]]. If the answer is evergreen, it gets filed back as a new wiki page. Your questions compound into the knowledge base.

HARVEST

(EJ's addition — not in Karpathy's original.)

A scheduled job that bridges per-agent session memory and the shared wiki. When agents work overnight — reconciling files, generating reports, making decisions — that knowledge stays trapped in their session logs. HARVEST mines those logs, promotes wiki-worthy facts, and makes them visible to every agent.

This is the only mechanism by which cross-agent session knowledge reaches the shared brain. It's what turns a collection of isolated agents into an organization that learns.

LINT

A periodic health check. Scans for orphan pages, broken links, stale content, oversized pages, contradictions. Surfaces problems — never auto-fixes them. Human approves all structural changes.


Required Dependencies

MemPalace

Required. The search substrate for everything outside the wiki.

  • Install: github.com/nicobailon/mempalace
  • What it provides: CLI (mempalace mine, mempalace search) and MCP server
  • What it does: indexes your files into semantic "drawers" searchable by meaning, not just keywords
  • When you install MemPalace, you get both the CLI and the MCP server

An LLM with file access

Required. Any of these work:

Tool How it accesses files Notes
Claude Code Reads CLAUDE.md automatically, full file system access Best for power users comfortable in the terminal
Codex Reads AGENTS.md, full file system access Similar capabilities, different ecosystem
Claude Desktop + MCP Uses MemPalace MCP for search, file access via MCP tools Works without terminal access
OpenClaw Full file system access, scheduled tasks, multi-agent For agent organizations with automated workflows
Cursor / Windsurf / Any AI IDE File system access via editor Works for wiki maintenance during coding sessions

A file sync mechanism (optional but recommended)

If you run agents on multiple machines, you need the wiki to be visible everywhere. Options:

  • Dropbox (what this project uses)
  • iCloud Drive
  • Syncthing
  • Git (the wiki is just markdown — it's a natural fit)

Getting Started

Minimum viable setup (15 minutes)

# 1. Install MemPalace
pip install mempalace  # or follow install instructions at the repo

# 2. Create your wiki structure
mkdir -p my-wiki/{Wiki/{Projects,People,Concepts,Archive},Inbox,"Raw Sources"}

# 3. Copy the schema into your wiki
cp WIKI-TEMPLATE.md my-wiki/WIKI.md   # edit to fit your domain

# 4. Create your index and log
touch my-wiki/index.md my-wiki/log.md

# 5. Initialize MemPalace on your wiki + sources
mempalace init --root my-wiki

# 6. Open your LLM and point it at the schema
# In Claude Code: just cd into my-wiki/ — it reads CLAUDE.md automatically
# In Codex: same idea with AGENTS.md
# In any LLM: paste WIKI.md and say "maintain this wiki"

First ingest

Drop a file into Inbox/ and tell your LLM:

"Read WIKI.md, then ingest the file in Inbox/. Create or update wiki pages as needed, update index.md, and log the operation."

That's it. The LLM does the rest.

First search

# Search MemPalace for anything — wiki pages AND raw sources
mempalace search "what decisions were made about the auth system"

Automation (Optional)

The minimum setup is manual: you drop files, you tell the LLM to ingest. But you can automate every piece:

Automated ingest pipeline

Use fswatch (macOS) or inotifywait (Linux) to watch the Inbox/ folder. When a file lands, trigger your LLM to ingest it. See examples/wiki-watch.sh for a working implementation.

Scheduled HARVEST

Set up a cron job or scheduled task that:

  1. Runs mempalace mine to index new session logs
  2. Queries MemPalace for facts added since the last harvest
  3. Promotes wiki-worthy items to wiki pages
  4. Logs the operation

Scheduled LINT

A nightly job that scans the wiki for health issues and writes a report. No auto-fixes — just surfaces what needs attention.

Scheduled tasks by platform

Platform How to schedule
macOS launchd plists in ~/Library/LaunchAgents/
Linux cron or systemd timers
OpenClaw Built-in scheduled tasks
Codex Codex scheduled tasks
Claude Code External scheduler calls Claude Code CLI

The scheduled tasks are the connective tissue. They're what turn a wiki you maintain into a wiki that maintains itself. The ingest pipeline watches for new sources. HARVEST mines agent sessions. LINT catches problems. All automated, all writing to the same wiki, all searchable via MemPalace.


What's in This Repo

File What it is
README.md This file
llm-wiki.md Karpathy's original LLM-Wiki pattern (unmodified seed)
WIKI-TEMPLATE.md Schema template — copy this into your wiki and customize
EXTENSIONS.md What this project adds beyond Karpathy's pattern, and why
examples/ Working scripts for automation (ingest pipeline, watch scripts)

The Evolution

This project started as a straight implementation of Karpathy's LLM-Wiki gist. The original pattern is brilliant — the insight that LLMs can maintain a wiki better than humans is genuinely new. But running it in practice surfaced gaps:

  • The search problem. A wiki with 200 pages and an index works. But what about the thousands of raw sources that didn't make the cut? You need search across the full corpus, not just the curated layer. MemPalace solves this.

  • The multi-agent problem. Karpathy's version is one person, one LLM. When you have multiple agents across multiple machines — each accumulating knowledge in their own sessions — you need a mechanism to bridge session memory into the shared wiki. HARVEST solves this.

  • The bloat problem. Without an explicit editorial standard, the wiki grows until it's useless. The 5% rule — only durable entities get pages — keeps the wiki sharp. MemPalace handles the long tail.

  • The automation problem. Manual ingest works for a while, then you stop doing it. Automation (fswatch, crons, scheduled tasks) means the wiki maintains itself as long as your machines are running.

The result is a two-layer system: curated knowledge on top (the wiki), searchable recall underneath (MemPalace), connected by scheduled jobs that run without human intervention. It works with any LLM that can read files. It lives on your machine. The knowledge is yours.


Credits

  • Andrej Karpathy — the LLM-Wiki pattern that started all of this
  • MemPalace — the long-term memory substrate (conceptual origin: Milla Jovovich; built by Nico Bailon)
  • EJ (Ekello Harrid) — HARVEST, the 5% rule, multi-agent coordination, and the automation layer that ties it together

License

MIT

About

A two-layer personal knowledge system: LLM-maintained wiki + MemPalace semantic search. Built on Karpathy's LLM-Wiki pattern.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors