1# Memories1# Memories
2 2
3Memories are off by default. In the European Economic Area, the United3Memories let ChatGPT and Codex carry useful context from earlier work into
4 Kingdom, and Switzerland, Codex uses or generates memories only after you4future work.
5 enable them in Codex settings, or set `memories = true` in the `[features]`5ChatGPT web uses ChatGPT memory, while local Codex clients use a separate local
6 table in `~/.codex/config.toml`.6memory store and controls.
7
7 8
8Memories let Codex carry useful context from earlier threads into future work.
9After you enable memories, Codex can remember stable preferences, recurring
10workflows, tech stacks, project conventions, and known pitfalls so you don't
11need to repeat the same context in every thread.
12 9
13Keep required team guidance in `AGENTS.md` or checked-in documentation. Treat10Keep required team guidance in `AGENTS.md` or checked-in documentation. Treat
14memories as a helpful local recall layer, not as the only source for rules that11memories as a helpful recall layer, not as the only source for rules that must
15must always apply.12always apply.
16 13
17[Chronicle](https://developers.openai.com/codex/memories/chronicle) helps Codex recover recent working
18context from your screen to build up memory.
19 14
20## Enable memories
21 15
22In the Codex app, enable Memories in settings.
23 16
24For config-based setup, add the feature flag to `config.toml`:
25 17
26```toml18In the ChatGPT desktop app, use `/memories` to choose whether a task can use
27[features]19local memories or contribute to future memories. Manage the feature from
28memories = true20**Settings > Personalization** when you need to turn it on or off.
29```21
22
23
24
25
26
27
28
29
30
31
32[Chronicle](https://learn.chatgpt.com/docs/customization/chronicle) is a desktop-only feature that helps
33Codex recover recent working context from your screen to build up memory.
34
35
36
37<a id="how-memories-work"></a>
38<a id="memory-storage"></a>
39<a id="control-memories-per-thread"></a>
40<a id="control-memories-per-chat"></a>
41<a id="control-memories-per-task"></a>
42<a id="review-memories"></a>
30 43
31See [Config basics](https://developers.openai.com/codex/config-basic) for where Codex stores user-level
32configuration and how Codex loads `~/.codex/config.toml`.
33 44
34## How memories work45
46## How local Codex memories work
35 47
36After you enable memories, Codex can turn useful context from eligible prior48After you enable memories, Codex can turn useful context from eligible prior
37threads into local memory files. Codex skips active or short-lived sessions,49tasks into local memory files. Codex skips active or short-lived sessions,
38redacts secrets from generated memory fields, and updates memories in the50redacts secrets from generated memory fields, and updates memories in the
39background instead of immediately at the end of every thread.51background instead of immediately at the end of every task.
40 52
41Memories may not update right away when a thread ends. Codex waits until a53Memories may not update right away when a task ends. Codex waits until a
42thread has been idle long enough to avoid summarizing work that's still in54task has been idle long enough to avoid summarizing work that's still in
43progress.55progress.
44 56
45Memory generation can also skip a background pass when your Codex rate-limit57Memory generation can also skip a background pass when your Codex rate-limit
46remaining percentage is below the configured threshold, so Codex doesn't spend58remaining percentage is below the configured threshold, so Codex doesn't spend
47quota when you're near a limit.59quota when you're near a limit.
48 60
49## Memory storage61## Local memory storage
50 62
51Codex stores memories under your Codex home directory. By default, that's63Codex stores memories under your Codex home directory. By default, that's
52`~/.codex`. See [Config and state locations](https://developers.openai.com/codex/config-advanced#config-and-state-locations)64`~/.codex`. See [Config and state locations](https://learn.chatgpt.com/docs/config-file/config-advanced#config-and-state-locations)
53for how Codex uses `CODEX_HOME`.65for how Codex uses `CODEX_HOME`.
54 66
55The main memory files live under `~/.codex/memories/` and include summaries,67The main memory files live under `~/.codex/memories/` and include summaries,
56durable entries, recent inputs, and supporting evidence from prior threads.68durable entries, recent inputs, and supporting evidence from prior tasks.
57 69
58Treat these files as generated state. You can inspect them when troubleshooting70Treat these files as generated state. You can inspect them when troubleshooting
59or before sharing your Codex home directory, but don't rely on editing them by71or before sharing your Codex home directory, but don't rely on editing them by
60hand as your primary control surface.72hand as your primary control surface.
61 73
62## Control memories per thread74## Control local memories per task
63 75
64In the Codex app and Codex TUI, use `/memories` to control memory behavior for76In the ChatGPT desktop app and Codex TUI, use `/memories` to control memory behavior for
65the current thread. Thread-level choices let you decide whether the current77the current task. Task-level choices let you decide whether the current
66thread can use existing memories and whether Codex can use the thread to78task can use existing memories and whether Codex can use the task to
67generate future memories.79generate future memories.
68 80
69Thread-level choices don't change your global memory settings.81Task-level choices don't change your global memory settings.
82
83## Review local memories
84
85Don't store secrets in memories. Codex redacts secrets from generated memory
86fields, but you should still review memory files before sharing your Codex home
87directory or generated memory artifacts.
88
89<a id="enable-memories"></a>
90<a id="configuration"></a>
70 91
71## Configuration92## Configure local memories
72 93
73Enable memories in the Codex app settings, or set `memories = true` in the94Local Codex memories are off by default. In the ChatGPT desktop app, open
74`[features]` section of `config.toml`.95**Settings > Personalization** and turn on **Enable memories**.
75 96
76For config file locations and the full list of memory-related settings, see the97For config-based setup, add the feature flag to `config.toml`:
77[configuration reference](https://developers.openai.com/codex/config-reference).98
99```toml
100[features]
101memories = true
102```
103
104For config file locations and the full list of memory-related settings, see
105[Config basics](https://learn.chatgpt.com/docs/config-file/config-basic) and the [configuration
106reference](https://learn.chatgpt.com/docs/config-file/config-reference).
78 107
79Common memory-specific settings include:108Common memory-specific settings include:
80 109
81- `memories.generate_memories`: controls whether newly created threads can be110- `memories.generate_memories`: controls whether newly created tasks can be
82 stored as memory-generation inputs.111 stored as memory-generation inputs.
83- `memories.use_memories`: controls whether Codex injects existing memories into112- `memories.use_memories`: controls whether Codex injects existing memories into
84 future sessions.113 future sessions.
85- `memories.disable_on_external_context`: when `true`, keeps threads that used114- `memories.disable_on_external_context`: when `true`, keeps tasks that used
86 external context such as MCP tool calls, web search, or tool search out of115 external context such as MCP tool calls, web search, or tool search out of
87 memory generation. The older `memories.no_memories_if_mcp_or_web_search` key116 memory generation. The older `memories.no_memories_if_mcp_or_web_search` key
88 is still accepted as an alias.117 is still accepted as an alias.
89- `memories.min_rate_limit_remaining_percent`: controls the minimum remaining118- `memories.min_rate_limit_remaining_percent`: controls the minimum remaining
90 Codex rate-limit percentage required before memory generation starts.119 Codex rate-limit percentage required before memory generation starts.
91- `memories.extract_model`: overrides the model used for per-thread memory120- `memories.extract_model`: overrides the model used for per-task memory
92 extraction.121 extraction.
93- `memories.consolidation_model`: overrides the model used for global memory122- `memories.consolidation_model`: overrides the model used for global memory
94 consolidation.123 consolidation.
95
96## Review memories
97
98Don't store secrets in memories. Codex redacts secrets from generated memory
99fields, but you should still review memory files before sharing your Codex home
100directory or generated memory artifacts.