Agent Memory Vault
A small JSONL-backed fact store for agents. It records keyed values per topic and returns recent context at the start of a later run. It is not a transcript log, a vector index, or a multi-writer database.
Procedure
What ships
The script is skills/optional/agent-memory-vault/scripts/memory.py. It uses only the Python standard library (Python 3.10+).
Storage defaults to ~/.agent-memory/; set AGENT_MEMORY_HOME to relocate it. Each topic is an append-only .jsonl file plus an index.json summary.
Commands
Run from the repository root:
python skills/optional/agent-memory-vault/scripts/memory.py put \
--topic=preferences --key=code-style --value="2-space indent"
python skills/optional/agent-memory-vault/scripts/memory.py get \
--topic=preferences --key=code-style
python skills/optional/agent-memory-vault/scripts/memory.py list --topic=preferences
python skills/optional/agent-memory-vault/scripts/memory.py context --last=10
Topics
| Topic | What goes here |
|---|---|
| preferences | User preferences (style, tools, languages) |
| decisions | Architecture or design choices with rationale |
| project-state | Work in progress, blockers, recent changes |
| errors | Errors encountered and fixes |
| glossary | Domain-specific terms |
Concurrency limit
The script appends entries and then rewrites index.json without a file lock. Two writers at the same time can interleave lines or lose an index update. Run one writer at a time, or wrap calls in your scheduler's lock. Treat this as a single-writer store, not a shared database.
Cron example
# Daily at 09:00: load preferences, then append findings.
0 9 * * * cd "$HOME/agent" && \
<your-agent-command> "Load memory topic preferences; append today's findings to topic briefing."
Replace <your-agent-command> with your harness command. No scheduler or agent loop ships with this skill.
Manual fallback
If Python is unavailable, keep one topic.jsonl file and append one JSON object per line with a key and value. The context command will not parse it, so read the last N lines directly and state that the index is stale.
Anti-patterns
- Storing secrets, tokens, or credentials in the vault.
- Writing free-form notes without a topic key; they become unsearchable.
- Running multiple cron jobs against the same topic without an external lock.
- Treating the vault as a transcript or as project documentation.
Verification Checklist
- [ ]
putfollowed bygetreturns the same value. - [ ]
list --topic=<topic>shows the expected entry count. - [ ]
context --last=10includes the new entry and no secret values. - [ ] A second writer was not running during the test.