Codex CLI
Nowledge Mem integration for Codex via custom prompts, optional AGENTS.md guidance, and direct nmem CLI composition.
Prompt-native workflow package
Codex currently gives you strong native surfaces like custom prompts, AGENTS.md, skills, and MCP, but not a Gemini-style packaged extension. The recommended Nowledge path is a prompt pack plus project guidance, backed directly by nmem.
This integration keeps Codex simple: install reusable prompts, optionally merge a project AGENTS.md, and let nmem handle local and remote memory operations.
Your first success state
You know the setup is working when the prompts appear in Codex, nmem status works, and one memory read, search, or real session save succeeds without extra glue code.
Before You Start
- Nowledge Mem running locally (installation) or a reachable remote Mem server
- Codex CLI installed
nmemCLI in yourPATH
Setup
Install nmem
# Option 1 — uvx
curl -LsSf https://astral.sh/uv/install.sh | sh
uvx --from nmem-cli nmem --version
# Option 2 — pip
pip install nmem-cliIf Nowledge Mem is already running on the same machine through the desktop app, the cleanest setup is Settings -> Preferences -> Developer Tools -> Install CLI.
Install the custom prompts
curl -fsSL https://raw.githubusercontent.com/nowledge-co/community/main/nowledge-mem-codex-prompts/install.sh | bashRestart Codex after installation.
Optionally merge the project AGENTS.md
If your project already has an AGENTS.md, merge the Nowledge section instead of overwriting the file.
curl -O https://raw.githubusercontent.com/nowledge-co/community/main/nowledge-mem-codex-prompts/AGENTS.mdConfigure remote Mem the durable way when needed
{
"apiUrl": "https://mem.example.com",
"apiKey": "nmem_your_key"
}nmem resolves connection settings in this order:
--api-urlNMEM_API_URL/NMEM_API_KEY~/.nowledge-mem/config.json- defaults
Commands
Inside a Codex chat, type / and search for memory, save, distill, or search, or use these directly:
| Command | What it does |
|---|---|
/prompts:read_working_memory | Load your daily Working Memory briefing |
/prompts:search_memory | Search Nowledge Mem before answering |
/prompts:save_session | Save the real Codex session with nmem t save --from codex |
/prompts:distill | Distill high-value insights into memories |
Why This Path
Codex has several good native integration paths today: custom prompts, project AGENTS.md, skills, and MCP.
For Nowledge Mem, the recommended Codex package is still a workflow package, not a fake packaged extension:
- prompts provide fast explicit entry points
AGENTS.mdgives project-level memory behavior without hiding itnmemstays the single execution path for local and remote memory operations
That keeps the integration durable and keeps the user's mental model clear.
Direct nmem Use
Common examples:
nmem --json wm read
nmem --json m search "auth token rotation" --mode deep
nmem --json t save --from codex -p . -s "Finished the auth refactor and verified the new refresh-token flow."
nmem --json m add "JWT refresh failures came from gateway and API clock skew." --title "JWT refresh failures traced to clock skew" --importance 0.9 --unit-type learning -l auth -l backend -s codex