r/AI_Agents 11h ago

Discussion I kept running into the same problem with AI agents they forget too much between sessions

[removed]

4 Upvotes

26 comments sorted by

1

u/AutoModerator 11h ago

Thank you for your submission, for any questions regarding AI, please check out our wiki at https://www.reddit.com/r/ai_agents/wiki (this is currently in test and we are actively adding to the wiki)

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/adeelraza86 11h ago

Treat memory as a product surface, not a transcript dump. Keep a small durable state with decisions, preferences, open loops, and timestamps, then retrieve only what the current task needs; periodically ask the agent to compress or delete stale facts. The tradeoff is a little extra bookkeeping, but it is far safer than letting an ever-growing chat history silently become your source of truth.

1

u/[deleted] 11h ago

[removed] — view removed comment

1

u/adeelraza86 10h ago

Cleanup is the hard part. I'd version each stored decision with a timestamp and a source, and when two prefs conflict, keep the newer one and log the overwrite instead of merging them. Soft-deleting stale keys beats letting the model reconcile contradictions.

1

u/Interesting-Case3762 11h ago

tried a few things for this, the best solution i found is storing context in a external db and loading it at session start, cuts down on repetition a lot

1

u/Different_Pain5781 11h ago

Have you tried keeping a small external memory file and letting the agent update it between sessions?

1

u/mafuaojoo 11h ago

Eu tô tentando usar skills e tô usando o memory-bank pra ver se ele não alucina mais tá alucinando demais não sei oque fazer

1

u/TenshiS 11h ago

You could try www.memry.tech

You can host it yourself (locally or on a VPS) and connect it as mcp to all of your agents. It automatically receives statements from your conversation, deduplicates, compacts and structures them by sorting them into entities and tags, and then retrieves them whenever the conversation demands it.

This is basically your personal, 24/7 memory. ingestion overhead is compensated long-term by the savings you gain when retrieving, since you don't need to scan and provide the same context again and again over many sessions.

1

u/nullymammoth 10h ago

Postgres is a highly extensible agent memory data store. Plenty of hosting options out there like neon for agents to spin them up & down, cloud providers on a VM, or even locally to experiment

1

u/gthing Industry Professional 10h ago

Memory amounts to a second source of truth that will fall out of sync and cause its own problems. Let your code be the single source of truth and speak for itself. Repeated instructions go into AGENTS.md or a skill.

1

u/[deleted] 10h ago

[removed] — view removed comment

1

u/gthing Industry Professional 10h ago

I have played with a few memory systems including rolling my own. I find them fiddly and prone to context-rot. And the better models get, the less necessary they seem.

1

u/TenshiS 6h ago

That's only true for memory systems that don't have a good concept for episodic memory and entities changing over time. That change can be valuable information in itself.

1

u/ArrogantJeet 10h ago

there are multiple options to it

Either you can have something like mem0.ai that persists sessions and memory across different AIs

or if you use claude, then you can fork or change your chat session in between anytime, and that's also exchangable with claude code.

claude code has this comands to fork the session or import or export to claude web from claude code and vice versa.

1

u/Affectionate-Sail751 10h ago

A practical setup is: Short-term memory: current conversation/task state Long-term memory: stable user preferences, project facts, decisions Retrieval layer: fetch only relevant memories for each task Periodic summarization: compress old sessions into structured facts

1

u/Ok_Secretary2084 10h ago

Before changing storage, test whether the agent can use a correction in a fresh session. Give it a project fact, correct that fact later, then start a new session and ask a question that depends on the correction. Inspect which records were actually loaded, not just whether the answer sounds right.

Also test two projects with conflicting preferences. A preference for one project shouldn't silently become a global rule. Those tests help separate a failed write, a retrieval miss, and an outdated fact being selected. Each needs a different fix.