| name | help |
| description | Show how to use memex: what it does, how to create skills/rules/memories, available commands, current status, and troubleshooting. |
| queries | ["how does memex work","how to use memex","what skills are available","how to create a skill","how to create a rule","memex help","memex is not working","no skills are being injected"] |
/help — Memex Guide & Status
What is memex?
Memex injects relevant knowledge into your Codex session based on what you're working on. Instead of loading everything into context at once, it uses semantic similarity to surface only what's needed right now.
How it works
Each prompt you type is embedded locally (ONNX, no API calls) and compared against your indexed skills and memories. The top matches are injected as additional context via the UserPromptSubmit hook. Match counts are tracked via telemetry (~/.codex/cache/memex-telemetry.json).
Entry types and disclosure model:
| Type | First match | Subsequent matches | Matched on |
|---|
rule | Full content | one-liner reminder only | UserPromptSubmit |
memory | Full content | Full content | UserPromptSubmit |
skill | Description teaser | Full content (via Read) | UserPromptSubmit |
workflow | Description teaser | Full content (via Read) | UserPromptSubmit |
tool-guidance | Full content | Full content | PreToolUse |
stop-rule | Behavioral rules | — | Stop |
session-learning | Full content | Full content | UserPromptSubmit |
Bundled skills
| Command | Description |
|---|
/deep-sleep | Drain the Stop-hook learnings queue and analyze rollout JSONL transcripts to extract recurring patterns |
/reflect | Extract learnings from the current conversation and save as memories, rules, or skills |
/doctor | Diagnose installation and configuration issues |
/handoff | Write a continuation plan to disk so a fresh session can pick up where this one left off |
/help | This guide |
Creating content
Skills
Create ~/.codex/skills/<name>/SKILL.md (global) or <project>/.agents/skills/<name>/SKILL.md (project):
---
name: my-skill
description: "What this skill does"
queries:
- "when would someone need this"
- "another example query"
boost: 0.05
---
The skill content.
Rules
Rules are skills with type: rule frontmatter:
---
name: my-rule
description: "What this rule enforces"
type: rule
one-liner: "Short reminder for subsequent matches"
queries:
- "when this rule applies"
---
Full rule content shown on first match.
Memories
Memories live in ~/.codex/memex/projects/<encoded-cwd>/memory/*.md (where <encoded-cwd> is the cwd with / → -, . → -, _ → -).
Use ## headings for each entry and optionally add Triggers: lines for better semantic matching:
## Prefer pnpm
Triggers: install dependencies, npm install, which package manager
Use `pnpm` instead of `npm` for all operations.
Use /reflect to extract learnings from the current conversation, and /deep-sleep to process queued sessions from past Codex rollouts.
Check status
Run these to inspect memex's current state:
cat ~/.codex/memex.json 2>/dev/null || echo "Using defaults"
ls ~/.codex/skills/*/SKILL.md 2>/dev/null
ls .agents/skills/*/SKILL.md 2>/dev/null
ls ~/.codex/memex/projects/*/memory/*.md 2>/dev/null
cat ~/.codex/cache/memex-learnings-queue.json 2>/dev/null
ls -la ~/.codex/cache/memex-cache.json 2>/dev/null
cat ~/.codex/cache/memex-telemetry.json 2>/dev/null
ls ~/.codex/cache/models/ 2>/dev/null
codex plugin list 2>/dev/null | grep memex
Configuration
Create ~/.codex/memex.json to customize. All fields optional — defaults shown:
{
"enabled": true,
"embeddingModel": "Xenova/all-MiniLM-L6-v2",
"cacheTimeMs": 300000,
"skillDirs": [],
"sync": {
"enabled": false,
"repo": "",
"autoPull": true,
"autoCommitPush": true,
"projectMappings": {}
},
"hooks": {
"UserPromptSubmit": {
"enabled": true,
"topK"
Key tuning knobs:
threshold — lower to match more broadly (default 0.5), raise for precision
topK — how many matches to inject per prompt (default 3)
maxInjectedChars — character budget for injected content (default 8000)
hooks.Stop.extractLearnings — enqueue sessions to memex-learnings-queue.json for /deep-sleep
sync — enable cross-machine sync via a private git repo (see README)
Troubleshooting
| Symptom | Check |
|---|
| Nothing is being injected | Are there skills/memories in the scan paths? (see "Check status" above) |
| Wrong things are injected | Adjust threshold higher, or improve queries in your SKILL.md frontmatter |
| Skill barely misses threshold | Add boost: 0.05 to frontmatter to nudge its score up |
| Everything is injected | threshold may be too low, raise it (e.g. 0.6) |
| Slow first run | Model download (~23MB), needs internet access |
| Stale results after editing skills | Delete ~/.codex/cache/memex-cache.json to force rebuild |
| Hook not running at all | Run /doctor — verify plugin installed and hooks trusted via /hooks |
| Learnings not extracted | Enable hooks.Stop.enabled and extractLearnings in ~/.codex/memex.json |
$ARGUMENTS