memory-bank-audit

Audits a SQLite memory bank read-only using direct SQL forensics and evidence grading.

2|Updated Aug 2, 2026
One-click install
npx skills add https://github.com/Arasz/ai-raccoon --skill memory-bank-audit-arasz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: memory-bank-audit
Source: https://github.com/Arasz/ai-raccoon/tree/main/.ai-badger/skills/learned/data-analysis/memory-bank-audit
Command: npx skills add https://github.com/Arasz/ai-raccoon --skill memory-bank-audit-arasz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Periodic audits of a live SQLite memory bank (memory.db) often produce contradictory findings because samplers, timezones, and concurrent writers distort the data. This Skill provides a disciplined read-only forensic workflow that reconciles every claim against direct SQL before reporting. ## Core Features & Use Cases - Ground-truth reconciliation: Opens the bank read-only (mode=ro), normalizes timezones, and validates sampler statistics against direct COUNT(*) queries in one connection. - Churn and dedup forensics: Distinguishes true re-ingest generations from first-time ingests, and separates multi-process race duplicates from blind-insert duplicates using id contiguity analysis. - Self-correction and growth analysis: Audits TTL/sweep degradation paths, access/rating distributions, and decomposes growth into discrete events instead of extrapolating bursts. - Use Case: An engineer auditing an ai-raccoon memory.db finds 14.2% duplicate rows; the workflow traces them to multiple server processes racing a non-atomic check-then-insert and recommends a UNIQUE index fix. ## Quick Start Audit my memory.db read-only and produce a graded report of churn, duplicates, TTL sweep behavior, and growth projections with SQL evidence for every finding.

Frequently Asked Questions about memory-bank-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit a SQLite database read-only without modifying it?

Open the database with the URI form sqlite3 "file:path/memory.db?mode=ro" so no writes can occur. Run all forensic queries in one connection and reconcile any external sampler statistics against direct SQL like SELECT COUNT(*) before trusting them.

How to find duplicate rows in a SQLite table by hash?

Group rows by hash with GROUP BY hash HAVING COUNT(*)>1 to count duplicate groups. Then check id contiguity: interleaved ids indicate concurrent processes racing a non-atomic insert, while one contiguous id block indicates a single ingester missing the dedup check.

Why do windowed counts disagree with total row counts in SQLite?

The created_at column is insert-stamped, not commit-stamped, so a long-held transaction makes windowed counts disagree with COUNT(*) for minutes. Rows created-then-deleted also appear in windowed counts but not totals; reconcile both before concluding an anomaly.

Why does SELECT COUNT(*) with a subquery return 1 in SQLite?

An aggregate column with no FROM clause returns SQLite's implicit single row, giving 1 instead of the table count. Use the form (SELECT COUNT(*) FROM entries) as a subquery or COUNT(*) FROM entries directly.

Can the sqlite3 CLI read vec0 vector tables?

The plain sqlite3 CLI often cannot load the vec0 extension, so vector tables are unreadable that way. Use the schema and triggers as evidence instead of querying the vec tables directly.

Why do duplicate rows appear when multiple servers share one SQLite bank?

Multiple server processes on one bank each run a watcher, causing concurrent ingests of the same file event and duplicate rows through a non-atomic check-then-insert. The fix is a UNIQUE index on the identifying columns or a single designated ingester.