# Agent Memory

> AgentMemory Skill

- Skill: `kernel8901/agent-memory` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add kernel8901/agent-memory`
- Raw SKILL.md: https://api.skillmd.com/api/skills/kernel8901/agent-memory/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: kernel8901 (https://skillmd.com/u/kernel8901)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/kernel8901/agent-memory

---

# 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 and `get_lessons()` for experiences
- **Entity tracking** for people and projects
- **Semantic search** using FTS5
- **Auto-cleanup** for stale information

## Installation

```bash
# 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

```python
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

```python
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

```python
# Search facts
facts = mem.recall("user preferences")

# Get lessons
lessons = mem.get_lessons(context="deployment", outcome="failure")
```

### Track Entities

```python
mem.track_entity("john", {
    "role": "client",
    "company": "Acme Inc",
    "preferences": ["email", "brief updates"]
})
```

## Integration Protocol

Recommended workflow for agent configuration:

```yaml
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

