Memoria Persistente para Agentes
/install memoria-persistente-agentes
Letta Memory
Three-layer persistent memory for agents. No more starting from zero every session.
Architecture
| Layer | What | Where | When |
|---|---|---|---|
| Core | Always in context | memory/core.md |
Every session, auto-loaded |
| Archival | Searchable storage | memory/archival/*.md |
On demand, semantic search |
| Recall | Session transcripts | OpenClaw session files | When needed via memory_search |
Core Memory (memory/core.md)
Compact (~500-1000 words), always loaded. The agent's "working memory".
Structure
# Core Memory
## Identity
- Agent name, personality, role
## User
- Name, preferences, communication style, key facts
## Active Context
- Current projects, recent events, pending tasks
## Quick Reference
- Frequently needed info (medications, schedule, credentials refs)
Rules
- Keep under 1000 words — trim when it grows
- Edit directly when learning something new about user or context
- Move stale items to archival (don't delete, archive)
Archival Memory (memory/archival/)
Long-term storage organized by topic. Searched, not loaded.
Structure
memory/archival/
├── people/ # People and relationships
├── projects/ # Project details and decisions
├── decisions/ # Important decisions made
├── learnings/ # Lessons learned
└── reference/ # Facts, procedures, how-tos
Writing archival entries
# [Topic] — YYYY-MM-DD
## Summary
One-line description
## Details
Full context
## Tags
comma, separated, tags
Reading archival
Use memory_search to find relevant archival entries. Never load all archival files at once.
Automatic Behaviors
On session start
- Read
memory/core.md - Read today's
memory/YYYY-MM-DD.mdif exists - If user context seems incomplete, search archival for relevant info
- Never ask questions that core memory already answers
During conversation
- When user shares new personal info → update core immediately
- When important decision made → write to archival
- When user says "remember this" → write to appropriate layer
- When correcting a mistake → update core or archival
On heartbeat
- Review recent
memory/YYYY-MM-DD.mdfiles - Promote repeated archival entries to core
- Trim core when >1000 words
- Consolidate duplicate archival entries
Memory Operations
Core → Archival (demotion)
When core grows too large or items become stale:
- Move item to appropriate archival file
- Replace in core with brief reference (e.g., "See archival: projects/locatering")
- Keep core scannable
Archival → Core (promotion)
When archival info is needed repeatedly:
- Move or copy key facts to core
- Keep archival entry with cross-reference
- Promotion triggers: mentioned 3+ times in a week, needed at session start
Session → Archival (consolidation)
At natural breakpoints or heartbeat:
- Read today's daily notes
- Extract decisions, new info, lessons
- Write to archival with proper tags
- Update core if warranted
Initialization
First run? Set up the structure:
mkdir -p memory/archival/{people,projects,decisions,learnings,reference}
Create memory/core.md if it doesn't exist:
# Core Memory
## Identity
- [Agent fills this in]
## User
- [Agent fills this in]
## Active Context
- [Agent fills this in]
## Quick Reference
- [Agent fills this in]
Scripts
scripts/consolidate.py
Consolidates daily notes into archival entries. Run during heartbeats or manually.
python3 scripts/consolidate.py --days 7 --workspace /path/to/workspace
Options:
--days N— look back N days of daily notes (default: 7)--workspace PATH— workspace root (default: current dir)--dry-run— show what would be written without writing
scripts/core-trim.py
Trims core.md when it exceeds the word limit.
python3 scripts/core-trim.py --max-words 1000 --workspace /path/to/workspace
Options:
--max-words N— maximum words for core.md (default: 1000)--workspace PATH— workspace root--dry-run— show what would be demoted without editing
Anti-Patterns
- Don't duplicate — same info in core AND archival = waste. Core has summary, archival has detail.
- Don't skip archival — dumping everything in core defeats the purpose.
- Don't forget to consolidate — daily notes pile up. Run consolidation regularly.
- Don't ask what you already know — if core says "Renate takes Desvenlafaxina", never ask about medications.
- Don't store secrets in core — use archival/reference at minimum, prefer TOOLS.md for credentials.
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install memoria-persistente-agentes - 安装完成后,直接呼叫该 Skill 的名称或使用
/memoria-persistente-agentes触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Memoria Persistente para Agentes 是什么?
Persistent memory system for AI agents inspired by Letta/MemGPT. Three-layer memory architecture (Core, Archival, Recall) that lets agents remember across se... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 46 次。
如何安装 Memoria Persistente para Agentes?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install memoria-persistente-agentes」即可一键安装,无需额外配置。
Memoria Persistente para Agentes 是免费的吗?
是的,Memoria Persistente para Agentes 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Memoria Persistente para Agentes 支持哪些平台?
Memoria Persistente para Agentes 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Memoria Persistente para Agentes?
由 renateparma(@renateparma)开发并维护,当前版本 v1.0.0。