pip install. The plugin captures your prompts, tool traces, and answers into session memory, injects relevant context on every prompt, and syncs the session into your knowledge graph on session end.
Sessions are disposable; your memory isnβt.
1. Enable hooks and install
The plugin depends on Codex lifecycle hooks. Enable them first, then install from the Codex marketplace:You can enable hooks manually instead by adding a
[features] section with hooks = true to ~/.codex/config.toml. If Codex prompts you to review the hooks, approve the Cognee hooks so it can call the plugin on prompt submit, tool use, stop, compaction, and session end.cognee: <dataset> Β· <mode> to confirm the plugin is active.
2. Point it at Cognee Cloud
Set both variables in the shell that launches Codex, using your tenant base URL and an API key:When
COGNEE_BASE_URL is set, the plugin runs as a pure thin HTTP client to your tenant β it does not install a local Cognee runtime. When COGNEE_BASE_URL is unset, the plugin instead bootstraps a local API at http://localhost:8011. Setting the Cloud URL and key is what routes memory to your tenant.3. Choose a dataset
All writes and recall are scoped to a single dataset, selected with theCOGNEE_PLUGIN_DATASET environment variable. By default both the Codex and Claude Code plugins use agent_sessions, so memory is shared across both integrations automatically.
Set a custom dataset at launch:
4. Pick a session (optional)
By default a newsession_id is generated on each launch. Set COGNEE_SESSION_ID to resume a specific named session, or to deliberately share one live session across two terminals:
5. Verify
Quit Codex β theSessionEnd hook syncs the session into Cognee (an exit-watcher fallback covers a hard exit). Then start a fresh session and ask:
What do you know from cognee?Answering from a clean session confirms itβs recalling from your Cloud memory.
Alongside automatic capture, the plugin ships skills you can invoke to remember or search explicitly β see the full integration guide.
Configuration reference
Precedence: environment variables β~/.cognee-plugin/config.json β defaults.
Update the plugin with
codex plugin marketplace upgrade cognee β the cognee marketplace tracks main, and updates are not automatic. See the full integration guide for the idle-watcher, session-sync, and update-notification variables.
Full integration guide
Manual config, hooks reference, and debugging
Claude Code
The same memory plugin for Claude Code