AgentMemory Skill
Persistent memory system for AI agents
Overview
AgentMemory enables AI agents to retain information across sessions. It provides fact storage, experience learning, and entity tracking with zero external dependencies.
Key Features
- Fact storage via
remember()with tagging capabilities - Experience learning through
learn()method - Memory retrieval using
recall()for facts andget_lessons()for experiences - Entity tracking for people and projects
- Semantic search using FTS5
- Auto-cleanup for stale information
Installation
# Via ClawHub (recommended)
clawdhub install agent-memory
# Or clone
git clone https://github.com/openclaw/skills
cp -r skills/dennis-da-menace/agent-memory ~/.clawdbot/skills/
Storage
Default location: ~/.agent-memory/memory.db
Custom path supported via configuration.
Core API
Remember Facts
from memory import AgentMemory
mem = AgentMemory()
# Store a fact
mem.remember(
"User prefers dark mode",
tags=["preference", "ui"],
confidence=0.9
)
# Store with entity link
mem.remember(
"John's birthday is March 15",
tags=["personal"],
entity="john"
)
Learn from Experience
mem.learn(
action="Deployed to production without tests",
context="Friday evening rush",
outcome="failure",
insight="Always run tests before deploy, especially on Fridays"
)
Recall Memories
# Search facts
facts = mem.recall("user preferences")
# Get lessons
lessons = mem.get_lessons(context="deployment", outcome="failure")
Track Entities
mem.track_entity("john", {
"role": "client",
"company": "Acme Inc",
"preferences": ["email", "brief updates"]
})
Integration Protocol
Recommended workflow for agent configuration:
memory_protocol:
session_start:
- Load recent lessons
- Check entity context
during_session:
- Extract durable facts
- Learn from outcomes
session_end:
- Update entity information
- Record session summary
Dependencies
- Python 3.8+
- SQLite (built-in)
No external packages required.
License
MIT
Author
Dennis Da Menace - Built for the OpenClaw community