| name | agentdb-memory-patterns |
| description | Implement persistent memory patterns for AI agents using AgentDB — session memory, long-term storage, pattern learning, hierarchical memory, consolidation, ReasoningBank migration. Use when building stateful agents, chat systems, or intelligent assistants. NOT for distributed multi-DB/QUIC sync or RL algorithms (use agentdb-advanced), vector-search perf tuning (use agentdb-vector-search), or non-persistent session state. |
AgentDB Memory Patterns
For AgentDB architecture and performance overview, see AgentDB Overview.
What This Skill Covers
Memory management patterns for AI agents: session memory, long-term storage, pattern learning, hierarchical memory organisation, memory consolidation, and ReasoningBank migration. For CLI setup, API initialisation, and common operations, see the AgentDB Overview.
Additional Prerequisites: Understanding of agent architectures.
When Not To Use
- For distributed multi-database setups or QUIC sync -- use the agentdb-advanced skill instead
- For reinforcement learning algorithms -- use the agentdb-advanced skill (RL Plugins section) instead
- For pure vector search performance tuning (quantisation, HNSW) -- use the agentdb-vector-search skill instead
- For non-persistent, session-only state that does not need vector search -- standard in-memory data structures suffice
- For unified development and quality engineering workflows -- use the build-with-quality skill which includes memory management
Pattern Reference
Full code examples live in references/pattern-examples.md:
- Session Memory — per-session message store with time-ordered history.
- Long-Term Memory — categorised facts with confidence and source.
- Pattern Learning — record successful trigger→response pairs and match them against live context.
- Hierarchical Memory — organise across immediate / short-term / long-term / semantic tiers.
- Memory Consolidation — periodic importance-based pruning to a size/score threshold.
- ReasoningBank Integration — migrate a legacy
.swarm/memory.db, train the learning model, and retrieve with reasoning.
For learning plugins and RL algorithms, see the agentdb-advanced skill (RL Plugins section). For performance tuning and quantization, see the agentdb-vector-search skill.
KHIVE-Informed Enhancements (v2.0 Roadmap)
Proposed enhancements from KHIVE v2 comparison — orient cold-start dashboard, importance-weighted storage, entity-relationship graph, task dependency DAG, tag retrieval path, and URI/URN addressing. Full proposal with schemas and code in references/khive-v2-roadmap.md; underlying analysis in KHIVE-LEARNINGS.md.
Troubleshooting
Issue: Memory growing too large
npx agentdb@latest stats ./agents.db
Issue: Slow search performance
Issue: Migration from legacy ReasoningBank
npx agentdb@latest migrate --source .swarm/memory.db
Learn More
For performance benchmarks, see AgentDB Overview. For general links, see AgentDB Overview.