Logo vun Memory Architecture

Memory Architecture

Communautéit
d-padmanabhan
memory-architecture

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.

Iwwersiicht

Editeurd-padmanabhan
Repositoryagent-engineering-handbook
Skill-Nummmemory-architecture
Stären
20
Forks
3
Matgeliwwert Fichieren
5
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 5 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    Vum d-padmanabhan op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Memory Architecture an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/d-padmanabhan/agent-engineering-handbook/tree/main/skills/memory-architecture
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/d-padmanabhan/agent-engineering-handbook.git /tmp/agent-engineering-handbook
mkdir -p .claude/skills
cp -r /tmp/agent-engineering-handbook/skills/memory-architecture .claude/skills/memory-architecture
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Memory Architecture an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Memory Architecture automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Memory Architecture net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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

  1. Raw input is untrusted evidence, not ground truth. Preserve its provenance and scan it for prompt injection, sensitive data, and malformed content.
  2. Ephemeral context is not durable memory. A gitignored tmp/ directory is appropriate for replaceable session state, not the only copy of team knowledge.
  3. Evidence and claims are separate records. A claim cites evidence; changing a claim does not rewrite the source.
  4. 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.
  5. Tenant and authorization filters run before semantic retrieval. Similarity does not grant access.
  6. Similarity is a candidate signal. It does not prove duplication, agreement, or contradiction.
  7. Supersession preserves lineage. Do not move or delete records in a way that breaks stable identifiers and citations.
  8. Every retrieved claim is attributable. Return stable claim IDs and source citations with generated context.
  9. Deletion is a designed operation. Remove the canonical record, derived chunks, embeddings, caches, and replicas according to policy.
  10. 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:

ClassLifetimeTypical storageExamples
Session contextHours or days; replaceableGitignored local files or session storeCurrent task, handoff, temporary plan
Durable local knowledgeMonths; single operator or repositoryVersioned files or local database with backupDecisions, project facts, curated notes
Shared or production memoryPolicy-defined; multi-user or multi-agentAuthorized database, object store, and search indexTeam 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

  • 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:

  1. Authenticate the caller and resolve tenant, purpose, and policy.
  2. Apply authorization, classification, validity, retention, and deletion filters.
  3. Generate candidates with keyword, metadata, graph, or embedding retrieval.
  4. Rerank using relevance, evidence authority, freshness requirements, and review state.
  5. Detect incompatible claims and surface unresolved conflicts.
  6. Enforce a context token budget and diversity limits.
  7. 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:

  1. Memory class and storage decision with rejected alternatives
  2. Principals, tenants, data classifications, and trust boundaries
  3. Evidence and claim schemas
  4. Ingestion, retrieval, write, conflict, and deletion flows
  5. Security and privacy controls
  6. Evaluation dataset, metrics, thresholds, and rollback criteria
  7. Open risks, owners, and reversal conditions

References

Related Handbook Guidance

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Memory Architecture?

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.

Firwat Memory Architecture op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Memory Architecture besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Memory Architecture an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/d-padmanabhan/agent-engineering-handbook/tree/main/skills/memory-architecture an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Memory Architecture benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Memory Architecture benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Memory Architecture domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Memory Architecture gratis?

Jo. De Skill gëtt vum d-padmanabhan ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇