First-time setup for the memex plugin.
- Claude Code CLI installed and working
- Python 3.11+ with
uvpackage manager - Optional:
GEMINI_API_KEYfor semantic search (keyword search works without it) - Optional: Obsidian for visual graph navigation
Install directly from GitHub (inside a Claude Code session):
# 1. Add marketplace and install
/plugin marketplace add linxule/memex-plugin
/plugin install memex@memex-plugins --scope user
# 2. Restart Claude Code to load hooks
# Exit current session (Ctrl+C) and start fresh
claudeOr from a local clone (if you want to customize or develop):
git clone https://github.com/linxule/memex-plugin.git ~/memex
/plugin marketplace add ~/memex
/plugin install memex@memex-plugins --scope user
claude~/.memex/
├── config.json # Your settings (create manually, see below)
├── logs/ # Debug logs + nightly rebuild output (auto-created)
├── locks/ # Session locks (auto-created)
└── pending_memos/ # Failed memo queue (auto-created)
memex/
├── projects/<name>/memos/ # Session memos per project
├── projects/<name>/transcripts/ # Full conversation logs
├── topics/ # Cross-project concepts
├── _index.sqlite # Search index (auto-created)
└── MEMORY.md # Global synthesis
Create ~/.memex/config.json to customize settings:
{
"memex_path": "/path/to/your/memex/vault",
"embeddings": {
"provider": "google",
"model": "gemini-embedding-2-preview",
"dimensions": 3072,
"api_key_env": "GEMINI_API_KEY"
}
}See config.json.example in the repo for all options.
Retrieval is skill-based — Claude invokes the recall skill automatically
when you ask about past work. There's no "verbosity" setting to tune; skills
decide how much to load based on the question. Use memex search,
memex timeline, and memex ask from the CLI when you want direct access.
For AI-powered semantic search (finds conceptually similar content):
# Set Gemini API key
export GEMINI_API_KEY=your-key-here
# Build embeddings
memex index rebuild --fullWithout the API key, keyword search (FTS5) still works perfectly.
# 1. Check plugin is enabled
claude plugin list | grep memex
# 2. Start a session and check hooks loaded
claude
/hooks # Should show SessionStart, SessionEnd, PreCompact
# 3. Test search
/memex:status
# 4. Test that hooks work
/compact # Should generate memo (check projects/*/memos/)- Restart Claude Code - Hooks are captured at session startup
- Check plugin enabled -
claude plugin list - Check hooks registered -
/hooksin a session - Run with debug -
claude --debugto see hook execution
If memos save to wrong location:
- Create
~/.memex/config.jsonwith explicitmemex_path - Restart Claude Code
- Check index status:
memex status - Rebuild if needed:
memex index rebuild --incremental - For semantic search, ensure
GEMINI_API_KEYis set
# Remove plugin
claude plugin uninstall memex@memex-plugins
# Remove state (optional - keeps your memos)
rm -rf ~/.memex
# Remove vault data (CAUTION - deletes all memos)
rm -rf ~/memexRe-chunk new docs and retry any embeddings that failed during the day.
A generic scripts/nightly-rebuild.sh is shipped — wire it into launchd
(macOS) or cron.
The shell script already handles sourcing ~/.secrets for your
GEMINI_API_KEY, falls back to FTS-only if unavailable, and retries
missing embeddings via memex index embed-missing. Exit codes:
0 = clean, 1 = rebuild failed, 2 = embed gaps remain, 3 = secrets
file exists but couldn't be sourced.
Create ~/Library/LaunchAgents/com.<yourname>.memex.nightly.plist
(adjust paths):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.YOURNAME.memex.nightly</string>
<key>ProgramArguments</key>
<array>
<string>/bin/bash</string>
<string>-l</string>
<string>/ABSOLUTE/PATH/TO/memex/scripts/nightly-rebuild.sh</string>
</array>
<key>StartCalendarInterval</key>
<dict><key>Hour</key><integer>3</integer><key>Minute</key><integer>0</integer></dict>
<key>StandardOutPath</key>
<string>/Users/YOURNAME/.memex/logs/nightly-rebuild.log</string>
<key>StandardErrorPath</key>
<string>/Users/YOURNAME/.memex/logs/nightly-rebuild-error.log</string>
<key>ProcessType</key><string>Background</string>
<key>LowPriorityIO</key><true/>
<key>Nice</key><integer>10</integer>
</dict>
</plist>Install: launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.YOURNAME.memex.nightly.plist
Test immediately: launchctl kickstart gui/$(id -u)/com.YOURNAME.memex.nightly
On Linux, a cron entry like 0 3 * * * /path/to/scripts/nightly-rebuild.sh
achieves the same.
- Read CLAUDE.md for full documentation
- Run
memex statusto see vault statistics - Run
memex search "<query>"to find past decisions - Ask Claude a question like "what did I work on yesterday?" — the
recallskill handles retrieval automatically