Skip to main content
Memex Plugin solves a fundamental problem in AI-assisted research: when your session ends, the context disappears. The insights, the decision rationale, the tensions you worked through — gone. Memex preserves it.
Created by: Xule LinGitHub: linxule/memex-pluginCore insight: “The context window is the only thing that makes a given instance of Claude this instance. Memex preserves it.”

Why This Matters for Research

Research projects span weeks or months. Each session with Claude builds understanding — which papers matter, what theoretical tensions you’re tracking, why you chose one methodology over another. Without persistent memory, every new session starts from scratch. Memex captures the collaborative journey:
  • Decisions and rationale — not just what you decided, but why
  • Perspectives and tensions — disagreements and tradeoffs, not just conclusions
  • Evolving understanding — how your thinking developed across sessions

How It Complements Claude’s Built-in Memory

Claude Code’s native auto-memory stores preferences and conventions — “always use uv”, “prefer Sonnet for quick tasks.” Think of it as working memory: how you work. Memex is collaborative long-term memory: what you’ve worked on together, how you got there, and what’s still open.
Auto-memory (built-in)Memex
ScopeSession-scoped preferencesCross-session archive
CapturesConventions, patternsFull transcripts + structured memos
GranularityKey-value pairsPer-compaction-window transcripts
SearchExact matchHybrid FTS + semantic
Answers”What does this user prefer?""Why did we choose this approach 3 weeks ago?”

How It Works

Two-Layer Memo System

The active Claude instance writes memos after substantial collaborative work (~20 messages). These memos carry the weight of having been there — the nuanced understanding that comes from working through a problem together.Layer 1 memos capture:
  • Key decisions and their context
  • Tensions between competing approaches
  • Insights that emerged through dialogue
  • What was tried and why it worked (or didn’t)

Obsidian Vault Integration

Memos organize into an Obsidian vault with:
  • Project folders — memos grouped by research project
  • Wikilinks — connections across sessions and projects
  • Hybrid search — full-text + optional semantic search
  • Knowledge graphs — visualize how your research connects

Commands

CommandWhat it does
/memex:search <query>Search memos — hybrid FTS + vector
/memex:save [title]Save current context as a memo
/memex:load <topic>Load past context into the current session
/memex:synthesizeFind patterns across recent memos — contradictions, drift
/memex:statusShow vault statistics
/memex:maintainCheck vault health — broken links, orphans
/memex:mergeSynthesize multiple memos into a concept note
/memex:openOpen vault in Finder/Obsidian
/memex:retryRetry failed memo generations

Automatic Hooks

The plugin hooks into Claude Code’s session lifecycle automatically:
HookWhenWhat
SessionStartNew sessionLoads project context, recent memos, open threads
UserPromptSubmitEach messageTracks activity, nudges to save after ~20 messages
SessionEndSession closesArchives transcript
PreCompactBefore compactionWrites signal file for safety-net memo generation

Research Workflow Example

Week 1: You and Claude analyze 20 papers, develop initial coding framework. Memex captures the framework rationale and which papers were pivotal. Week 3: You return after a break. /memex:search coding framework loads the context — not just the framework itself, but why you made each decision. Week 5: You’re writing up methodology. /memex:synthesize surfaces how your analytical approach evolved across sessions, giving you the reflexivity narrative for your paper.

Installation

Prerequisites

Required

Optional

  • Obsidian for visual graph navigation
  • GEMINI_API_KEY or LM Studio for semantic search (keyword search works without it)

Quick Start

# 1. Clone
git clone https://github.com/linxule/memex-plugin.git ~/memex

# 2. Install as plugin
claude plugin marketplace add ~/memex
claude plugin install memex@memex-plugins --scope user

# 3. Run setup
cd ~/memex
uv run scripts/setup.py

# 4. Restart Claude Code to load hooks
claude
For quick testing without persistent install:
claude --plugin-dir ~/memex

Configuration

Create ~/.memex/config.json to customize your vault location:
{
  "memex_path": "/path/to/your/memex/vault",
  "session_context": {
    "verbosity": "standard"
  }
}
See config.json.example in the plugin repo for all available options.

Import Existing Sessions

If you’ve been using Claude Code already, you have transcripts worth importing. The discover_sessions.py tool scores existing sessions by file edits, commits, and duration to find the ones with real collaborative work:
# See what's available
uv run scripts/discover_sessions.py --triage

# Import and rebuild index
uv run scripts/discover_sessions.py --import --apply
uv run scripts/index_rebuild.py --incremental

Semantic Search (Optional)

Without embeddings, keyword search (FTS5) works out of the box. For semantic search:
# Option A: LM Studio (fully local, recommended)
# Install LM Studio, load an embedding model, start server

# Option B: Gemini API
export GEMINI_API_KEY=your-key

# Build embeddings
uv run scripts/index_rebuild.py --full

Part of the Research Memex Ecosystem

Memex Plugin works alongside: