Stop putting your AI agent’s memory inside the LLM context window

Reddit r/AI_Agents News

Summary

The article argues that AI agent memory and state should not be stored in the LLM context window, but rather in a separate transactional database, with deterministic control flow, treating the LLM as a judgement layer for unstructured inputs.

Hey everyone, been shipping a few agentic workflows into production lately and wanted to rant/share a massive architectural mistake I keep seeing people make. Stop treating the LLM context window or massive vector embedding as your agent’s long term memory. If your agent needs to hold state, remember past false positives, handle a human in the loop workflow or maintain an audit trail, passing a giant JSON blob of session history back and forth into the prompt is just a recipe for silent failures and terrible token bills. The only architecture that’s actually surviving production for us relies on a strict separation of concerns. First, durable state and memory has to live completely outside the agent in a boring, highly structured transactional database like Postgres or Lakebase. The agent should just read from it on boot and write to it on tool execution. It shouldn’t be the database. Second, use deterministic control flow. If you have an explicit business constraint like “always as a human before writing data”, code that logic into Python or a state graph framework like Langgraph. Don’t rely on system prompts to enforce safety boundaries. Lastly, treat the LLM as a judgement layer. Use the model strictly for processing the unstructured inputs, generating tool parameters or summarising evidence. Moving the state layer to a dedicated DB means that we can actually pause, replay and unit test agent execution without worrying about context drift or hallucinations wiping out the agent‘s history. Curious to hear how others are handling persistent state for multi-day workflows? Are you wrapping everything in custom SQL tables or relying on framework memory features? .
Original Article

Similar Articles

Human-Inspired Memory Architecture for LLM Agents

arXiv cs.AI

Microsoft researchers propose a biologically-inspired memory architecture for LLM agents that incorporates mechanisms like sleep-phase consolidation and interference-based forgetting to manage persistent memory efficiently.

@akshay_pachaar: Agents without memory aren't agents at all. An LLM can appear to remember because the application keeps sending previou…

X AI KOLs Timeline

Akshay Pachare explains how AI agent memory works across short-term (semantic, episodic, procedural) and long-term scopes, and introduces Oracle AI Agent Memory, a model- and framework-agnostic Python package built on Oracle AI Database that provides governed threads, summaries, durable memories, and scoped retrieval with significantly lower token usage than flat history.