
Agent context management has evolved significantly. What started as "keep the last N messages" has grown into a discipline of its own — deciding what enters the context window, how it's organized, and how to retrieve exactly what's needed without overflow.
This article traces the evolution and explains why structured memory assets matter.
The earliest approach: stuff all conversation history into the prompt. Every turn accumulates. Simple, but doesn't scale.
Cost grows linearly. Eventually you hit the model's context window limit and either truncate (losing information) or start a new session (losing everything).
The next step: summarize old conversations, store summaries as embeddings, and retrieve relevant ones via vector search.
This is what solutions like Mem0 and Letta do. It works for single-agent scenarios but has limitations:
TencentDB Agent Memory takes a different approach: instead of one undifferentiated "memory" store, it recognizes that agents reuse different types of information and manages each as a distinct asset type.
Asset | What It Stores | Why It's Not Just a Summary |
|---|---|---|
Chat Memory | User preferences, decisions, interaction history | Structured facts and constraints, not a paragraph summary |
Skill | Reusable workflows with versions, triggers, steps, validation | Executable process, not a description |
Wiki | Documents as structured pages with a link graph | Navigable structure, not a chunk |
CodeGraph | Code symbols, call relationships, impact paths | Graph index, not text match |
Even within Chat Memory, information is layered by granularity:
Layer | What It Stores | Primary Use |
|---|---|---|
L0 Conversation | Raw conversations with full context | Verify exact wording, timestamps, sources |
L1 Atom | Extracted facts, preferences, constraints, events | Precise recall of actionable information |
L2 Scenario | Knowledge blocks organized by project or scenario | Fast context recovery |
L3 Persona | Long-term user profile, stable patterns | Quick user and team understanding |
Retrieval: L2/L3 for fast guidance; BM25 + vector search + RRF for specific facts; hard limits on entry count, character budget, and timeout.
The core insight: context management isn't about compression — it's about relevance.
Summarization compresses everything equally. Layered memory with structured assets lets you retrieve exactly what the current task needs:
All within a character budget — memory enriches context without overflowing it.
Memory assets aren't locked into one agent framework. A Proxy sits between agents and the memory server — point any agent's base URL to it, done.
Supported: DeepSeek Harness · Claude Code · Codex · CodeBuddy · WorkBuddy · Hermes · OpenClaw
Switch frameworks? Your memory follows.
PersonaMem: 48% → 76% (+59%) with structured memory enabled.
git clone https://github.com/TencentCloud/TencentDB-Agent-Memory.git
cd TencentDB-Agent-Memory/deploy/global-images
./start-all.shPanel: http://localhost:8125
Repo: https://github.com/TencentCloud/TencentDB-Agent-Memory
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。