memories.sh logomemories.sh
Integrations

Codex

Integrate memories.sh with OpenAI Codex CLI.

Codex is OpenAI's CLI coding agent. It reads instructions from AGENTS.md and the .agents/ directory.

Quick Setup

cd your-project
memories init

This automatically:

  1. Sets up your local memory store
  2. Configures MCP for supported tools
  3. Generates instruction files with your existing memories

Manual Setup

Option 1: Generated File

memories generate agents

This creates the canonical .agents/ directory that Codex reads for project context. Codex also reads AGENTS.md at the project root.

Option 2: MCP Server

Codex has built-in MCP support. Configure it to use memories.sh:

{
  "mcpServers": {
    "memories": {
      "command": "npx",
      "args": ["-y", "@memories.sh/cli", "serve"]
    }
  }
}
  1. Generated file — Provides instructions Codex always sees via AGENTS.md
  2. MCP server — Gives Codex live access to search, recall, and add memories

Syncing Codex Config

To sync your Codex configuration across machines:

# On your main machine
memories files ingest

# On a new machine
memories files apply --global --force

On this page