Logo vun Memory Factcheck

Memory Factcheck

Communautéit
LeeYudok
memory-factcheck

An audit skill that checks an agent's persistent memory against ground truth (code, database, issue tracker, filesystem), corrects stale memories, and reports dead ones as archive candidates. Use when memory grows past ~30 files, right after a big stack/infra change (library swap, version upgrade, server migration, schema drop), when two memories seem to contradict each other, or on a "clean up / audit my memory" (메모리 정리해줘 / 감사해줘) request.

Iwwersiicht

EditeurLeeYudok
Repositoryagents-scaffold
Skill-Nummmemory-factcheck
Stären
38
Forks
8
Matgeliwwert Fichieren
Nëmmen Instruktiounen
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.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

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

Installatioun

Installéiert de KI-Skill Memory Factcheck 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/LeeYudok/agents-scaffold/tree/main/presets/lang/en/base/.claude/skills/memory-factcheck
  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/LeeYudok/agents-scaffold.git /tmp/agents-scaffold
mkdir -p .claude/skills
cp -r /tmp/agents-scaffold/presets/lang/en/base/.claude/skills/memory-factcheck .claude/skills/memory-factcheck
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Memory Factcheck 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 Factcheck 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 Factcheck 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 Fact-Check

Memory decays. A fact that was true when written becomes false once code, schema and infrastructure move. Stale memory is worse than no memory — an agent reads it and confidently does the wrong thing.

This skill is not a structural cleanup. Orphan files, duplicate entries, index bloat, broken internal links — those checks compare memory files to each other. This skill compares each memory to the world it describes: the code, the database, the issue tracker, the filesystem. A memory can be perfectly formatted, correctly indexed and recently modified — and its content completely false.

Automatic deletion is forbidden. Only a source-of-truth comparison can tell what is dead, and losing a single incident lesson is expensive. Hence semi-automatic: correct freely, archive only after approval, never delete.

1. Locate and inventory

Find the memory set. Common locations, in priority order:

  • The path declared by the project's agent instructions (AGENTS.md / CLAUDE.md) — e.g. "memory SSOT is .claude/memory/". A declared path wins over every default.
  • .claude/memory/ inside the repo (team-shared, committed to the repo)
  • The host's per-project memory directory (e.g. ~/.claude/projects/<slug>/memory/)

For each file, collect the frontmatter (name/description/type) and the last modification date (git log -1 --format=%cs -- <file> for committed memory, stat otherwise). If there is an index file (MEMORY.md), note it — it is audited too, but it is an index, not a memory.

Personal files are out of scope — anything the project marks as personal (user_*.md, etc.) belongs to its owner. Do not touch it.

Reading many files: dumping 50 memories into context at once exceeds the tool output cap and wastes the budget. Concatenate them into one scratch file with ########## <filename> headers, then read it page by page. Do not skim — a stale claim is usually one clause inside an otherwise sound paragraph.

Pre-check script

Running the script below once during the inventory step surfaces structural problems and claim candidates.

bash
python3 <skill-path>/scripts/memory_audit.py <memory-dir> --repo <repo-root>
  • There are five kinds of structural problems. A file the index points to is missing, a file is missing from the index, and frontmatter is broken. A [[link]] pointing to a nonexistent memory and a duplicate name are counted too. If any one exists, the exit code is 1.
  • type is accepted both at the top level and under metadata.type. Real memories are often stored the latter way.
  • This script does not create, modify or delete files. Corrections and archiving happen after human approval, following the procedure below.
  • It extracts file paths, function names and issue numbers as claim candidates and checks them against the filesystem of --repo. Text inside code blocks, globs, URLs and options are excluded from the candidates.
  • Claims that could not reach their source come out as unverified. Issue numbers are always unverified, since the tracker is not queried. A memory with no claims at all is not fresh either.
  • If the memory directory or the --repo path does not exist, it ends with exit 2.
  • This is for narrowing down candidates. Choosing which claims change behavior and checking them against the source is still the agent's job.

2. Extract load-bearing claims

Per file, pick the 1–3 claims that change what an agent would do (load-bearing claims). Ignore narrative, rationale and background; a memory is only as stale as its actionable claims.

Load-bearing claims look like: "X lives at path P" · "table T has N rows" · "issue #N is still open" · "feature F does not exist yet" · "library L is not installed" · "this fix is still pending" · "run command C to verify".

3. Verify against the source of truth

Work cheapest-and-highest-yield first. In practice the ranking below holds: issue status is one API call and catches the largest share of stale claims — because memories are written mid-work, and when the work finishes nobody goes back to fix the memory.

OrderClaim typeHow to verify
1Issue/PR state ("#N open", "waiting on #N", "decision pending")forge CLI/API — gh issue view N --json state / glab api projects/<enc>/issues/N. Batch them in one loop
2Path/URL (script locations, deploy paths, endpoints)ls, test -f, curl -s -o /dev/null -w '%{http_code}'
3Code (a file/class/config exists, a specific behavior)grep/Read the current tree — the source is the code, not the memory
4Data/schema (tables, columns, row counts)Read-only queries via the project's DB tool. Prefer catalog estimates (pg_class.reltuples, information_schema.columns); exact count(*) only when the estimate itself is disputed
5Runtime/host (cron jobs, services, logs)ssh <host> 'ls …; crontab -l; tail <log>' — a job's last log line dates the claim precisely

Parallelize independent verifications. If a source is unreachable, state it in the report — never silently downgrade "couldn't check" to "checked".

4. Classify

  • fresh — every claim holds. Don't touch it.
  • stale — some claim is outdated (moved path, changed number, closed issue, implemented gap). → Correct the body now, with the measured value and the date. Corrections are within autonomous scope, because they add truth rather than delete anything.
  • dead — the core premise is gone (library removed, feature retired, wholly superseded). → Mark it as an archive candidate only.
  • unverified — the claim could not be confirmed because the source was unreachable (auth failure, host unreachable, no permission). → Leave it untouched, but count it separately in the report and note what blocked it. Do not count it as fresh.

5. Stale patterns worth hunting

Beyond "the number changed", these recur and are easy to miss:

  • Fixed-gap drift — the memory records a missing capability ("no reconcile on startup", "no rate limiting yet") and it has since been implemented. This is the most dangerous class: the agent re-implements or re-reports work that has already shipped. Check the linked issue and grep for the symbol together.
  • Cross-memory contradiction — two memories say different things (one says script X is the canonical way, another says that script was retired). By definition at least one is stale. Do not look only file by file; cross-compare claims across files.
  • Scale drift — "table T has ~8M rows" from a few months ago is now off by 25%. Harmless as small talk, harmful when the memory derives advice from that number (batch sizes, timeout budgets, "this query takes 19s").
  • Recipe rot — a command/query the memory saved as a verified recipe no longer works at today's data volume or API version. Re-run saved recipes; a recipe you did not run is not verified.
  • Progress-state drift — the "current status" section of a long-running job/backfill memory falls weeks behind. Sometimes two mutually contradictory status sections pile up. Date each section, keep only the newest, and mark the superseded ones.
  • Identity mismatch — name/description and the body say opposite things (e.g. a file named *-via-toolX whose body records that toolX was abandoned). Recall matches on the description, so the file gets loaded for the wrong reason or missed entirely.

6. Report, then apply

Report as a table before changing anything — file · class · one-line evidence · action:

FileClassEvidenceAction
reference_x.mdstalescript moved scripts/ → data/path corrected
project_y.mdstaleclaims "#302 reconcile missing"; JobRunHistoryReconciler exists, #302 closedrewritten as done
project_z.mddead candidatethe feature from #N was removed in #Mawaiting approval

Then:

  1. Apply corrections to stale bodies — measured value + date, keeping the original observation where it still carries a lesson ("8M as of , 9.9M as of ").
  2. Archive dead candidates only after explicit user approval: git mv them into <memory>/archive/ and add archived: <date> <reason> to the frontmatter. Never use rm.
  3. Sync the index — reflect the corrections and remove archived entries from MEMORY.md.
  4. Commit through the project's normal workflow (issue → branch/worktree → PR/MR). Memory is team-shared content; there are no direct-to-main commits.

Judgment rules — stay conservative

  • Unverifiable ⇒ unverified. If the source of truth is unreachable, leave the memory as it is and classify it as unverified. Unconfirmed is not dead, but it is not confirmed either. If you count it as fresh, the next audit skips that memory.
  • Incident lessons stay fresh even when the code moves. A memory recording why something broke exists to prevent recurrence, not as a snapshot of a call site. Correct its stale path references, but do not retire the lesson because a file was renamed.
  • Report the drift, don't invent the cause. If a number inverted or moved without explanation, record the measured value and mark it as unexplained. A plausible story written into memory becomes tomorrow's false fact.
  • Prefer merge over create. Two memories on one topic → propose merging into the existing one.
  • Non-obvious facts discovered during the audit become new memories — the audit itself is a source of evidence.

Field notes

  • A recent timestamp proves nothing. A file committed this week can carry a claim that was already false when written, and a file left untouched for months can still be true. Verify the claims — do not sort by date and cut off the tail.
  • count(*) on a large table can exceed the DB tool's statement timeout — if the memory claims "this query is fast", that failure is itself a finding.
  • When shelling out from zsh, quote globs (grep --include="*.java"). Otherwise the shell eats them, the check silently returns an empty result — and you get a false "fresh".
  • An issue being closed does not by itself prove that the described work shipped. Confirm fixed-gap claims with a grep for the symbol as well.

Heefeg gestallte Froen

Wat mécht de KI-Skill Memory Factcheck?

An audit skill that checks an agent's persistent memory against ground truth (code, database, issue tracker, filesystem), corrects stale memories, and reports dead ones as archive candidates. Use when memory grows past ~30 files, right after a big stack/infra change (library swap, version upgrade, server migration, schema drop), when two memories seem to contradict each other, or on a "clean up / audit my memory" (메모리 정리해줘 / 감사해줘) request.

Firwat Memory Factcheck op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Memory Factcheck 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 Factcheck an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/LeeYudok/agents-scaffold/tree/main/presets/lang/en/base/.claude/skills/memory-factcheck an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Memory Factcheck 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 Factcheck benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Memory Factcheck 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 Factcheck gratis?

Jo. De Skill gëtt vum LeeYudok ë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 👇