memory-architecture

A maintainer guide explaining how the agentic-memory codebase is organized and how its tools, hooks, Python modules, and scheduled jobs relate.

In plain words
What is it for?
It is for onboarding, planning cross-module refactors, and tracing which components call or depend on one another.
Why use it?
It gives developers a map of the system before they change code that crosses multiple parts of the project.

Skill for Claude CodeCodex

Install

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.

agentmods
npx agentmods add skills/arkaaiadmin/agentic-memory/memory-architecture
Any agent
npx skills add ArkaAiAdmin/Agentic-Memory --skill memory-architecture
Clone the repo
git clone --depth 1 https://github.com/ArkaAiAdmin/Agentic-Memory

Made for: Claude Code, Codex.

Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,709 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00063 $0.02709
Opus 5 $0.00032 $0.01354
Sonnet 5 $0.00013 $0.00542
Haiku 4.5 $0.00006 $0.00271

Measured yesterday against content hash 2ca432bacaa8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

memory-architecture scanned grade A with 1 finding 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 yesterday.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

| `sync_client.py` | 656 | HTTP sync client (urllib push/pull) | Cross-machine sync |
skills/memory-architecture/SKILL.md · 155 lines

How it starts

The opening of the file, as written. The whole thing — 155 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Memory Architecture (Maintainer)

A one-page mental model of the agentic-memory system, sized for someone about to change it.

The one-liner

Markdown files are the source of truth. SQLite is a derived index that can be rebuilt from them. The agent sees the system through MCP tools + hooks; the maintainer sees it through Python modules + cron jobs.

The three layers

┌──────────────────────────────────────────────────────────────────────┐
│ LAYER 3 — SURFACE                                                     │
│   107 registered tools (17 CORE + 87 ADMIN + 3 DEPRECATED; 18 visible — 17 CORE + 1 memory_maintenance router)  │
│   4 user-facing hooks in hooks/ + 1 log helper module (_log_error.py) │
│   39 cron scripts (all in `cron/` subdirectory)                        │
│   ~18 CLI commands                                                      │
└──────────────────────────────────────────────────────────────────────┘
                                   │
                                   ▼
┌──────────────────────────────────────────────────────────────────────┐
│ LAYER 2 — PIPELINE (Python, ~104k LOC production, ~98k LOC test)        │
│                                                                      │
│   WRITE PATH:                                                        │
│     save_pipeline.save_memory() (1,623 lines, saga → save/)         │
│       → saga (5 steps: memory, FTS5, embeddings, chunks, KG)         │
│       → audit log + cache invalidation + user_profile                │
│                                                                      │
│   READ PATH:                                                         │
│     search_pipeline.py → search/orchestrator.py (1,995 LOC)         │
│       → _expand_query (100+ synonym map)                            │
│       → 3-channel parallel: FTS5 + usearch + KG                      │
│       → _hybrid_fusion (6-factor weighted blend)                     │
│       → Qwen3-0.6B reranker (BGE-m3 fallback)                       │
│       → quality_gates (O(N log N) sliding-window near-dup dedup)     │
│                                                                      │
│   SAFETY:                                                            │
│     memory_injection (4-category prompt-injection scan, retrieval)  │
│     quality_gates (filter low-confidence results)                    │
└──────────────────────────────────────────────────────────────────────┘
                                   │
                                   ▼
┌──────────────────────────────────────────────────────────────────────┐
│ LAYER 1 — STORAGE (SQLite at memory/memory.db, Schema v37)           │
│                                                                      │
│   memories / memories_fts / memory_chunks / memory_chunks_fts       │
│   memory_embeddings (BLOB, dim=256, f16, ssm_state)                  │
│   memory_vec_keys / memory_vec_idx (usearch BLOB)                    │
│   memory_field_crdt (v13) / arc_ghosts / arc_stats (v14)            │
│   kg_facts / kg_entities / kg_edges / kg_extraction_stats           │
│   backlinks (wiki-style [[link]] extraction)                         │
│   memory_audit_log / memory_ctr_feedback                             │
│   user_access_log / user_profile_access_log                          │
│   shared_memories (CRDT cross-agent pool)                            │
│   sync_log / task_queue / review_schedule / concept_drift            │
│   drift_alarms (v15) / file_mtimes / schema_version                  │
│   ~49 user-visible tables (including FTS virtual and operational)     │
└──────────────────────────────────────────────────────────────────────┘

Read the full file on GitHub · 155 lines

Changes

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.

  1. yesterday First seen · 155 lines · 63 tokens per session scan A 2ca432bacaa8

Subscribe to this mod's changes

memory-architecture is a skill published in the GitHub repository ArkaAiAdmin/Agentic-Memory (0 stars, last pushed yesterday), licensed Apache-2.0. It adds 63 tokens to every session and 2,709 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

babysit-pr

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…

openai/codex · 114 tokens

imagegen

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…

openai/codex · 113 tokens