4.3 Memory and Knowledge 4.3.1 Memory



原 PPT 独立图片资源

4.3 Memory and Knowledge 4.3.1 Memory

原 PPT 独立图片资源

Why Do Agents Need Memory?


原 PPT 独立图片资源
Why Do Agents Need Memory?
Traditional LLMs:
Stateless / context-window only; every conversation “starts from scratch”
Real-world needs:
Long-horizon, multi-turn tasks: project assistants, learning coaches, dev copilots
Personalization: user preferences, past mistakes, long-term goals
Goals of agent memory:
Persistent learning across sessions
Automatically “recall” the most relevant past experiences and knowledge for the current task

Type of Memories


原 PPT 独立图片资源
Type of Memories
Inspired by human memory:
Semantic memory: facts, concepts, general knowledge
Episodic memory: concrete interactions and task experiences
Procedural memory: skills, strategies, workflows
Multi-level memory in typical systems:
Working / short-term memory: current conversation and active state
Long-term / persistent memory: cross-session, structured storage
Reflective memory: summaries and self-improvement based on past episodes

Recent Direction 1 — Structured and Hierarchical Memory


原 PPT 独立图片资源
Recent Direction 1 — Structured and Hierarchical Memory
Structured memory vs. flat vector retrieval:
Instead of “dump everything into a single vector store,” combine multiple structures: lists, trees, graphs, knowledge graphs, etc.
Representative work:
AriGraph: uses a “semantic knowledge graph + episodic nodes/edges” as a world model, significantly improving agents in text-based games
Zep / temporal KGs: graph-structured, time-aware memory for multi-turn dialogue and event tracking
Trend:
From simple bi-directional vector search to structured world models + hierarchical retrieval + reflective summarization

AriGraph


原 PPT 独立图片资源
AriGraph
Ariadne agent and its results
https://github.com/AIRI-Institute/AriGraph

Recent Direction 2 — Learning-Based and Adaptive Memory Policies


原 PPT 独立图片资源
Recent Direction 2 — Learning-Based and Adaptive Memory Policies
Problem: what to store, when to store, and how to retrieve are still often defined by hand (thresholds, scores, top-k, etc.).
Representative work:
Adaptive memory optimization for LLM agents: Uses off-policy / on-policy learning to let agents learn “what is worth remembering” and “how to encode it.”
Memory-augmented LLM agents : Cross-task training + dynamic memory retrieval to improve sample efficiency in multi-task, multi-turn instruction following.
Core trend:
Memory strategies are no longer purely hard-coded, but can be optimized via reinforcement learning or meta-learning.

Learning to Memorize


原 PPT 独立图片资源
Learning to Memorize
https://arxiv.org/pdf/2508.16629
原 PPT 独立图片资源

4.3 Memory and Knowledge 4.3.2 External Knowledge and Retrieval



原 PPT 独立图片资源

4.3 Memory and Knowledge 4.3.2 External Knowledge and Retrieval

原 PPT 独立图片资源

Agent need External Knowledge


原 PPT 独立图片资源
Agent need External Knowledge
Parameter Efficiency & Coverage
Impossible to internalize the ever-expanding corpus of human knowledge
On-demand retrieval fills rare or specialized information gaps
Up-to-Date & Dynamic Information
Static model parameters become stale as the world evolves
Live access to news, databases, and APIs ensures current answers
Grounding & Multi-Modality
Ties language to real-world entities (objects, sensor streams, images)
Knowledge graphs provide explicit commonsense (e.g., physics, causality)
Memory & Long-Term Interaction
External “memory” (vector DBs, key–value stores) for session history
Enables personalization and sustained, coherent dialogues

Coping with External Knowledge


原 PPT 独立图片资源
Coping with External Knowledge
External Knowledge
Recent News/Documents
Private Document/Email
Knowledge Graphs, Data Base
Private Images/Videos
…
How to use these knowledge?
Retrieve relevant information;
Generate response using these retrieved information.

RAG: Retrieval-Augmented Generation


原 PPT 独立图片资源
RAG: Retrieval-Augmented Generation
原 PPT 独立图片资源
https://github.com/hkproj/retrieval-augmented-generation-notes/blob/main/Slides.pdf

RAG Road Maps


原 PPT 独立图片资源
RAG Road Maps
https://github.com/hkproj/retrieval-augmented-generation-notes/blob/main/Slides.pdf
原 PPT 独立图片资源

What to Retrieve?


原 PPT 独立图片资源
What to Retrieve?
Different Information Level: Document, Chunk, Sentence, Words
High Level:
Rich Context & Coherence, Higher Recall, Simpler Indexing
Lower Precision / More Noise, Context‐Window Bloat
Suitable when you need comprehensive background or discourse coherence.
Low Level:
High Precision & Conciseness, Efficient Context Usage, Fine-Grained Control
Lack of Broader Context, Lower Recall
Suitable when you want pinpoint accuracy and to conserve prompt tokens.

Graph RAG


原 PPT 独立图片资源
Graph RAG
原 PPT 独立图片资源
https://arxiv.org/pdf/2404.16130
原 PPT 独立图片资源
https://microsoft.github.io/graphrag/

Knowledge Graph, Table, SQL Database, …


原 PPT 独立图片资源
Knowledge Graph, Table, SQL Database, …
Overview of PIKE-RAG Framework
https://github.com/microsoft/PIKE-RAG

Recall: How to Retrieve?


原 PPT 独立图片资源
Recall: How to Retrieve?
Inverted index + BM25
Embedding Vector + ANN Search
https://www.pinecone.io/learn/series/faiss/hnsw/
The search process through the multi-layer structure of an HNSW graph.
原 PPT 独立图片资源
https://medium.com/@mhammadkhan/neural-re-ranking-models-c0a67278f626

When to Retrieve


原 PPT 独立图片资源
When to Retrieve
User ‘s Intention: Web search Button
Intention Detection: Detect for each request in the dialog: Notebook LM
Low Confidence Detected: Call retrieve when unreliable answer found.
原 PPT 独立图片资源
原 PPT 独立图片资源
https://afforai.com/comparisons/notebook-lm-alternative

When to Retrieve


原 PPT 独立图片资源
When to Retrieve
https://arxiv.org/pdf/2305.06983
原 PPT 独立图片资源
原 PPT 独立图片资源