Agent Memory
adedayoagarau/agent_memory
Memória durável em disco para agentes Claude com markdown local
Ver no GitHubCamada de memória persistente baseada em arquivos para agentes Claude, usando markdown armazenado localmente. Implementa visualização, criação, edição e limpeza de memórias sem necessidade de banco de dados vetorial ou embeddings.
Instalação
npx convez-ai adedayoagarau/agent_memory1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
Casos de uso
- Agentes que precisam lembrar contexto entre sessões
- Assistentes com histórico de preferências e fatos do usuário
- Automação que mantém estado persistente sem infraestrutura complexa
Veredito

Solução prática e minimalista para persistência de memória em agentes Claude. Bem testada (22/22 testes unitários) com segurança contra path traversal, ideal para quem quer evitar overhead de vetores ou bancos de dados.
README
A tradução para o português deste README ainda está na fila.
agent-memory-demo
A minimal, file-backed memory layer for a Claude-powered agent, built per the technical article. No vector DB, no embeddings — just markdown files on disk managed through Anthropic's beta memory tool.
Files
memory_backend.py—LocalFilesystemMemoryTool, a subclass ofBetaAbstractMemoryToolthat implements view/create/str_replace/insert/ delete/rename against./memory/memories, with path-traversal guards.system_prompt.py— persona + memory operating rules (what to store, when to read, when to supersede).agent.py— terminal chat loop usingclient.beta.messages.tool_runner. Commands:/quit,/memory_view,/memory_clear.memory_defrag.py— librarian pass that audits/memoriesfor stale or contradictory files and deletes them.test_backend.py— 22 unit tests exercising every backend command plus path-traversal and root-deletion guards. No API calls.test_persistence.py— simulates two sessions hitting the same memory root and verifies files (including a superseded fact) survive across a fresh backend instance. No API calls.test_live.py— full end-to-end run: session 1 gives the agent durable facts, session 2 starts with a fresh message list and asks questions only answerable from memory. RequiresANTHROPIC_API_KEY.
Setup
pip install "anthropic>=0.87.0"
export ANTHROPIC_API_KEY="sk-ant-..."
Run the agent
python agent.py
Then try a session like:
You: Hi, I'm Adedayo, a content designer. Please keep replies short.
You: My active project is memory-layer-guide.
You: /quit
Restart, and:
You: What do you remember about me?
The agent should view /memories before replying and surface your
name, role, preferences, and active project.
Run the tests
python test_backend.py # 22 unit tests, no API needed
python test_persistence.py # 2-session simulation, no API needed
python test_live.py # full live test, requires ANTHROPIC_API_KEY
Test results from this build
test_backend.py: 22/22 PASStest_persistence.py: 7/7 PASS (file layout, nested dirs, superseding an older fact, cross-session reads)test_live.py: not executed in the build environment because this sandbox has noANTHROPIC_API_KEYand the Messages API rejects OAuth tokens. Run it locally to verify end-to-end.
Notes
- The memory tool is part of Anthropic's
context-management-2025-06-27beta. If the beta header or tool type changes, updateagent.pyandmemory_defrag.pyaccordingly. LocalFilesystemMemoryTool._validate_pathis the security boundary. Every test that matters (traversal with.., paths outside/memories, deleting the root) is intest_backend.py.- Stale memory is worse than missing memory. Run
memory_defrag.pyperiodically, or schedule it.