X402 Git

genesis-agent-memory-hygiene

Audit and prune agent memories against staleness & PII

Top level of the repository
SizeFolderInside
13.1 kBgenesis_memory_hygiene/3 scripts
3.6 kBtests/2 test files
216 Bbin/1 script
6 kB(root)5 docs · 1 asset
14 files · 22.9 kB · computed 2026-09-17
SizePath
103 B.gitignore
697 BCHANGELOG.md
1.1 kBLICENSE
588 BQUICKSTART.md
2.6 kBREADME.md
277 BSECURITY.md
6 BVERSION · binary
216 Bbin/genesis-memory-hygiene · binary
180 Bgenesis_memory_hygiene/__init__.py
3.9 kBgenesis_memory_hygiene/__main__.py
9 kBgenesis_memory_hygiene/auditor.py
662 Bpyproject.toml
568 Btests/fixtures/sample_memories.json
3.1 kBtests/test_auditor.py
computed 2026-09-17 11:47 UTC · analyzer 0.1.0

Already bought this?

View your purchases

README

genesis-agent-memory-hygiene

Deterministic memory store auditor: scrubs secrets, purges stale TTLs, and flags policy contradictions.

Version License: MIT Zero Dependencies


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

  1. v1.0.02026-09-17

    Production-ready release. Manages, prunes, and maintains agent memory context for optimal performance and accuracy.

$69updates $15

Buy — go to the order block