Skip to content

AI assistant · Codex

Long-term memory for OpenAI Codex

Two lines in config.toml and a sign-in, and Codex searches your memory before it answers and saves what you build together. The CLI, the IDE extension and the desktop app share the setup.

What it does for Codex

AGENTS.md tells Codex how to work. Alexein gives it what AGENTS.md can’t hold: what you decided last week, who owns which service, the convention a reviewer asked for, and whatever your connected apps deliver. Codex searches it before it asks you or picks a default, and saves what you tell it.

It’s the same memory Claude Code, Cursor and Gemini CLI use, so work you start in one picks up in another.

Set it up

  1. Add the block below to ~/.codex/config.toml, creating the file if it doesn’t exist.
  2. Run codex mcp login alexein. In the desktop app or the IDE extension, select Authenticate on alexein instead. On a machine without a browser, add --no-browser.
  3. Sign in to Alexein, keep Read and save, and select Allow. Then start a new Codex session.
  4. Add the five lines from the docs to ~/.codex/AGENTS.md, so Codex searches first and saves without being asked.

Check it with codex mcp list, or /mcp in Codex: alexein is listed.

~/.codex/config.toml
[mcp_servers.alexein]
url = "https://api.alexein.ai/v1/mcp"

Every step, and a key for scripts and CI, is in the Codex setup guide.

What you can ask

  • “Add pagination to the orders endpoint the way we usually do it.” Codex searches memory for your team’s convention before choosing one.
  • “Why did we pin this dependency?” If the reason came up in a pull request, a Slack conversation or an earlier session, memory finds it, with who said it.
  • “Staging is reset every Sunday night.” Saved with memory_add. The next session, in the CLI or the app, knows it.

For scripts and CI

Where nobody is there to sign in, use a personal key. bearer_token_env_var names the environment variable that holds it, so the key is never written into the file.

If Codex ignores the lines

If ~/.codex/AGENTS.override.md exists, Codex reads it instead of AGENTS.md. Put the lines there, or remove the override.

Questions about Codex

Yes. The CLI, the IDE extension and the desktop app share one configuration, so you set it up once. In the app or the extension, you sign in with Authenticate.

No. codex mcp login opens Alexein’s sign-in in your browser. A personal key is for scripts and CI, where nobody is there to sign in.

A plugin that saves each Codex session to memory is planned. Today, Codex searches and saves through the hosted MCP server.

Give Codex a memory.

Sign up for My memory, add two lines to config.toml, and Codex starts from what you’ve already told it.