Skip to content

Long-term Memory #8368

Closed
Closed

Description

@jgh0sh

What feature would you like to see?

Already shared this with @tibo-openai, but I think adaptive, long-term memory in Codex would make the UX better.

Context
I've been really annoyed with correcting Codex multiple times about a certain way to do a very niche thing (like setting a specific timeout to run tests). I also don’t like how Codex often self corrects its approach in its COT but never actually preserves the lessons. AGENTS.md is not good enough for these cases because it requires manual updates - and, typically, developers can’t precisely describe their preferences. It’s also pretty expensive for the developer to context switch and update AGENTS.md every time something interesting happens.

Related Issues
#6532 (explains the same issue described here).

Proof of Concept
I implemented a basic POC of memories in a fork.

I considered memories as simple notes stored in memories.md. After a normal user turn completes, Codex gathers the user’s text plus recent tool outputs from the tail of history, sends that combined text to a small “extract memories” prompt, and expects short bullet memories back. It filters out empty memories, dedupes, and appends the new items. Codex also skips this flow for exec/sub-agent sessions and caps sizes so it doesn’t grow without limits.

Happy to discuss alternatives.

Additional information

I understand the roadmap is predefined but Claude Code is getting long-term memory very soon.

I also should acknowledge other efforts in the past to add memory, like #4655, were closed. Perhaps the timing wasn't right.

Activity

  1. added
    enhancement
    on Dec 20, 2025
  2. github-actions commented on Dec 20, 2025

    @github-actions
    Contributor
  3. jgh0sh commented on Dec 20, 2025

    @jgh0sh
    Author

    Not duplicates and I’ve already cited one of those issues as related.

  4. alexander-azizi-martin commented on Dec 20, 2025

    @alexander-azizi-martin

    I've faced similar issues and think this would be a great addition

  5. styler-ai commented on Dec 23, 2025

    @styler-ai

    HI Team. I let codex cli create a cline memory skill and from now on always have a project specific cline memory bank in the project folder under .codex/memory/... I more or less copied the cline way of doing it. codex 5.2 xhigh is updating it constantly after each run, works like a charm.

  6. jgh0sh commented on Dec 23, 2025

    @jgh0sh
    Author

    @styler-ai I’ve also been playing around with a memory skill. See repo..

    I think it’s a temporary solution. Memory should be baked into the structure of the agent.

    Can you share the repo for the cline skill? I’d be open to trying it out.

  7. COWI-MI commented on Jan 22, 2026

    @COWI-MI

    As an alternative, AGENTS.md could be used instead of a memories.md file.
    If so, I would prefer that Codex asks the user if it should add a learned preference to the file, so the user stays in control.

  8. jgh0sh commented on Feb 27, 2026

    @jgh0sh
    Author

    Claude Code officially supports memory following the spec I defined (a memory markdown file).

    I'm sure the team here is hard at work building something similar to support continual learning, but let this comment serve as a nudge.

  9. jgh0sh commented on Feb 27, 2026

    @jgh0sh
    Author

    As an alternative, AGENTS.md could be used instead of a memories.md file. If so, I would prefer that Codex asks the user if it should add a learned preference to the file, so the user stays in control.

    @COWI-MI You are able to edit the memory values in memories.md. I think it's important to separate explicit instructions (AGENTS.md) from learned instructions (memory).

  10. COWI-MI commented on Feb 27, 2026

    @COWI-MI

    related discussion: #12567

  11. added
    agent
    on Mar 26, 2026
  12. jgh0sh commented on Apr 16, 2026

    @jgh0sh
    Author

    Codex is rolling out memory.

    Probably time to close this 🥲. What do you think @etraut-openai?

  13. etraut-openai commented on Apr 16, 2026

    @etraut-openai
    Contributor

    Yes, it's time to close this. We announced today that memory support is now available in preview. Please give it a try! Open bug reports if you run into issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions