memory-harness-skilllisted
Install: claude install-skill vaibhav-deveree/skill-awesome
# Database-Backed Memory Harness
The Memory Harness is an extremely token-efficient, database-backed state-tracking system designed to maintain zero hallucination and massive context retention across sessions. By using a local SQLite database instead of reading massive Markdown files, agents consume minimal tokens to fetch exactly the context they need.
## Rule 1: Always Initialize the Harness
When starting work in a new project, you MUST verify if the `.memory/memory.db` file exists. If it does not, you must initialize it using the provided DB Engine script:
1. Ensure the `db_engine.py` script from this skill is placed inside the project's `.memory/` directory.
2. Run `python .memory/db_engine.py init` to generate the database tables (`intent`, `state`, `history`, `changelog`, `architecture`).
## Rule 2: Token-Efficient Querying
To maximize token efficiency, NEVER read the entire database. Use specific SQL queries via the wrapper script to fetch only the rows you need right now.
Example:
`python .memory/db_engine.py query "SELECT * FROM state WHERE status = 'IN_PROGRESS'"`
`python .memory/db_engine.py query "SELECT * FROM intent ORDER BY timestamp DESC LIMIT 3"`
## Rule 3: Updating State (Zero Hallucination)
When you complete a task or make a decision, you MUST log it to the database immediately to ensure zero hallucination for future agents.
Use the built-in CLI commands to log changes:
- **Intent**: `python .memory/db_engine.py log_intent --category "feature" --content