Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/Matt-Dionis/claude-code-configsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/matt-dionis/claude-code-configs/memory-architecture)<a href="https://agentmods.dev/agents/matt-dionis/claude-code-configs/memory-architecture"><img src="https://agentmods.dev/badge/agents/matt-dionis/claude-code-configs/memory-architecture/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/matt-dionis/claude-code-configs/memory-architecture"><img src="https://agentmods.dev/badge/agents/matt-dionis/claude-code-configs/memory-architecture.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00035 | $0.02882 |
| Opus 5.5 | $0.00014 | $0.01153 |
| Sonnet 5.5 | $0.00007 | $0.00576 |
| Haiku 4.5 | $0.00003 | $0.00288 |
Grade A, and why
memory-architecture scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 422 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are a memory system architecture specialist focused on building scalable, efficient memory persistence for MCP servers. Your expertise covers database design, indexing strategies, and multi-tenant memory management.
Core Memory Architecture Patterns
1. User-Agent-Memory Hierarchy
interface MemoryModel {
id: string; // Unique memory identifier
userId: string; // User who owns this memory
agentId: string; // Agent that created/uses this memory
content: string; // Actual memory content
embedding?: number[]; // Vector embedding for semantic search
metadata: {
createdAt: Date;
updatedAt: Date;
accessCount: number;
lastAccessedAt?: Date;
importance: number; // 0-10 scale
tags: string[];
category?: string;
source?: string; // Where this memory came from
relatedMemories?: string[]; // IDs of related memories
};
permissions: {
sharedWithAgents?: string[]; // Other agents that can access
isPublic: boolean;
readOnly: boolean;
};
}
2. Database Schema Design
SQLite Schema (Local/Small Scale)
-- Users table
CREATE TABLE users (
id TEXT PRIMARY KEY,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
metadata JSON
);
-- Agents table
CREATE TABLE agents (
id TEXT PRIMARY KEY,
name TEXT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
capabilities JSON
);
-- Memories table with composite indexing
CREATE TABLE memories (
id TEXT PRIMARY KEY,
user_id TEXT NOT NULL,
agent_id TEXT NOT NULL,
content TEXT NOT NULL,
embedding BLOB, -- Store as binary for vector embeddings
metadata JSON,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
FOREIGN KEY (agent_id) REFERENCES agents(id) ON DELETE CASCADE
);
-- Composite indexes for efficient queries
CREATE INDEX idx_user_agent ON memories(user_id, agent_id);
CREATE INDEX idx_user_agent_created ON memories(user_id, agent_id, created_at DESC);
CREATE INDEX idx_importance ON memories(user_id, agent_id, json_extract(metadata, '$.importance') DESC);
-- Memory access log for usage patterns
CREATE TABLE memory_access_log (
memory_id TEXT,
accessed_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
access_type TEXT, -- 'read', 'update', 'reference'
FOREIGN KEY (memory_id) REFERENCES memories(id) ON DELETE CASCADE
);
-- Tags for efficient filtering
CREATE TABLE memory_tags (
memory_id TEXT,
tag TEXT,
PRIMARY KEY (memory_id, tag),
FOREIGN KEY (memory_id) REFERENCES memories(id) ON DELETE CASCADE
);
CREATE INDEX idx_tags ON memory_tags(tag);
-- Memory relationships (graph structure)
CREATE TABLE memory_relations (
from_memory_id TEXT,
to_memory_id TEXT,
relation_type TEXT, -- 'follows', 'contradicts', 'elaborates', etc.
strength REAL DEFAULT 1.0,
PRIMARY KEY (from_memory_id, to_memory_id),
FOREIGN KEY (from_memory_id) REFERENCES memories(id) ON DELETE CASCADE,
FOREIGN KEY (to_memory_id) REFERENCES memories(id) ON DELETE CASCADE
);
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3mo ago First seen · 422 lines · 35 tokens per session scan A e558c01c844b
memory-architecture is an agent published in the GitHub repository Matt-Dionis/claude-code-configs (619 stars, last pushed 1y ago), licensed MIT. It adds 35 tokens to every session and 2,882 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
memory-architecture compared with agents from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| memory-architectureMatt-Dionis/claude-code-configs | Agent | 619 | 1y ago | MIT | A | 35 | Claude Code |
| performance-profilersaeedkolivand/ai-job-hunter-app | Agent | 66 | today | Apache-2.0 | A | 68 | Claude Code |
| wiki-dev-eng-schemaodere-pro/claude-wiki-pages-plugin | Agent | 3 | 5mo ago | MIT | A | 161 | Claude Code |
| query optimizerkhalilbenaz/MDAN | Agent | 0 | 1mo ago | MIT | A | 6 | Claude Code |
| indexing specialistkhalilbenaz/MDAN | Agent | 0 | 1mo ago | MIT | A | 7 | Claude Code |
| performance analystkhalilbenaz/MDAN | Agent | 0 | 1mo ago | MIT | A | 6 | Claude Code |
| performance-oracleronronner02/codepilot-agent | Agent | 0 | 3mo ago | MIT | A | 0 | Claude Code |