Research Plugins
Memex Plugin: Persistent Research Memory
A Claude Code plugin that preserves collaborative AI-human work across sessions — persistent, searchable, interconnected memos in an Obsidian vault.
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.
Info
Created by: Xule Lin
GitHub: linxule/memex-plugin
Core 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 | |
|---|---|---|
| Scope | Session-scoped preferences | Cross-session archive |
| Captures | Conventions, patterns | Full transcripts + structured memos |
| Granularity | Key-value pairs | Per-compaction-window transcripts |
| Search | Exact match | Hybrid 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
| Command | What 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:synthesize | Find patterns across recent memos — contradictions, drift |
/memex:status | Show vault statistics |
/memex:maintain | Check vault health — broken links, orphans |
/memex:merge | Synthesize multiple memos into a concept note |
/memex:open | Open vault in Finder/Obsidian |
/memex:retry | Retry failed memo generations |
Automatic Hooks
The plugin hooks into Claude Code's session lifecycle automatically:
| Hook | When | What |
|---|---|---|
SessionStart | New session | Loads project context, recent memos, open threads |
UserPromptSubmit | Each message | Tracks activity, nudges to save after ~20 messages |
SessionEnd | Session closes | Archives transcript |
PreCompact | Before compaction | Writes 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
- Claude Code CLI
- Python 3.10+ with uv
Optional
- Obsidian for visual graph navigation
GEMINI_API_KEYor 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
claudeFor quick testing without persistent install:
claude --plugin-dir ~/memexConfiguration
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 --incrementalSemantic 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 --fullPart of the Research Memex Ecosystem
Memex Plugin works alongside:
- Interpretive Orchestration Plugin — Persistent memory across stages of qualitative analysis
- Obsidian Setup Guide — Your knowledge management hub where memos live
- Claude Code Setup Guide — The research environment where Memex operates