Skip to content

GBrain DB Repair

Diagnoses and fixes broken Postgres access for the gbrain knowledge store, with tiered consent

Repository
garrytan/gbrain
Stars
31,447
Licence
MIT
Files
1 file

What it does

This skill teaches an AI agent how to recover when gbrain, a personal knowledge-store tool, loses its connection to its Postgres database. When an error shows a GBRAIN_DB_ACCESS marker or the operator says the database is down, the agent runs the built-in gbrain db-repair command: it first diagnoses the problem without changing anything, applies low-risk fixes such as reconnecting or running pending migrations only with an explicit flag, asks for approval before rewriting the config file's database URL, and gives manual recipes for credential or account problems instead of changing them itself. It then re-checks the connection before reporting success.

Great for

  • Developers running gbrain with a Postgres or Supabase backend who see connection errors
  • Operators who want a guided, verified recovery instead of manual debugging
  • Teams using gbrain through an AI agent or MCP tools that surface database errors

Skip it if

  • Users on the default local setup with no Postgres database, since there is nothing for this skill to repair
  • Situations where the agent should switch storage engines; the skill explicitly routes that to a different skill because a silent fallback would split data across two stores
  • Anyone expecting the agent to change passwords or credentials automatically; the skill forbids this by design and only relays instructions

Try asking

  • “The brain database is down, please fix gbrain's Postgres access”
  • “I got a GBRAIN_DB_ACCESS error from gbrain, can you repair it?”
  • “gbrain connection refused when I run a search, please diagnose and fix”
  • “Repair gbrain postgres and verify the brain is reachable again”
Step-by-step guide: how to use GBrain DB RepairInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 1 original files, the MIT licence and an attribution note.

    db-repair.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip db-repair.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip db-repair.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Let the agent run the diagnose step first; it changes nothing and shows the planned fix before any action
  • For config URL rewrites, review the printed change and only approve if it matches what you expect; use the undo flag to revert
  • After a successful rewrite, restart any long-running gbrain serve or worker processes so they pick up the new URL

What's inside

  • SKILL.md

Redistributed unmodified from garrytan/gbrain under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.