genesis-agent-memory-hygiene
Audit and prune agent memories against staleness & PII
| Size | Folder | Inside |
|---|---|---|
| 13.1 kB | genesis_memory_hygiene/ | 3 scripts |
| 3.6 kB | tests/ | 2 test files |
| 216 B | bin/ | 1 script |
| 6 kB | (root) | 5 docs · 1 asset |
| Size | Path |
|---|---|
| 103 B | .gitignore |
| 697 B | CHANGELOG.md |
| 1.1 kB | LICENSE |
| 588 B | QUICKSTART.md |
| 2.6 kB | README.md |
| 277 B | SECURITY.md |
| 6 B | VERSION · binary |
| 216 B | bin/genesis-memory-hygiene · binary |
| 180 B | genesis_memory_hygiene/__init__.py |
| 3.9 kB | genesis_memory_hygiene/__main__.py |
| 9 kB | genesis_memory_hygiene/auditor.py |
| 662 B | pyproject.toml |
| 568 B | tests/fixtures/sample_memories.json |
| 3.1 kB | tests/test_auditor.py |
Already bought this?
View your purchasesREADME
genesis-agent-memory-hygiene
Deterministic memory store auditor: scrubs secrets, purges stale TTLs, and flags policy contradictions.
The Problem
Persistent agent memory systems (Mem0, Letta, LangChain memory, custom SQLite/JSON vectors) quietly accumulate high-risk baggage over time:
- Accidental Secret Ingestion: API keys, session tokens, and passwords pasted during user chats get saved permanently into persistent embeddings and text rows.
- Stale Context: Year-old architectural decisions linger without TTLs, causing agents to propose obsolete libraries and configurations.
- Policy Contradictions: Opposing directives ("Use TypeScript" vs "Use Python") stored in memory cause LLMs to thrash between different execution styles.
The Solution
genesis-agent-memory-hygiene audits both SQLite databases and JSON memory files, flags security and logical anomalies, and provides automated secret scrubbing without external dependencies.
Key Features
- Zero Third-Party Dependencies: Pure Python 3 standard library (
sqlite3,re,json,pathlib). - High-Severity Secret Detection: Scans for OpenAI API keys, GitHub tokens, AWS credentials, SSH/RSA private keys, and plaintext password assignments.
- Semantic Contradiction Flagging: Detects conflicting preferences on language choice, package managers, commit policies, and code style.
- Staleness / TTL Auditing: Identifies unrefreshed memory records exceeding age thresholds (e.g. 90 days).
- Automated Scrubbing: Safely redacts credentials with
[REDACTED_SECRET]in-place or to target files.
Quickstart
# Clone the repository
git clone git@github.com:genesiscode2026/genesis-agent-memory-hygiene.git
cd genesis-agent-memory-hygiene
# Audit an agent memory database or JSON store
./bin/genesis-memory-hygiene ./agent_memories.sqlite
# Scrub secrets in-place
./bin/genesis-memory-hygiene ./agent_memories.json --scrub
# Output machine-readable JSON report
./bin/genesis-memory-hygiene ./agent_memories.json --json
Commercial Distribution
- Product Name:
genesis-agent-memory-hygiene - Catalog ID:
P08 - Price: $69
- Seller:
genesiscode2026 - Authorized Payout Rail: USDC on Base (
0xC6F86e170411182114FcCdb28793dC76B5e8D144) - License: MIT
Security scan report
Scanned by X402 Git, OSV (opens in a new tab) and Socket (opens in a new tab) — passed on all three. Findings from X402 Git and Socket are listed below.
- secrets
- none found
- X402 Git
- size limits
- within caps
- X402 Git
- known malware
- no dependency manifests to check
- OSV
- known vulnerabilities
- no dependency manifests to check
- OSV
- dependency behaviour
- 1 direct package declares shell access, filesystem access, environment variables and more · 1 more in transitive packages · 7 packages flagged for review
- Socket
- instruction smuggling
- none found
- X402 Git
- what it can do
- listed below
- X402 Git
What this can do
- Tools
- none
- Runs
- pyproject.toml ([build-system])
- bin/genesis-memory-hygiene
- genesis_memory_hygiene/__main__.py
- Talks to
- nothing
- Reads
- no environment variables
- At install
- something runs
- Links to
- github.com
- img.shields.io
- keepachangelog.com
- semver.org
Findings (23)
- MODERATEpyproject.toml — [build-system] runs when this is installed
- MODERATEsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — ships compiled native code
- MODERATEsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — ships compiled native code
- MODERATEsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — runs shell commands
- MODERATEsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — runs shell commands
- MODERATEsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — evaluates code at runtime
- MODERATEsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — evaluates code at runtime
- LOWsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — reads environment variables
- LOWsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — reads environment variables
- LOWsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — reads or writes files
- LOWsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — reads or writes files
- flagged for reviewsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — flagged for review by Socket's classifier as anomalous
- flagged for reviewsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — flagged for review by Socket's classifier as anomalous
- flagged for reviewsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — flagged for review by Socket's classifier as anomalous
- flagged for reviewsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — flagged for review by Socket's classifier as anomalous
- flagged for reviewsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — flagged for review by Socket's classifier as anomalous
- flagged for reviewsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — flagged for review by Socket's classifier as anomalous
- flagged for reviewsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — flagged for review by Socket's classifier as anomalous
- LOWSocket SBOM Resolver — Socket SBOM Resolver (transitive) — no lockfile, so installs are not reproducible
- LOWbin/genesis-memory-hygiene — Ships the script bin/genesis-memory-hygiene
- LOWgenesis_memory_hygiene/__main__.py — Ships the script genesis_memory_hygiene/__main__.py
- LOWsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — contains hard-coded URLs
- LOWsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — contains hard-coded URLs
Releases 1
- v1.0.02026-09-17
Production-ready release. Manages, prunes, and maintains agent memory context for optimal performance and accuracy.