Everything you need to install, run, and maintain Memex in practice — from first install to backup and debugging.
npm install -g memexgit clone <repo>
cd memex
npm install
npm run build
npm link # makes 'memex' command available globallyThe daemon requires CAP_SYS_ADMIN for mount namespace isolation.
sudo cp systemd/memex.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now memex
# Check status
sudo systemctl status memex
# View logs
sudo journalctl -u memex -fThe systemd unit:
- Grants
CAP_SYS_ADMINviaAmbientCapabilities - Creates
/var/lib/memexand/run/memexautomatically - Restarts on failure with 5s backoff
- Protects the host filesystem (
ProtectSystem=strict)
sudo memex serveOr with capability grants (avoids running as root):
sudo setcap cap_sys_admin+ep $(which node)
memex serveFor non-standard paths:
MEMEX_DATA_DIR=/opt/memex/data \
MEMEX_RUN_DIR=/opt/memex/run \
memex servememex create research-wiki --name "Research Knowledge Base"This:
- Registers the wiki in SQLite
- Creates the directory structure under
/var/lib/memex/wikis/research-wiki/ - Seeds default
.claude.md,_schema.md,_index.md,_log.md - Validates the wiki directory exists
OAuth (recommended — uses your Claude subscription):
memex login research-wiki
# Copies your local Claude credentials into the wikiAPI key (uses API credits):
memex config research-wiki --set-key
# Paste your ANTHROPIC_API_KEY when promptedGlobal fallback:
Set ANTHROPIC_API_KEY as an environment variable on the daemon. All wikis without their own credentials will use this.
# Edit wiki conventions
memex config research-wiki --edit
# Change the model
memex config research-wiki --model opus
# View current config
memex config research-wiki# Remove everything
memex destroy research-wiki
# Remove registration but keep files
memex destroy research-wiki --keep-data
# Skip confirmation
memex destroy research-wiki --yes# Single file
memex ingest research-wiki paper.pdf
# Multiple files
memex ingest research-wiki notes.md report.pdf screenshot.png
# Non-blocking
memex ingest research-wiki paper.pdf --async
# Returns: Ingest job #42 submitted
# Check later: memex status research-wiki 42Supported formats: anything claude -p can handle — markdown, PDF, HTML, plain text, images (PNG, JPG), etc.
Files are copied into the wiki's wiki/raw/ directory with a timestamp prefix. The originals are never modified.
# Blocking (waits for answer)
memex query research-wiki "What are the main findings across all papers?"
# Non-blocking
memex query research-wiki "Summarize the pricing analysis" --asyncAnswers are grounded in the wiki content. Claude cites specific files and flags gaps in coverage.
# Manual lint
memex lint research-wiki
# Auto-lint runs automatically after every 10 ingestsThe lint checks for:
- Contradictions between pages
- Orphan pages with no inbound links
- Missing cross-references
- Index entries that don't match content
- Schema conventions that have drifted
# View audit log
memex logs research-wiki
memex logs research-wiki --tail 50
# Check job status
memex status research-wiki # list recent jobs
memex status research-wiki 42 # specific job details
# List all wikis
memex list# Is the daemon running?
curl --unix-socket /run/memex/memex.sock http://localhost/wikis 2>/dev/null# Files are plain markdown on disk
ls /var/lib/memex/wikis/research-wiki/wiki/
cat /var/lib/memex/wikis/research-wiki/wiki/_index.md"CAP_SYS_ADMIN is required"
The daemon needs namespace capabilities. Run with sudo, use systemd with AmbientCapabilities, or grant the capability to the Node.js binary.
"Cannot connect to memex daemon"
The daemon isn't running. Start it with memex serve.
"No credentials configured"
Run memex login <wiki> or memex config <wiki> --set-key.
Jobs stuck in "pending" Check the daemon logs. The queue drains serially — a long-running job blocks subsequent ones for the same wiki.
The entire state is in two locations:
/var/lib/memex/memex.db— SQLite database (wiki registry, job history, audit log)/var/lib/memex/wikis/— Wiki files, credentials, configuration
Back up both. The wiki files are plain markdown — they work with git, rsync, or any file backup tool.
# Example: git-based backup
cd /var/lib/memex/wikis/research-wiki
git init && git add -A && git commit -m "backup"- Disk: Proportional to wiki size. Raw sources are copied, so expect ~2x the source size.
- Memory: The daemon itself is lightweight. Each
claude -pprocess uses ~100-200MB. - CPU: Minimal between jobs. During a job, the
claudeCLI handles API communication. - Network: Only for Claude API calls. All wiki operations are local filesystem I/O.
- Concurrency: One active
claude -pprocess per wiki. Multiple wikis run in parallel.