memory-architecture
Skill17 starsChanged 56 days agoMITView on GitHub
Design and review persistent memory and knowledge systems for AI agents, including durable project knowledge, team knowledge bases, retrieval, provenance, conflict handling, retention, and tenant isolation. Use when architecting agent memory across sessions, deciding where knowledge should persist, or reviewing memory quality and security. Do not use for ordinary note-taking or short-lived task context.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- thistleknot/skillstheir own version, first seen Nov 8, 2026
- Bitterbot-AI/bitterbot-desktoptheir own version, first seen Oct 8, 2026
- nicuk/claude-md-memory-architecturetheir own version, first seen Sep 27, 2026
- sefaertunc/anthropic-watchtheir own version, first seen Apr 30, 2026
- sefaertunc/Worclaudetheir own version, first seen Apr 28, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- Bitterbot-AI/bitterbot-desktop★ 2.5ksame name
- sefaertunc/Worclaude★ 4same name
- sefaertunc/anthropic-watch★ 1same name
- nicuk/claude-md-memory-architecture★ 0same name
- thistleknot/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository53 other files it gives its agents.
- agents-sdkSkill
- agent-workflowSkill
- api-designSkill
- aws-iamSkill
- bash-shell-scriptingSkill
- cicd-github-actionsSkill
- cloudflare-email-serviceSkill
- cloudflareSkill
- cloudflare-waf-authorSkill
- cloudflare-workers-authorSkill
- cloud-platformsSkill
- codebase-security-auditSkill
- containers-orchestrationSkill
- core-engineeringSkill
- database-postgresqlSkill
- databricksSkill
- data-engineeringSkill
- distributed-transactionsSkill
- documentation-standardsSkill
- domain-driven-designSkill
- durable-objectsSkill
- frontend-engineeringSkill
- git-workflowSkill
- go-rust-systemsSkill
- iam-security-advisorSkill
- independent-verificationSkill
- infrastructure-iacSkill
- kubernetes-containersSkill
- kubernetes-operator-developmentSkill
- mcp-developmentSkill
- multi-perspective-reviewSkill
- networking-transportSkill
- observabilitySkill
- oktaSkill
- pdf-exportSkill
- python-developmentSkill
- reactflow-architecture-diagramsSkill
- sandbox-sdkSkill
- scripting-automationSkill
- security-testingSkill
- service-resilienceSkill
- single-file-dashboardSkill
- skills-compositionSkill
- skills-continuous-improvementSkill
- snowflakeSkill
- system-designSkill
- typescript-javascriptSkill
- web-perfSkill
- web-research-kb-refreshSkill
- workers-best-practicesSkill
- workload-identitySkill
- wranglerSkill
- zero-trustSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. 0 are common, 13 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
13
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Use this skill for:
- Distinctive: line 20
Do not use it for:
- Distinctive: line 37
Supersession preserves lineage: Do not move or delete records in a way that breaks stable identifiers and citations.
- Distinctive: line 39
Deletion is a designed operation: Remove the canonical record, derived chunks, embeddings, caches, and replicas according to policy.
- Distinctive: line 54
If the requested persistence, recovery, sharing, or access controls do not match the proposed store, stop and redesign the storage layer.
- Distinctive: line 100
When was it valid, reviewed, and retrieved?
- Distinctive: line 102
When must it be reviewed or deleted?
- Distinctive: line 104
Use the data model as a starting contract.
- Very specific: line 118
Do not use a universal ranking such as human_confirmed > inferred > raw.
- Distinctive: line 124
Treat similarity matches as review candidates.
- Distinctive: line 125
Keep conflict state separate from supersession state.
- Distinctive: line 126
Use optimistic concurrency or version checks for reviewed records.
- Distinctive: line 135
Before rollout, create a representative query set with expected claims and prohibited results.
- Distinctive: line 145
Test poisoning, malicious source instructions, ambiguous identity, stale claims, conflicting approved claims, index lag, provider outage, …
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Memory Architecture
Design persistent memory as a governed knowledge system, not as a larger prompt. Separate evidence from claims, choose storage from durability and trust requirements, filter before retrieval, cite what is used, and measure whether memory improves outcomes.
When to Use
Use this skill for:
- Agent or assistant memory that persists across sessions
- Durable project or team knowledge bases
- Retrieval pipelines that assemble context automatically
- Note deduplication, contradiction handling, supersession, or retention
- Security and privacy reviews of persistent AI memory
Do not use it for:
- One-off questions or ordinary documentation
- Current-task handoff files such as
tmp/active-context.md - Web research refreshes whose storage architecture is already defined
- Model-provider API syntax without a memory-system design decision
For temporary coding-agent context, use agent workflow context management. For bounded web refreshes, use web-research-kb-refresh. For trust-boundary reviews, compose with zero-trust.
Non-Negotiables
- Raw input is untrusted evidence, not ground truth. Preserve its provenance and scan it for prompt injection, sensitive data, and malformed content.
- Ephemeral context is not durable memory. A gitignored
tmp/directory is appropriate for replaceable session state, not the only copy of team knowledge. - Evidence and claims are separate records. A claim cites evidence; changing a claim does not rewrite the source.
- Trust never escalates automatically. Models and background jobs may propose claims or flag conflicts, but only an authorized human or deterministic policy may approve higher-trust states.
- Tenant and authorization filters run before semantic retrieval. Similarity does not grant access.
- Similarity is a candidate signal. It does not prove duplication, agreement, or contradiction.
- Supersession preserves lineage. Do not move or delete records in a way that breaks stable identifiers and citations.
- Every retrieved claim is attributable. Return stable claim IDs and source citations with generated context.
- Deletion is a designed operation. Remove the canonical record, derived chunks, embeddings, caches, and replicas according to policy.
- Quality is measured. Evaluate retrieval relevance, groundedness, freshness, conflict handling, and isolation before calling the system reliable.
Architecture Decision Workflow
1. Classify the Memory Need
Choose one primary class before selecting technology:
| Class | Lifetime | Typical storage | Examples |
| Session context | Hours or days; replaceable | Gitignored local files or session store | Current task, handoff, temporary plan |
| Durable local knowledge | Months; single operator or repository | Versioned files or local database with backup | Decisions, project facts, curated notes |
| Shared or production memory | Policy-defined; multi-user or multi-agent | Authorized database, object store, and search index | Team KB, customer memory, operational knowledge |
If the requested persistence, recovery, sharing, or access controls do not match the proposed store, stop and redesign the storage layer.
2. Define the Trust and Data Boundaries
Record:
- Principals: writers, reviewers, retrievers, administrators, and downstream agents
- Tenants and authorization scopes
- Data classifications, including personal data, secrets, and regulated data
- Evidence sources and external processing, including embedding providers
- Retention, deletion, legal hold, backup, and recovery requirements
- Worst-case outcomes from poisoned, stale, leaked, or cross-tenant memory
See security and privacy for the threat model and control checklist.
3. Separate the Planes
flowchart LR
sources[UntrustedSources] --> ingest[IngestionAndValidation]
ingest --> evidence[ImmutableEvidence]
evidence --> claims[ReviewedClaims]
claims --> index[DerivedSearchIndex]
request[AuthorizedRequest] --> filters[PolicyAndMetadataFilters]
filters --> index
index --> rank[RankAndBudget]
rank --> context[AttributedContext]
context --> agent[AgentOrApplication]
claims --> lifecycle[ReviewRetentionDeletion]
lifecycle --> index- Evidence plane: original content plus source identity, hash, acquisition time, and classification
- Knowledge plane: atomic claims, review state, confidence rationale, validity, and evidence links
- Index plane: replaceable chunks, keywords, and embeddings derived from authorized records
- Context plane: request-specific, token-bounded, attributed material assembled after policy checks
- Lifecycle plane: review, conflict resolution, supersession, retention, deletion, and reindexing
4. Define the Record Contract
Require stable IDs and enough metadata to answer:
- What is the claim?
- Which evidence supports it?
- Who or what created and approved it?
- Which tenant and classification own it?
- When was it valid, reviewed, and retrieved?
- What supersedes or conflicts with it?
- When must it be reviewed or deleted?
Use the data model as a starting contract. Extend it for the domain instead of weakening its provenance or isolation fields.
5. Design Retrieval
Apply the retrieval sequence in this order:
- Authenticate the caller and resolve tenant, purpose, and policy.
- Apply authorization, classification, validity, retention, and deletion filters.
- Generate candidates with keyword, metadata, graph, or embedding retrieval.
- Rerank using relevance, evidence authority, freshness requirements, and review state.
- Detect incompatible claims and surface unresolved conflicts.
- Enforce a context token budget and diversity limits.
- Return claim IDs, source citations, and ranking reasons with the selected context.
Do not use a universal ranking such as human_confirmed > inferred > raw. Authority and freshness depend on the claim, source, domain, and request. See retrieval and evaluation.
6. Design Writes and Lifecycle
- Validate and classify before storing.
- Make ingestion idempotent with stable source IDs and content hashes.
- Treat similarity matches as review candidates.
- Keep conflict state separate from supersession state.
- Use optimistic concurrency or version checks for reviewed records.
- Rebuild derived indexes after approval, supersession, deletion, or policy changes.
- Archive only when policy permits; never use archival to evade deletion.
- Audit writes, approvals, retrievals, conflicts, exports, and deletions.
For a lightweight repository implementation, use the local-file pattern.
7. Define Evaluation and Exit Criteria
Before rollout, create a representative query set with expected claims and prohibited results. Measure:
- Retrieval precision and recall at the configured context budget
- Citation and claim groundedness
- Stale or superseded claim retrieval rate
- Conflict detection and surfacing rate
- Cross-tenant and unauthorized retrieval rate, which must be zero
- Deletion propagation across canonical and derived stores
- Latency, index freshness, token use, and cost
Test poisoning, malicious source instructions, ambiguous identity, stale claims, conflicting approved claims, index lag, provider outage, and deletion failure.
Design Review Output
Produce:
- Memory class and storage decision with rejected alternatives
- Principals, tenants, data classifications, and trust boundaries
- Evidence and claim schemas
- Ingestion, retrieval, write, conflict, and deletion flows
- Security and privacy controls
- Evaluation dataset, metrics, thresholds, and rollback criteria
- Open risks, owners, and reversal conditions
References
- Data model
- Retrieval and evaluation
- Security and privacy
- Local-file pattern
Related Handbook Guidance
- Context engineering rule
- Zero Trust rule
- AI and machine learning rule
- Agent workflow skill
- Web-research KB refresh skill
- Zero Trust skill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

