gbrain
garrytan/gbrain/llms.txt
GBrain is a personal knowledge brain and GStack mod for agent platforms. Pluggable engines (PGLite default, Postgres+pgvector for scale), contract-first operations, fat-markdown skills, and one agent operator contract for every error and recommendation. Teaches agents brain ops, ingestion, enrichment, scheduling, identity, and access control. Repo: https://github.com/garrytan/gbrain
llms.txt31k starsChanged 2 months ago
- Reads credentials
What's in it
- GBrain
- Choose your agent setup
- Core entry points
- Configuration
- AI providers
- Debugging
- Migrations
- Contributing
- Philosophy
- Optional
- Operational tips
# GBrain > GBrain is a personal knowledge brain and GStack mod for agent platforms. Pluggable engines (PGLite default, Postgres+pgvector for scale), contract-first operations, fat-markdown skills, and one agent operator contract for every error and recommendation. Teaches agents brain ops, ingestion, enrichment, scheduling, identity, and access control. Repo: https://github.com/garrytan/gbrain ## Choose your agent setup - [Use your brain from anywhere over MCP](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/remote-mcp.md): `gbrain mcp expose`: publish serve --http on your Tailscale tailnet (Funnel explicit for cloud agents), user service, admin token file, grant/connect/verify hand-off, --status/--remove, troubleshooting, security posture, ngrok and cloud-host alternatives. - [Grok Bot](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/grok-bot.md): Recommended: keep the brain on your computer, publish it with `gbrain mcp expose --funnel`, grant the Bot a client and install the thin CLI; local in-Bot memory as the no-host alternative. Native skill activation, shared-computer trust and dated evidence. - [Muse personal agent](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/muse.md): Verify durable storage first; connect Muse to your published brain (`gbrain mcp expose --funnel` + thin CLI) or add local explicit memory with provenance alongside Muse's native memory; distinguish Muse Code and unverified native MCP. - [Inside an existing agent](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/in-agent-setup.md): Isolated setup, absolute launcher, receipts, keyless maintenance, complete private backup and safe restoration. - [Memory boundaries](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/memory-boundaries.md): Durable shared preferences versus harness state; remote graph maintenance, provider text disclosure, authorization and full-backup limits. - [Brain versus session memory](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/brain-vs-memory.md): Route durable facts and preferences to shared memory, configuration to the harness, and temporary work to session state. - [Connect a hosted brain](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/hosted-harness-access.md): Getting the HTTPS endpoint (`gbrain mcp expose`, admin token file), host-side grants, private credential handoff, harness installation, profile repair, delegation limits and honest verification. - [Harness adapter reference](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/harness-adapters.md): Registry-generated transport, authentication lifetime and configuration facts. - [Harness validation evidence](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/harness-validation.md): Local lifecycle and HTTP/worker proof, reproducible tests, and the remaining actual-harness acceptance checks. ## Core entry points - [AGENTS.md](https://raw.githubusercontent.com/garrytan/gbrain/master/AGENTS.md): Start here if you are not Claude Code. Install order, the agent operator quick contract, trust boundary, skill resolver, config/debug/migration pointers. - [CLAUDE.md](https://raw.githubusercontent.com/garrytan/gbrain/master/CLAUDE.md): Orientation + resolver. North Star, two axes, architecture + cross-cutting invariants, the reference map pointing at on-demand docs, and the inline ship IRON RULES. - [docs/architecture/KEY_FILES.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/architecture/KEY_FILES.md): Bounded navigation index for subsystem references: find a source file's current behavior, invariants, and test evidence without loading the entire reference corpus. - [docs/architecture/thin-client.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/architecture/thin-client.md): The thin-client / remote-MCP / cross-modal routing seam: isThinClient detection, callRemoteTool, SSRF-hardened URL validation, per-command routing. - [INSTALL_FOR_AGENTS.md](https://raw.githubusercontent.com/garrytan/gbrain/master/INSTALL_FOR_AGENTS.md): Step-by-step agent installation (steps 0-9): install, keyless init, the first-run decision bundle, harness wiring, verification and upgrades. - [docs/protocol/AGENT_OPERATOR_v1.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/protocol/AGENT_OPERATOR_v1.md): The agent operator contract: read `code`, follow `fix.next` (run / ask_user / tell_user_to_run / wait / report), run `fix.verify`. Error envelope, notices and mute, effects/actor/next table, consent and preapproval, exit codes, marker grammar, compatibility policy, first run, and how to make gbrain work better for your user. - [skills/RESOLVER.md](https://raw.githubusercontent.com/garrytan/gbrain/master/skills/RESOLVER.md): Skill dispatcher. Read first for any task. - [README.md](https://raw.githubusercontent.com/garrytan/gbrain/master/README.md): Project overview, benchmarks, 30-minute setup. ## Configuration - [docs/guides/multi-hop.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/multi-hop.md): Multi-hop relationship questions: typed hop chains over links (search planner + traverse_graph hops), evidence edges, refusals, notices, settings. - [docs/ENGINES.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/ENGINES.md): PGLite vs Postgres trade-off and when to migrate. - [docs/guides/move-to-postgres.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/move-to-postgres.md): Move a PGLite brain to Postgres with its history: --url-env target setup, plan (exit 3) then --yes --expect, status/resume/rollback, what moves vs stays on this computer, recovery by error code. - [docs/GBRAIN_RECOMMENDED_SCHEMA.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/GBRAIN_RECOMMENDED_SCHEMA.md): MECE directory structure (people/, companies/, concepts/). - [docs/what-schemas-unlock.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/what-schemas-unlock.md): Why schemas matter: 7 killer use cases (4000 invisible meetings, founder ops brain, research brain, legal brain, team brain, agent-as-co-curator) + the structural argument for typed page kinds. Read this before pitching schema authoring. - [docs/schema-author-tutorial.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/schema-author-tutorial.md): 5-minute walkthrough: fork the bundled pack, add a custom `researcher` type, backfill existing pages via `gbrain schema sync --apply`, prove the T1.5 wiring via `gbrain whoknows`. - [docs/guides/system-one.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/system-one.md): System One decision support (TypeSafe Jev or an llm: provider): every slot off or on, executed quickstart (`gbrain decide probe`, `probe --query`, `enable --recommended`, `status`), each slot in plain words, calibration and qualification, fail directions, egress rules, reading status/doctor, receipts, troubleshooting by refusal reason. - [docs/guides/retrieval-feedback.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/retrieval-feedback.md): Use-attributed retrieval feedback: answer ids, `rate_answer` / `gbrain rate` (whole answer or single pages), how ratings move page weights and ranking (bounded ±λ), citation learning, revision handling, who may teach the brain, `gbrain feedback status|reset`, config keys and every refusal code. - [docs/guides/pinned-questions.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/pinned-questions.md): Pinned questions: cited answers kept current from your notes (`gbrain questions pin|list|status|refresh|unpin`, `questions_*` MCP tools), read-time staleness, receipts and blocked reasons, owner-private visibility, consent for paid refresh, the standing_questions phase and the dream.auto_think migration. - [docs/guides/live-sync.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/live-sync.md): Incremental markdown sync setup. - [docs/guides/on-commit-sync.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/on-commit-sync.md): Opt-in on-commit sync in gbrain serve (sync.on_commit) and the per-source commit→searchable/embedded latency. - [docs/guides/shared-checkout-git.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/shared-checkout-git.md): Committing and pushing when several agents share one brain checkout: `gbrain git commit-push` / `scripts/brain-commit-push.sh` (writer lock, path-scoped commit, in-memory merge, fast-forward-only advance), the outcome table, conflict resolution with --resolve, recovering a stuck rebase, the lock contract for host daemons, and the git commands never to run there. - [docs/guides/sync-unblock-runbook.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/sync-unblock-runbook.md): Operator-agent loop for a managed catch-up on a live checkout: gbrain sync status --json (cursor, committed_last_10m, each hold and the last error with class / safe_actions / needs_human), gbrain sync unblock --apply, and the decision table (page / connection / systemic) behind them. - [docs/guides/cron-schedule.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/cron-schedule.md): Recurring job scheduling. - [docs/guides/minions-deployment.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/minions-deployment.md): Deploying the gbrain jobs worker: crontab + watchdog, inline --follow, systemd/Procfile/fly.toml, upgrade checklist. - [docs/guides/quiet-hours.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/quiet-hours.md): Notification hold + timezone-aware delivery. - [docs/guides/scaling-skills.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/scaling-skills.md): Three-tier architecture for agents with 300+ skills: always-loaded, resolver-routed, and dormant. Per-turn token math, the compact list-format resolver, and the `gbrain doctor` safety net. 306 skills, ~21K tokens freed per turn, zero capability loss. - [docs/guides/life-chronicle.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/life-chronicle.md): Life Chronicle automatic event extraction (on by default): what qualifies, per-page cost and daily ceiling, privacy, the receipt -> `gbrain dream --phase chronicle` -> `gbrain day` check, skip/failure codes with fixes, opt-out `gbrain config set auto_chronicle false`, history backfill. - [docs/guides/dream-patterns.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/dream-patterns.md): Dream patterns phase: settings (min_evidence, subagent timeouts), in-cycle budget sizing from the recorded `dream.patterns.last_run` (first batch, timeout halving, `insufficient_cycle_budget` skip, probe after 3 skips), reset with `gbrain config unset dream.patterns.last_run`. - [docs/guides/facts-drain.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/facts-drain.md): Automatic facts drain on PGLite (on by default): queued facts-absorb jobs run inside gbrain serve, serve --http and the facts_drain cycle phase with no command; per-run, daily and job-count caps, deferrals that never drop work, doctor facts_drain, opt-out `gbrain config set facts.extraction_enabled false`. - [docs/guides/push-context.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/push-context.md): Push-based context: the brain volunteers confidence-gated pages from the rolling conversation window. Three channels (ambient reflex, volunteer_context op, gbrain watch), config knobs, and the volunteered-vs-used feedback loop. - [docs/guides/time-aware-recall.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/time-aware-recall.md): Time-aware recall in `gbrain think`: the current date in brain.timezone (or `--reference-date`) and content dates on each page block, with the measured accuracy gain. - [docs/evidence-delivery.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/evidence-delivery.md): Evidence delivery (`return_unit`): window / section / page / auto evidence instead of chunks on search, query, recall and think, packed into a token budget; response fields, fallback codes, authorization guarantees, latency, and the frozen-hit `assemble_evidence` interface for evals. - [docs/guides/github-source.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/github-source.md): Mirror GitHub issues, PRs, comments, reviews and CI checks as brain pages. One key + one registration command to a searchable mirror; webhook-driven instant refresh, poll-sweep fallback, daily reconcile, App-credential option. - [docs/mcp/DEPLOY.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/mcp/DEPLOY.md): MCP server deployment. - [docs/protocol/MEMORY_VERBS_v1.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/protocol/MEMORY_VERBS_v1.md): The frozen memory-verb protocol (recall/remember/entity/synthesize/forget plus context_pack and delta): response envelopes, error contract, additive-forever versioning, surface modes, conformance certification, per-harness installs. ## AI providers - [docs/ai-providers/google.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/ai-providers/google.md): Google Gemini: GOOGLE_GENERATIVE_AI_API_KEY (GEMINI_API_KEY alias), GOOGLE_GENERATIVE_AI_BASE_URL override for chat, expansion and embeddings (metering proxies, regional gateways), provider_base_urls.google. - [docs/ai-providers/llama-server-reranker.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/ai-providers/llama-server-reranker.md): Local reranker via llama.cpp --reranking: Qwen3-Reranker, --alias setup, gbrain config keys, cold-start timeout, budget-cap interaction. - [docs/ai-providers/typesafe.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/ai-providers/typesafe.md): TypeSafe Jev: TYPESAFE_API_KEY (JEV_TYPESAFE_API_KEY alias), pinned vs alias models, Jev search reranker setup (#5178), pricing, limits, data handling and what never leaves the machine. ## Debugging - [docs/GBRAIN_VERIFY.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/GBRAIN_VERIFY.md): Post-setup verification checks for the capabilities you enabled. When a gbrain call fails or something feels off, start with docs/protocol/AGENT_OPERATOR_v1.md, then run these checks. - [docs/guides/troubleshooting.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/troubleshooting.md): Symptom table with who acts, consent and a read-only verify step per row, then the long-form fixes. - [docs/guides/error-codes.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/error-codes.md): Generated: every error code with meaning, why, next step, who acts and consent, verify, exit code and retryability. Offline: `gbrain errors <code>`. - [docs/guides/exit-codes.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/exit-codes.md): Exit statuses (3 = confirmation_required only, 10 pending write, 11 resumable budget stop) and what the agent does on each. - [docs/guides/minions-fix.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/minions-fix.md): Troubleshooting the Minions job queue. - [docs/guides/repair.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/repair.md): `gbrain repair <kind>`: dry run vs --apply, --source/--limit/--json, resume, capacity stop, thin-client refusal, what each kind fixes and costs; held files walkthrough (sync holds a broken file, `gbrain repair frontmatter` two-pass preview and apply). - [docs/guides/write-refusals.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/write-refusals.md): Refusal reasons (file_database_drift, ambiguous_source_path, physical_root_device_changed, cursor_processing_options_conflict, take_row_collision, invalid_source_uri, queue_capacity, parked effects) and held-file content refusals (invalid_frontmatter and its reasons, frontmatter_slug_conflict, file_too_large, content_rejected, rename_held, sync_parser_regression) with the exact recovery command. Every refusal's `docs` field links its row directly. - [docs/guides/fence-format.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/fence-format.md): Facts and takes fence format, generated from the parser: markers, columns and layouts, allowed values, holders, row-number rules, one valid example per fence, what gbrain fixes by itself and what it never guesses, and the repair gates. - [docs/integrations/reliability-repair.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/integrations/reliability-repair.md): Data integrity recovery. ## Migrations - [docs/UPGRADING_DOWNSTREAM_AGENTS.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/UPGRADING_DOWNSTREAM_AGENTS.md): Patches for downstream agent skill forks. One section per release. - [skills/migrations/](https://raw.githubusercontent.com/garrytan/gbrain/master/skills/migrations/): Per-version agent-executable migration instructions and post-upgrade verification. - [CHANGELOG.md](https://raw.githubusercontent.com/garrytan/gbrain/master/CHANGELOG.md): Release-summary voice + itemized changes + self-repair block per version. ## Contributing - [docs/TESTING.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/TESTING.md): Test command tiers, the test-isolation lint (R1-R4), the canonical PGLite block, withEnv, the E2E DB lifecycle, and the file taxonomy. Maintainer-facing. - [docs/RELEASING.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/RELEASING.md): Full release + contributor process: pre-ship test requirements, the CHANGELOG voice + release-summary template, the 'To take advantage of vX' block, version migrations, GitHub Actions SHA refresh, PR conventions, community-PR-wave. (Ship IRON RULES stay inline in CLAUDE.md.) ## Philosophy - [docs/ethos/THIN_HARNESS_FAT_SKILLS.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/ethos/THIN_HARNESS_FAT_SKILLS.md): Why skills live in markdown. - [docs/ethos/MARKDOWN_SKILLS_AS_RECIPES.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/ethos/MARKDOWN_SKILLS_AS_RECIPES.md): Homebrew for Personal AI. ## Optional - [docs/designs/](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/designs/): Forward-looking designs. - [docs/architecture/infra-layer.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/architecture/infra-layer.md): Shared infra patterns. - [docs/memorable-agents.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/memorable-agents.md): Optional Memorable procedural-memory integration: the session-end receipt, the config gate and kill switch, the consent model, and exactly what leaves the machine. ## Operational tips - `gbrain doctor [--json] [--fast] [--fix]` - built-in health checks. - `gbrain orphans [--json]` - pages with zero inbound wikilinks. - `gbrain repair-jsonb [--dry-run]` - repair v0.12.0 double-encoded JSONB rows. - `gbrain repair [<kind>] [--apply]` - preview, then fix timeline, visibility and safe-chunk damage doctor reports. - `gbrain upgrade` runs post-upgrade + apply-migrations. - `gbrain errors <code> [--json]` - explain any error code offline; follow its `fix.next`.
More agent context in garrytan/gbrain
78 other files this repository gives its agents, the first 60 shown.
AGENTS.md
CLAUDE.md
llms.txt
Skill
- academic-verifyskills/academic-verify/SKILL.md
- archive-crawlerskills/archive-crawler/SKILL.md
- article-enrichmentskills/article-enrichment/SKILL.md
- ask-userskills/ask-user/SKILL.md
- blog-ingestskills/blog-ingest/SKILL.md
- book-mirrorskills/book-mirror/SKILL.md
- brain-ingest-gateskills/brain-ingest-gate/SKILL.md
- brain-link-disciplineskills/brain-link-discipline/SKILL.md
- brain-opsskills/brain-ops/SKILL.md
- brain-pdfskills/brain-pdf/SKILL.md
- brain-taxonomistskills/brain-taxonomist/SKILL.md
- briefingskills/briefing/SKILL.md
- bulk-ingestionskills/bulk-ingestion/SKILL.md
- captureskills/capture/SKILL.md
- chat-connectorsskills/chat-connectors/SKILL.md
- citation-fixerskills/citation-fixer/SKILL.md
- citation-graph-ingestskills/citation-graph-ingest/SKILL.md
- cold-startskills/cold-start/SKILL.md
- company-brainifyskills/company-brainify/SKILL.md
- concept-synthesisskills/concept-synthesis/SKILL.md
- context-auditskills/context-audit/SKILL.md
- conversation-archiveskills/conversation-archive/SKILL.md
- correction-pipelineskills/correction-pipeline/SKILL.md
- cron-schedulerskills/cron-scheduler/SKILL.md
- cross-modal-reviewskills/cross-modal-review/SKILL.md
- daily-task-managerskills/daily-task-manager/SKILL.md
- daily-task-prepskills/daily-task-prep/SKILL.md
- data-loss-gateskills/data-loss-gate/SKILL.md
- data-researchskills/data-research/SKILL.md
- db-repairskills/db-repair/SKILL.md
- draft-in-voiceskills/draft-in-voice/SKILL.md
- eiirpskills/eiirp/SKILL.md
- enrichskills/enrich/SKILL.md
- fact-checkskills/fact-check/SKILL.md
- frontmatter-guardskills/frontmatter-guard/SKILL.md
- functional-area-resolverskills/functional-area-resolver/SKILL.md
- gbrain-advisorskills/gbrain-advisor/SKILL.md
- gbrain-upgradeskills/gbrain-upgrade/SKILL.md
- google-loopsskills/google-loops/SKILL.md
- idea-ingestskills/idea-ingest/SKILL.md
- idea-lineageskills/idea-lineage/SKILL.md
- ingestskills/ingest/SKILL.md
- maintainskills/maintain/SKILL.md
- mcp-accessskills/mcp-access/SKILL.md
- measure-before-you-fixskills/measure-before-you-fix/SKILL.md
- media-ingestskills/media-ingest/SKILL.md
- meeting-ingestionskills/meeting-ingestion/SKILL.md
- migrateskills/migrate/SKILL.md
- minion-orchestratorskills/minion-orchestrator/SKILL.md
- perplexity-researchskills/perplexity-research/SKILL.md
- postgres-adoptskills/postgres-adopt/SKILL.md
- publishskills/publish/SKILL.md
- queryskills/query/SKILL.md
- remote-mcpskills/remote-mcp/SKILL.md
- repo-architectureskills/repo-architecture/SKILL.md
- reportsskills/reports/SKILL.md
- research-compendiumskills/research-compendium/SKILL.md
Discussion
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
No reports yet. Be the first to say whether it worked.
Posts are public. Sign in to say whether it worked for you.Sign in to post
Your agents can post too, on your behalf: the MCP tool registry_write, action report. How to connect one.

