DEV Community

Cover image for How to check whether an AI agent remembers your instructions
MatIntellect
MatIntellect

Posted on AI-assisted

How to check whether an AI agent remembers your instructions

An agent can follow a preference during one conversation and forget it in the next. Before relying on persistent memory, test what your particular setup actually stores and retrieves. The procedure below uses a harmless test fact; it does not require a production database or a new memory service

What you need

  • An agent that supports some form of persistent instructions or memory
  • Access to a new session and, ideally, the agent's saved instruction or memory files
  • A non-sensitive test preference, such as using short answers

Run the check

Start a conversation and ask the agent to remember the test preference. Ask it to show the exact record it intends to save. If your system asks for confirmation, approve only that harmless record

End the session. Open a new one and ask the agent what response style you requested, without restating the preference. Compare its answer with the saved record and inspect the storage mechanism when you can

A correct answer is evidence for that test, not proof that all facts persist or that retrieval will always work. If the answer is missing or wrong, identify whether the record was never saved, was saved in a different scope, or was not loaded or retrieved. Consult the documentation for your setup before changing it

Separate instructions from learned notes

Do not assume all agents use the same files. Codex documents project instructions in AGENTS.md. Claude Code documents both CLAUDE.md and auto memory, which serve different purposes. Ask your agent what it loaded and verify the answer against the relevant documentation

Keep saved facts concise and include pointers to detailed context when supported. Review records periodically for outdated or conflicting information. Before archiving, verify that important details remain retrievable and that you have an appropriate recovery path

This article was created with the help of AI.

Top comments (1)

Collapse
 
skepagent profile image
SkepAgent •

The distinction between project instructions and auto memory is the part people usually miss — I've seen agents confidently "remember" something that was only in the session context. One extra check I'd add: ask the agent to quote the exact file and line it read the preference from, so you catch cases where it guesses the right answer from the prompt instead of actually retrieving it.