Inspect and correct
Read what memidex knows, find out why a step was told something, and correct records when they are wrong.
Read knowledge through agent-qa rather than by opening files. Trust, status and validity are worked out when you ask, so a raw record.md can be out of date or already superseded.
Every command below takes --json and then prints exactly what the matching MCP tool returns. Text output masks secrets the same way.
Read
| Question | Command | MCP tool |
|---|---|---|
| Which records exist, with their trust? | agent-qa knowledge bundles | agent_qa_list_knowledge_bundles |
| Records by product, kind, status or anchor | agent-qa knowledge inspect | agent_qa_inspect_knowledge_records |
| One record and where it came from | agent-qa knowledge show <recordId> | agent_qa_show_knowledge_record |
| What changed since a run count or build tag | agent-qa knowledge diff <ref> | agent_qa_diff_knowledge_records |
| Which checks did a record pass? | agent-qa knowledge gates <recordId> | agent_qa_list_knowledge_gates |
| What did a run use and learn? | agent-qa runs knowledge <runId> | agent_qa_get_run_knowledge |
| Why did a step's brief say what it said? | agent-qa knowledge brief-why <runId> --step <n> | agent_qa_explain_brief |
| Find a record from a few words | agent-qa entities resolve "<words>" | agent_qa_get_entity |
knowledge inspect filters with --product, --scope, --kind fact|procedure|caution|unknown|policy, --status active|candidate|superseded|deprecated, --anchor, --record, --as-of-build <n> and --unresolved (open unknowns only).
knowledge diff takes a run count, or a build tag with --product. knowledge brief-why also takes --test <testId> for runs with several tests and --record <id> to follow one record.
$ npx agent-qa knowledge bundles
Knowledge bundles (2)
caution-error-timeout-checkout-spinner-never-set-f36fe70ffa80f011
product: komazon
kind: caution
status: candidate
trust: 0.750
counters: confirmed=1 contradicted=0 helpful=0 harmful=0
validity: 2..open
…Correct
The best correction is feedback on a run. When a verdict was wrong, mark it, and agent-qa works out which record or test to fix.
To act on one record directly, use these three operations. Each applies at once.
| Operation | What it does |
|---|---|
knowledge.accept | Confirms a record as a person, then checks it for promotion again. Accepting a policy record appends the rule to your policies. |
knowledge.reject | Retires a record. A reason is required. |
knowledge.forget | Retires a record and removes it from search, so it stops being found at all. |
There is no CLI command for them. Use the MCP tool agent_qa_change_knowledge, ask in chat, or call the function directly:
npx agent-qa fn knowledge.forget --input '{"target":{"grain":"bundle","shortId":"MEM-001"}}'Roll back a batch
agent-qa knowledge rollback undoes everything one curation job did, or a whole campaign, by appending events that cancel the originals. It prints what it will undo, then applies it.
npx agent-qa knowledge rollback --job <jobId>
npx agent-qa knowledge rollback --from-build 12 --to-build 15 --origin-class agent-verifiedA campaign can also be narrowed with --anchor-cluster <key>. Records it created are retired, and records it superseded come back.
Purge a record
agent-qa knowledge purge <record-id> deletes a record from this machine for good: its folder, its queue entries and its index rows. It leaves a small receipt with no content in memory/receipts/, so the removal is visible in review. Purging does not rewrite git history. If the record held something sensitive that was already committed, you also need to rewrite the history; the command prints guidance.
Maintenance
| Command | What it does |
|---|---|
agent-qa knowledge rebuild-index | Rebuilds the search index from the records. Safe at any time. |
agent-qa knowledge drain | Finishes queued curation now, without a model. --status only reports what is left. |
agent-qa doctor | Reports the index, the embedding model, the search level and the learning mode. |
These commands need the writer lease. While a daemon holds it, they refuse or hand the work to the daemon.
Rules of thumb
- Never edit files under
agent-qa-knowledge/memory/by hand. A changed file no longer matches its record's hashes, and the record stops being served. - Commit knowledge like code: read the diff, keep what is right, revert what is not.
agent-qa doctorwarns when an old v0.1agent-qa-memory/folder is still around. It is not used and is safe to delete.