correction-pipeline
What it does
This skill sets a process for the AI agent to handle corrections of facts in its notes or knowledge brain. It is for people who rely on the agent's stored knowledge and need errors fixed at the root.
When to use it
- βWhen you correct a fact the agent stated and you want it fixed everywhere.
- βWhen a bad page in the knowledge brain keeps producing the same wrong answer.
- βWhen you want the agent to find out whether an error came from its data or from a guess.
Skill link
https://github.com/garrytan/gbrain/blob/master/plugin-variants/gbrain-coding/skills/correction-pipeline/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βYou said our office moved to Lisbon, but that is wrong. Please find where that came from and fix it.β
5 new skills a week. 1 minute to read.
How it works
The agent acknowledges the error, searches the brain for the claim, finds whether the data or the model caused it, and fixes the source.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Correction Pipeline
Convention: see conventions/brain-first.md β Step 1 of the root-cause chain IS the brain-first lookup chain (
searchfor exact tokens,queryfor concept-shaped questions) before anything else.Convention: see _brain-filing-rules.md β corrections edit pages in place; the page stays filed by primary subject.
Trigger
ANY factual error the user identifies. No exceptions. No "I'll note that."
(Routing here is a harness convention, not a mechanical guarantee β but once this skill is in play, the no-exceptions contract above is the discipline.)
Immediate Response
- Acknowledge the error. Don't defend. Don't explain. Just: "You're right. I got that wrong."
- Quote the specific wrong claim so the user can see you know exactly what was wrong.
- State the correct fact as the user gave it.
Root Cause Analysis (do THIS, not just a memory note)
Run these steps IN ORDER. Report findings to the user.
Step 1: Search the brain
gbrain search "<relevant terms>" --limit 10
For concept-shaped or synonym-phrased claims, escalate to gbrain query "<question>" (LLM expansion recovers phrasings search misses). To list
every indexed page carrying the claim, use a keyword search (it pages every
match); grep the checkout only for edits not yet synced:
gbrain search '"<wrong claim terms>"' --match keyword
BRAIN_DIR=$(gbrain config get sync.repo_path)
grep -ri "<wrong claim terms>" "$BRAIN_DIR/people/" "$BRAIN_DIR/companies/" "$BRAIN_DIR/concepts/" 2>/dev/null
Question: Is the wrong fact IN the brain? If yes β the brain is the contamination source. Fix the brain page (Step 6).
Step 2: Search memory files
Grep the harness's always-loaded memory files (e.g. the workspace MEMORY.md
and any memory/*.md companions β the exact location depends on your
harness):
grep -ri "<wrong claim terms>" <memory files> 2>/dev/null
Question: Is the wrong fact in memory? If yes β memory is the contamination source. Fix the memory file.
Step 3: Check SOUL.md and USER.md
grep -i "<relevant terms>" <workspace>/SOUL.md <workspace>/USER.md 2>/dev/null
Question: Is there a misleading passage that could have led to the wrong inference? SOUL.md and USER.md are in every context window β a vague or ambiguous line here propagates into every session.
Important: on gbrain installs these files are RENDERED from the bootstrap
answer bank (state/interview.json). Note the finding here; the fix goes
through the answer bank in Step 6, never through a direct edit.
Step 4: Check the facts table
gbrain recall <entity-slug> # facts about the subject, newest first
gbrain recall --grep "<claim terms>" # substring filter when the entity is unclear
Is there a wrong fact with high confidence? Note its fact id.
Step 5: Classify the error
| Classification | Description | Fix surface |
|---|---|---|
| BRAIN_ERROR | Wrong fact exists in a brain page | Edit the page in the brain repo, commit, re-sync |
| MEMORY_ERROR | Wrong fact exists in memory files | Fix the memory file |
| SOUL_USER_ERROR | Misleading passage in SOUL.md or USER.md | Fix the ANSWER BANK, re-render β never the rendered file |
| FACTS_TABLE_ERROR | Wrong fact in the gbrain facts table | recall β forget <fact-id> β remember the correction |
| HALLUCINATION | No source β LLM confabulated from partial signals | Name the contamination vector (what partial signals led to it), write a guard fact |
| STALE_DATA | Fact was once true but is no longer | Update the source with current truth; supersede the stale fact |
| CROSS_CONTAMINATION | Correct fact about person A attributed to person B | Fix attribution in the source β on BOTH entities |
Step 6: Fix the source
- BRAIN_ERROR: Edit the page file in the brain repo. Include
[Source: user correction, YYYY-MM-DD]on the corrected line. Commit, thengbrain syncso the DB reflects the fix. (Editing the DB row without the repo file β or vice versa β leaves the two out of agreement until the next sync overwrites one of them.) - MEMORY_ERROR: Edit the memory file. Add a correction note with date.
- SOUL_USER_ERROR: NEVER edit SOUL.md / USER.md directly β they are rendered files, and a hand edit is silently lost on the next render.
FAQ
What are the two kinds of error?
The skill says an error is either bad data in a page or file, or a hallucination from partial signals.
Does it just make a note?
No. The skill requires tracing the error to its source and fixing it there.
Does it search the brain first?
Yes. The first step is a brain search for the relevant terms.
Details
Original description by the author
When the user corrects a factual error, root-cause it immediately. Don't just note the correction β trace the error to its source, fix the source, and prevent recurrence. Every factual error is either a data error (bad brain page, bad memory file, bad rendered SOUL/USER identity, bad facts row) or a hallucination (LLM confabulated from partial signals).
repo: garrytan/gbrain
Popularity
- GitHub stars
- 31k
- Ranking position
- #9253
- License
- MIT
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
gbrain
31kLets your agent search a shared company knowledge brain for facts about people, projects and decisions, and save durable notes to it.
brain-ingest-gate
31kChecks new content against an existing knowledge brain before it is added, to avoid duplicates and resolve named entities first.
brain-link-discipline
31kMakes sure your agent includes a working link to each brain page it reports, in the same message, so you can open it right away.
brain-ops
31kGives your agent the core routine for a knowledge brain: check existing context first, save explicit notes with their source, and link related pages.
Similar skills
graincrawl
394kLets your agent search your saved Granola meeting notes and transcripts, check how fresh they are, and count them over a period.
notcrawl
394kLets your agent search a saved copy of your Notion workspace, look up pages and databases, and export pages to Markdown files.
knowledge-entities
394kHelps your agent identify people, companies, and projects, then write sourced profile pages for them in your Knowledge vault.