managing-memory
Managing Agent Memory
Memory blocks are the foundation of agent state. This skill covers inspection, editing, auditing, and restructuring.
When to Use
- Inspecting or updating your own memory blocks
- Viewing/modifying subagent memory (scout, coder)
- Auditing memory utilization
- Invoking the memory agent for major restructuring
- Creating new blocks or deleting old ones
Two Methods
1. Memory Filesystem (Self, Preferred)
Edit blocks as markdown files:
~/.letta/agents/agent-c770d1c8-510e-4414-be36-c9ebd95a7758/memory/system/
Read and Edit tools work directly on these files. Changes sync automatically.
2. Letta API (Subagents)
from letta_client import Letta
client = Letta(api_key=os.environ.get('LETTA_API_KEY'))
# List blocks
blocks = client.agents.blocks.list(agent_id="agent-xxx")
# Update
client.agents.blocks.update("label", agent_id="agent-xxx", value="new content")
# Create
client.agents.blocks.create(agent_id="agent-xxx", label="new", value="content", description="purpose")
Agent IDs
| Agent | ID |
|---|---|
| central (me) | agent-c770d1c8-510e-4414-be36-c9ebd95a7758 |
| scout | agent-e91a2154-0965-4b70-8303-54458e9a1980 |
| coder | agent-f9b768de-e3a4-4845-9c16-d6cf2e954942 |
| memory | agent-8c91a5b1-5502-49d1-960a-e0a2e3bbc838 |
Auditing Utilization
cd ~/.letta/agents/agent-c770d1c8-510e-4414-be36-c9ebd95a7758/memory/system
for f in *.md agents/*.md; do
chars=$(wc -c < "$f" 2>/dev/null || echo 0)
pct=$((chars * 100 / 20000))
printf "%-25s %5d chars (%2d%%)\n" "$f" "$chars" "$pct"
done | sort -t'(' -k2 -rn
Invoking Memory Agent
For major restructuring (not routine edits):
Task(agent_id="agent-8c91a5b1-5502-49d1-960a-e0a2e3bbc838", subagent_type="general-purpose", model="opus", description="Restructure [area]", prompt="...")
Best Practices
- Small targeted updates beat wholesale rewrites
- One purpose per block
- Check current value before updating
- Archive completed items, don't just accumulate
- Defrag every session, not weekly
More from cpfiffer/central
interacting-with-x
Full interaction with X (Twitter) - post, read, reply, like, retweet, follow. Use when operating on X as an additional social environment alongside ATProtocol.
48interacting-with-agents
Guide for interacting with AI agents on ATProtocol. Use when engaging with other agents, reading their cognition, or navigating the agent ecosystem. Includes agent identification and the comind collective.
18using-xrpc-indexer
Query the comind semantic search API for cognition records. Use when searching thoughts, concepts, memories, or hypotheses. Provides vector similarity search over network.comind.* collections.
15working-with-subagents
Guide for deploying and prompting my stateful subagents (scout, coder, memory). Use when delegating tasks or parallelizing work.
15agent-profile
Publish and query agent profiles on ATProto. Unified schema combining identity (transparency) and registration (discovery). Use when setting up a new agent, querying other agents, or updating your profile.
14using-letta-api
Code-heavy guide for managing yourself and subagents via the Letta Python client. Use when modifying agent settings (sleeptime, model, config), creating/deploying/messaging subagents, or programmatically managing memory blocks.
14