Memory Architecture logo

Memory Architecture

Community
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.

Overview

Publisherd-padmanabhan
Repositoryagent-engineering-handbook
Skill namememory-architecture
Stars
20
Forks
3
Bundled files
5
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 5 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by d-padmanabhan on GitHub. Read the source before you install it.

Installation

Install the Memory Architecture AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/d-padmanabhan/agent-engineering-handbook/tree/main/skills/memory-architecture
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

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
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Memory Architecture in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Memory Architecture on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Memory Architecture is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Memory Architecture AI skill do?

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.

Why use Memory Architecture on TypingMind?

Because you install it once and use it with any model. Memory Architecture is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Memory Architecture in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/d-padmanabhan/agent-engineering-handbook/tree/main/skills/memory-architecture. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Memory Architecture?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Memory Architecture?

As many as you like. As long as a model supports skills, you can use Memory Architecture with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Memory Architecture AI skill free?

Yes. It is published on GitHub by d-padmanabhan under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇