agentsclimarketplace

Agent memory patterns

Skill m00kk/agent-skills-playbook/skills/agent-memory-patterns

15 production Agent Skills — MCP, LangGraph, RAG, security, Cursor SDK. MIT licensed.

Install
npx -y skills add m00kk/agent-skills-playbook --skill agent-memory-patterns

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Implements short-term and long-term memory for agents: conversation buffers, summarization, vector memory, and user preference stores. Use when building agent memory, pgvector recall, persistent context, or reducing context bloat.

SKILL.md

1.7 KB, as published. Nobody here has run it

Agent Memory Patterns

Memory tiers

TierLifetimeStorageUse
WorkingCurrent turnContext windowLatest messages
SessionHoursCheckpointer / RedisThread state
Long-termWeeks+Vector DB / SQLFacts, preferences

Workflow

- [ ] Decide what must persist vs re-derived each run
- [ ] Summarize old turns before window overflows
- [ ] Store long-term as atomic facts with source + timestamp
- [ ] Retrieve by embedding + metadata filter (user_id)
- [ ] Allow user delete/export (GDPR-friendly)

Summarization node (LangGraph)

After N messages:

  1. Call LLM: "Summarize decisions and open tasks only"
  2. Replace old messages with summary + last K verbatim turns
  3. Keep tool results that affect ongoing work

Long-term fact schema

{
  "user_id": "hash",
  "fact": "Prefers TypeScript over Python",
  "source": "explicit_user_message",
  "created_at": "ISO-8601",
  "confidence": 0.9
}

Poisoning defenses

  • Do not write memory from untrusted retrieved docs without validation
  • Separate "user stated" vs "inferred" labels
  • Cap facts per user; decay stale entries

Vector memory

  • Embed fact + optional tags
  • Query with current user goal + user_id filter
  • Top 3 facts only — avoid dumping memory into every prompt

Pair with rag-agent-pipeline for document knowledge vs user memory.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.