≈ Database / Caching / Session State Management
Mechanisms for agents to store, index, and retrieve information over time, spanning short-term (conversation context) and long-term (knowledge base/episodic) history. This gives the agent a sense of continuity and identity.
Mechanisms for agents to store, index, and retrieve information over time, spanning short-term (conversation context) and long-term (knowledge base/episodic) history. This gives the agent a sense of continuity and identity.
1# Traditional Session2user_session = db.get_user_session(user_id)3last_action = user_session['last_action']1# Vector Database Retrieval (Long-Term Memory)2relevant_memories = vector_db.similarity_search(3 query=current_user_input4)56# Inject memories into prompt context (Short-Term Memory Loading)7agent.run(8 input=current_user_input,9 context=relevant_memories10)Traditional SWE
Database / Caching / Session State
Agentic Pattern
Memory Management
Persistence of state is crucial for both. Short-term memory ≈ RAM/Redis (Session Store); Long-term memory ≈ Disk/SQL/NoSQL (Persistent Store).
Agentic memory is often Vector-based (semantic similarity) rather than Key-Value or Relational. Retrieval is probabilistic (getting "relevant" memories based on embedding distance) rather than exact (getting "row ID 123").
Storing everything in context windows is expensive. Efficient RAG and summarization strategies are needed to manage the "Context Window Economy."
Long-term memory risks storing PII indefinitely. Implementation of "Forgetting" mechanisms and strict data governance is required.
Adapt: Database schema design is replaced by "Information Retrieval Strategy." You don't just query data; you curate context. You must decide what the agent needs to know to be effective.
BuildBuild a Context-Aware Chatbot. Create a chatbot that maintains conversation context using short-term memory and retrieves relevant past interactions from long-term memory to personalize responses.
Mechanisms for agents to store, index, and retrieve information over time, spanning short-term (conversation context) and long-term (knowledge base/episodic) history. This gives the agent a sense of continuity and identity.
Persistence of state is crucial for both. Short-term memory ≈ RAM/Redis (Session Store); Long-term memory ≈ Disk/SQL/NoSQL (Persistent Store). However, there is a key divergence: Agentic memory is often Vector-based (semantic similarity) rather than Key-Value or Relational. Retrieval is probabilistic (getting "relevant" memories based on embedding distance) rather than exact (getting "row ID 123").
Storing everything in context windows is expensive. Efficient RAG and summarization strategies are needed to manage the "Context Window Economy." Long-term memory risks storing PII indefinitely. Implementation of "Forgetting" mechanisms and strict data governance is required.