Overview
TencentDB-Agent-Memory is an open-source solution for persistent AI agent memory that runs entirely locally. Using a 4-tier progressive pipeline (working → short-term → long-term → archival), it enables agents to remember past interactions, learn from experience, and maintain context across sessions — all without any external API calls or cloud dependencies. The project has rapidly grown to 8,000+ stars.
Features
- ✓4-tier progressive memory pipeline (working, short-term, long-term, archival)
- ✓Fully local with zero external API dependencies
- ✓Semantic retrieval of past agent experiences
- ✓Persistent storage across sessions and agent restarts
- ✓Privacy-preserving (data never leaves the device)
Installation
pip install tencentdb-agent-memoryPros
- +Fully local — no privacy concerns or API costs
- +Progressive pipeline optimizes storage and retrieval
- +Zero external LLM dependencies for memory management
- +Active development by Tencent Cloud team
Cons
- −Relatively new project with evolving API
- −Best for Python-based agent frameworks
- −May need tuning for specific agent architectures
Alternatives
Documentation
TencentDB-Agent-Memory: Fully Local Long-Term Memory for AI Agents
Overview
TencentDB-Agent-Memory (8,094 stars) is an open-source solution that delivers fully local long-term memory for AI agents using a 4-tier progressive pipeline — with zero external API dependencies. Developed by Tencent Cloud, it enables agents to remember past interactions, learn from experience, and maintain context across sessions, all while keeping data entirely on-device.
The project has rapidly grown to 8K+ stars and 581 stars gained today, reflecting the community's urgent need for practical, privacy-preserving agent memory solutions.
Features
- 4-tier progressive pipeline: Stages memory from working → short-term → long-term → archival, optimizing for both speed and retention
- Fully local operation: No external API calls, no cloud dependencies, no data leaving the device
- Zero LLM dependency: Memory management runs independently without requiring external language models
- Persistent storage: Memory survives agent restarts, session boundaries, and system reboots
- Semantic retrieval: Search past agent experiences by meaning, not just keywords, using local embeddings
How It Works
The 4-tier pipeline processes agent experiences progressively:
| Tier | Retention | Detail | Access Speed |
|---|---|---|---|
| Working | Session-only | Full detail | Instant |
| Short-term | Hours | Summarized | Sub-millisecond |
| Long-term | Days-weeks | Consolidated with semantic index | Milliseconds |
| Archival | Indefinite | Compressed | Hundreds of ms |
Installation
pip install tencentdb-agent-memory
Quick Start
from tencentdb_agent_memory import AgentMemory
# Initialize local memory store
memory = AgentMemory(storage_path="./agent_memory")
# Store an agent experience
memory.store(
experience="Fixed authentication bug in login flow",
context={"repository": "auth-service", "severity": "high"},
agent_id="coding-agent-1"
)
# Retrieve relevant past experiences
results = memory.query(
"How did we fix auth issues before?",
agent_id="coding-agent-1",
limit=5
)
# Memory persists across sessions
for result in results:
print(f"Past experience: {result.experience}")
Why It Matters
Agent memory remains one of the hardest unsolved problems in production AI systems. Most current approaches either:
- Rely on cloud APIs — introducing latency, cost, and privacy concerns
- Use simple context windows — losing information between sessions
- Require complex infrastructure — making deployment difficult
TencentDB-Agent-Memory's fully local approach addresses all three issues simultaneously, making it an attractive option for privacy-sensitive applications, offline deployments, and cost-constrained environments.
Pros
- ✅ Fully local — no privacy concerns or API costs
- ✅ Progressive pipeline optimizes storage and retrieval efficiency
- ✅ Zero external LLM dependencies for memory management
- ✅ Active development by Tencent Cloud team
Cons
- ❌ Relatively new project with evolving API
- ❌ Best suited for Python-based agent frameworks
- ❌ May need tuning for specific agent architectures
When to Use
Use TencentDB-Agent-Memory when:
- Your agents need persistent memory across sessions
- Privacy requirements prevent cloud-based memory solutions
- You're deploying agents in offline or air-gapped environments
- You want to minimize operational costs for agent memory
