v0.41.36.0 feat(mcp): publish agent skills (list_skills / get_skill) for thin clients (#1661)
- feat(skill-catalog): host-repo skill catalog core + mcp config keys
New src/core/skill-catalog.ts resolves the agent repo’s skills dir, builds a flat catalog, fetches one skill’s prose, and gates publishing. Path confinement (manifest-vetted lookup + realpath + SKILL.md file-type check), 256KB response cap, frontmatter allowlist, and D7 tool cross-reference live here. config.ts gains the mcp.publish_skills / mcp.skills_dir keys (+ KNOWN_CONFIG entries).
- feat(mcp): list_skills + get_skill read ops for thin-client skill discovery
Two read-scope, non-localOnly ops (dynamic-import skill-catalog to avoid the cycle) let Codex/Claude Code/Perplexity discover and follow the agent’s skills over gbrain serve. Descriptions + the instructional envelope constants are pinned in operations-descriptions.ts.
- feat(mcp): default new installs to publish skills; consent prompt on upgrade
gbrain init writes mcp.publish_skills:true (file plane) so new installs publish by default. gbrain upgrade prompts existing installs once (DB plane), strongly recommending opt-in, showing the resolved skills dir + that SKILL.md contents become readable by authorized remote MCP callers.
- test(skill-catalog): catalog, security-confinement, transport-gate, description pins
40 cases: buildSkillCatalog/getSkillDetail/D7 split (skill-catalog.test.ts), path traversal + symlink + poisoned-manifest + oversize + non-SKILL.md + gate (skill-catalog-security.test.ts), and real dispatchToolCall gate+scope+plane coverage (skill-catalog-transports.test.ts). Plus list_skills/get_skill description + envelope pins.
- chore: bump version and changelog (v0.41.36.0)
MCP skill catalog (list_skills / get_skill) — thin clients can discover and follow the agent repo’s skills over gbrain serve. PR2 (tarball/install) filed in TODOS.
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
- docs: document skill-catalog (list_skills/get_skill + mcp config keys) for v0.41.36.0
Add the src/core/skill-catalog.ts Key-files annotation to CLAUDE.md covering the two new read-scope MCP ops, the mcp.publish_skills / mcp.skills_dir config keys, the full trust-boundary mitigation stack, and the init/upgrade wiring. Regenerate llms-full.txt to match (CI build-llms drift gate).
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
Co-authored-by: Claude Opus 4.8 (1M context) noreply@anthropic.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
GBrain
Search gives you raw pages. GBrain gives you the answer. It’s the brain layer your AI agent has been missing — the only one that does synthesis, graph traversal, and gap analysis in one box.
I’m Garry Tan, President and CEO of Y Combinator. I built GBrain to run my own AI agents. It’s the production brain behind my OpenClaw and Hermes deployments: 146,646 pages, 24,585 people, 5,339 companies, 66 cron jobs running autonomously. My agent ingests meetings, emails, tweets, voice calls, and original ideas while I sleep. It enriches every person and company it encounters. It fixes its own citations and consolidates memory overnight. I wake up smarter than when I went to bed — and so will you.
And now it works as a company brain too. Each person on the team gets their own slice of the brain, scoped by login. When you query, you only see what you’re allowed to see — never another person’s notes, never another team’s data. We fuzz-tested this across every way you can read the brain (search, list, lookup, multi-source reads) and got zero leaks. Drop GBrain in as your team’s shared institutional memory — the company-brain shape YC just put on its Request for Startups. If you’re building in that space, you might as well build on this. Tutorial: set up GBrain as your company brain →
Lots of personal-knowledge systems give you keyword matching and grep in a box. GBrain does that, and adds two things nobody else ships together:
attended,works_at,invested_in,founded,advises) with zero LLM calls. Ask “who works at Acme AI?” or “what did Bob invest in this quarter?” and get answers vector search alone can’t reach. Benchmarked: P@5 49.1%, R@5 97.9% on a 240-page Opus-generated rich-prose corpus, +31.4 points P@5 over its graph-disabled variant and over ripgrep-BM25 + vector-only RAG by a similar margin. Full BrainBench scorecards live in the sibling gbrain-evals repo.The point of building a 100K-page brain is to use it as a strategic moat. To never lose context. To query what’s in your own head without re-reading it. The brain layer is what makes the moat usable. The 24/7 dream cycle is what keeps it sharp. Both run on your hardware, your DB, your keys.
It’s easier to ship a daemon that runs 24/7 to ingest, enrich, and consolidate than it is to keep an agent in chat working hard. GBrain is that daemon, generalized. Install in 30 minutes. Your agent does the work. As my personal agent gets smarter, so does yours.
What this looks like
Say you have a meeting with Alice tomorrow. You want to walk in remembering what she works on, when you last talked, and what’s still open between you. Here’s what you’d type, and what you’d get back.
You ask:
Most personal-knowledge tools give you back a list of pages. Something like:
Five pages you now have to open and read yourself to actually prepare. The tool found the right material, but it didn’t do the work.
GBrain gives you back the answer, with sources:
Every claim has a source page behind it. The “heads up” at the end tells you what the brain doesn’t know yet, so you can ask Alice about it directly instead of being surprised. The brain just did your meeting prep.
This is the difference between a search engine and a brain. Search finds the pages. The brain reads them for you and writes the answer.
Install
GBrain is designed to be installed and operated by an AI agent. The fastest path is to have your agent do it for you. The CLI and MCP paths below are for people who want to wire it up themselves.
Have your agent install it (recommended)
If you don’t already have an AI agent platform running, start with one of these. Both are designed to read GBrain’s install protocol and execute it:
Then paste this into your agent:
The agent installs GBrain, creates the brain, asks for your API keys, loads 43 skills, configures the dream cycle, and verifies the install end-to-end. ~30 minutes. You answer questions, it does the work.
Install it into your existing agent
Already running Codex, Claude Code, Cursor, or another coding agent? Paste the same instruction in:
This works in any agent that can read files over HTTPS and execute shell commands. Tested with Codex, Claude Code, Claude Cowork, Cursor, and AlphaClaw.
CLI standalone (no agent)
Postgres-at-scale, Supabase, and thin-client setup paths live in
docs/INSTALL.md.Connect GBrain to your AI client (MCP)
GBrain exposes 30+ tools over MCP (stdio and HTTP). The specific snippet depends on which client you use:
claude mcp add gbrain -- gbrain serve. Zero server, zero tunnel.{"command": "gbrain", "args": ["serve"]}to your MCP config.claude_desktop_config.jsondoes not work for remote servers.chatgptclient from the admin dashboard with grant typeauthorization_code.For the HTTP server itself:
The HTTP server includes DCR-style client registration, scope-gated access (
read/write/admin), and rate limiting. Deployment guides (ngrok, Railway, Fly.io) live underdocs/mcp/.Two ways to query your brain
Raw retrieval (what most personal-knowledge tools ship) and a synthesis layer that gives you an actual answer. They serve different jobs.
gbrain searchreturns the top retrieved pages, ranked by hybrid scoring (vector + keyword + RRF + source-tier boost + reranker). Use it when you want raw material to skim: agent context windows, citation lookups, finding a specific quote.gbrain thinkruns the same retrieval, then composes a synthesized answer across the results with explicit citations to the source pages AND an honest note on what the brain doesn’t know yet. The gap analysis is the differentiator: the answer tells you when a page is stale, when a claim is uncited, when two pages contradict each other, when there’s a hole you should fill.Why it compounds. Pair the brain layer with
find_trajectoryand you get answers like “how have the company’s metrics changed AND what does the team look like right now AND what did they promise / share AND when did we last meet AND what’s the value-add I can offer here”: well-scored, well-cited, in one shot. That’s the strategic moat. That’s why building a 100K-page brain is worth the effort.gbrain agent run "..."exposes the same surface to a sub-agent through the Minions queue, with crash-safe two-phase persistence. Same answers, durable.How to get data in
One command, local or hosted, synchronous receipt:
The page lands in the database and on disk in one move. Default slug
inbox/YYYY-MM-DD-<hash8>so captures cluster in a predictable triage location. On thin-client installs the verb routes through MCP to the server: same command, same UX.For webhook ingestion (Zapier / IFTTT / Apple Shortcuts):
For mobile capture, the inbox folder source picks up anything dropped into
~/.gbrain/inbox/from iOS Shortcuts / AirDrop / Drafts / Finder.Third-party skillpacks can ship custom ingestion sources (Granola, Linear, voice, OCR) against the versioned
IngestionSourcecontract atgbrain/ingestion. Seedocs/skillpack-anatomy.md.Your brain’s shape (schema packs)
Most personal-knowledge tools force one fixed layout: their idea of “notes” + “people” + “tags.” Drop a Notion export or your own years-old Obsidian vault on top, and the agent doesn’t know what a
Projects/folder means or whetherReading/is people or sources.gbrain doesn’t have a fixed layout. It ships with bundled schema packs and lets you author your own when none fit:
gbrain-base-v2(default as of v0.41.22) — 15-type DRY/MECE canonical taxonomy (14 canonical +notecatch-all):person,company,media,tweet,social-digest,analysis,atom,concept,source,deal,email,slack,writing,project,note. Subtypes/format/origin pushed to frontmatter. The taxonomy that responds to issue #1479.gbrain-base(legacy, v0.41 and earlier brains) — the original 24-type layout. Stays bundled for back-compat; brains on it can upgrade viagbrain onboard --check --explain→gbrain jobs submit unify-types --allow-protected --params '{"target_pack":"gbrain-base-v2"}'.gbrain-recommended— extendsgbrain-basewith the 13 additional directories fromdocs/GBRAIN_RECOMMENDED_SCHEMA.md(source, place, trip, conversation, personal, civic, project, etc.). Activate withgbrain schema use gbrain-recommended.gbrain schema detectclusters your actual filesystem into proposed types,gbrain schema suggestruns an LLM pass over them, andgbrain schema review-candidates --applypromotes the ones you like. Three commands and the brain knows your shape. Authoring a successor pack (declaresmigration_from:so existing brains can opt in): seedocs/architecture/pack-upgrade-mechanism.md.The active pack threads through every read + write path:
parseMarkdowninfers page type from the pack’s path prefixes;whoknowsscopes expert routing to types declaredexpert_routing: true;extract_factsruns only onextractable: truetypes; the search cache folds the pack name + version into its key so cross-pack contamination is structurally impossible. Switch packs and the brain re-interprets itself; switch back and nothing’s lost.Seven-tier resolution chain (per-call flag → env var → per-source DB key → brain-wide DB key →
gbrain.yml→~/.gbrain/config.json→gbrain-basedefault). Full reference + authoring guide:docs/architecture/schema-packs.md.Tutorials
Step-by-step walkthroughs for getting the most out of GBrain. Each one takes you from zero to a working outcome, with concrete commands and real numbers.
More walkthroughs in progress: connecting an existing agent (Claude Code, Cursor, OpenClaw, Hermes) to a GBrain memory layer; setting up GBrain for VC dealflow with founder scorecards and meeting prep; migrating an existing Notion or Obsidian vault; indexing a codebase as a queryable code brain. Full tutorial index:
docs/tutorials/.Want to see a tutorial that isn’t here yet? Open an issue describing the workflow you want documented.
What it does (the loop)
[[wiki/people/bob]]style references. New entity → new page stub → graph grows.The whole loop is described in
docs/architecture/topologies.mdwith diagrams.Capabilities
Hybrid search. Vector (HNSW on pgvector) + BM25 keyword + reciprocal-rank fusion + source-tier boost + intent-aware query rewriting. Three named search modes (
conservative,balanced,tokenmax) bundle the cost/quality knobs into a single config key. Live cost/recall comparisons indocs/eval/SEARCH_MODE_METHODOLOGY.md. Default:balancedwith ZeroEntropy reranker on. Per-query graph signals notice when a top result is a hub for THAT query (adjacency boost), is corroborated across team brains (cross-source boost), or is being crowded out by weak chunks from a chatty session (session demote). Rungbrain search "<query>" --explainto see per-stage attribution: base score, every boost that fired, what it multiplied.gbrain doctorships agraph_signals_coveragecheck;gbrain search statsshows fire counts and failure breakdowns. Vector retrieval pools the best chunk per page, so a page surfaces on its strongest evidence instead of losing to a neighbor on one weak chunk. Queries that match a page’s title phrase or a declared free-text alias (gbrain reindex --aliasesbackfills existing pages) get boosted to the page they name. Every result carries anevidencetag (why it matched) and acreate_safetyhint (exists/probable/unknown) so an agent decides whether a page already exists instead of guessing from a raw score.gbrain search diagnose "<query>" --target <slug>traces which retrieval layer surfaces (or misses) a page.Self-wiring knowledge graph. Every
put_pageextracts entity refs from markdown/wikilinks/typed-link syntax and writes edges with zero LLM calls. Typed edges (attended,works_at,invested_in,founded,advises,mentions, …). Multi-hop traversal viagbrain graph-query. The graph is what produces the +31.4 P@5 lift over vector-only RAG.Job queue (Minions). BullMQ-shaped, Postgres-native job queue. Durable subagents (LLM tool loops that survive crashes via two-phase pending→done persistence), shell jobs with audit, child jobs with cascading timeouts, rate leases for outbound providers, attachments via S3/Supabase storage. Replaces “spawn subagent as fire-and-forget Promise” with something that recovers from anything.
43 curated skills. Routing lives in
skills/RESOLVER.md. Covers signal capture, ingest (idea / media / meeting), enrichment, querying, brain ops, citation fixing, daily task management, cron scheduling, reports, voice, soul audit, skill creation, eval framework, and migrations. Skills are markdown files (tool-agnostic), packaged as a single skillpack the installer drops into your agent workspace.Eval framework.
gbrain eval longmemevalruns the public LongMemEval benchmark against your hybrid retrieval.gbrain eval export+gbrain eval replaycapture real queries and replay them against code changes (setGBRAIN_CONTRIBUTOR_MODE=1).gbrain eval cross-modalcross-checks an output against the task using three different-provider frontier models.gbrain eval retrieval-qualityruns NamedThingBench, which hard-gates the named-thing retrieval families (title-substring, alias-synonym, generic-to-named, multi-chunk-dilution) so a regression in “find the page this query names” fails CI loudly. Full methodology indocs/eval/SEARCH_MODE_METHODOLOGY.md.Brain consistency.
gbrain eval suspected-contradictionssamples retrieval pairs, layered date pre-filter, query-conditioned LLM judge, persistent cache. Surfaces conflicts between takes + facts the agent has written. Wired into the daily dream cycle.Agent-authored schema (v0.40.7.0). Your brain has a shape — what page types exist (
person,meeting,paper,case,lab-result), what they link to (attended,authored,prescribed-by), what facts get extracted automatically. The default ships with 22 universal types, but your brain’s actual shape is not the default shape. Agents can now evolve that shape on your behalf via 14gbrain schemaCLI verbs + a batched MCP op (schema_apply_mutations, admin scope, NOT localOnly so remote agents reach it over HTTPS). Atomic file locks, audit log with the agent’s identity, chunked UPDATE backfill in 1000-row batches that never wedge concurrent writers. The brain stops being a pile of notes and becomes something with structure. Why it matters:docs/what-schemas-unlock.md— 7 killer use cases (4000 invisible meetings, founder ops brain, research brain, legal brain, team brain, agent-as-co-curator). 5-minute walkthrough:docs/schema-author-tutorial.md. Agent skill:skills/schema-author/SKILL.md.Integrations
Data flowing into the brain. Each integration is a recipe — markdown + setup hints — that ships in
recipes/and is discoverable viagbrain integrations list.recipes/twilio-voice-brain.md.docs/integrations/meeting-webhooks.md.docs/integrations/embedding-providers.md.zerank-2hosted (default intokenmaxmode) plus the v0.40.6.1llama-server-rerankerrecipe for fully-local cross-encoder rerank via llama.cpp — runs Qwen3-Reranker or self-hosted ZeroEntropy weights against the samegateway.rerank()seam. Setup walkthrough indocs/ai-providers/llama-server-reranker.md.docs/integrations/credential-gateway.md.docs/mcp/per-client setup.Architecture
Two engines, one contract. PGLite (Postgres 17 via WASM, zero-config, default) for personal brains up to ~50K pages. Postgres + pgvector (Supabase or self-hosted) for shared / large / multi-machine deployments. The contract-first
BrainEngineinterface insrc/core/engine.tsdefines ~47 operations both engines implement; CLI and MCP server are generated from one source.Brain repo is the system of record. Your knowledge lives in a regular git repo (your “brain repo”) as markdown files. GBrain syncs the repo into Postgres for retrieval; deletes in git become soft-deletes in DB. You can publish public subsets, share team mounts, run thin-client setups pointing at a colleague’s brain server. Topologies in
docs/architecture/topologies.md.Two organizational axes (brain ⊥ source). A brain is a database (your personal brain, a team mount you joined). A source is a repo inside that brain (wiki, gstack, an essay, a knowledge base). Routing lives in
.gbrain-sourcedotfiles and resolves via a documented 6-tier precedence chain. Full diagrams indocs/architecture/brains-and-sources.md.Why the graph matters. Vector search returns chunks that are semantically close. The graph returns chunks that are factually connected. Hybrid search pulls from both; auto-linking on every write keeps the graph fresh. Deep dive:
docs/architecture/RETRIEVAL.md.Troubleshooting
gbrain importfails withexpected N dimensions, not M? Rungbrain doctor. It will print the exactgbrain config set ...orgbrain retrieval-upgradecommand to repair the mismatch. You should not need to delete~/.gbrain. Freshgbrain init --pgliteauto-detects your embedding provider from API keys in your environment: setOPENAI_API_KEY(orZEROENTROPY_API_KEY/VOYAGE_API_KEY) before running init, or pass--embedding-model <provider>:<model>explicitly. With multiple keys set, init fires an interactive picker. In non-TTY contexts (CI, Docker) with no keys, init exits 1 with a paste-ready setup hint; pass--no-embeddingto defer setup until runtime. Seedocs/integrations/embedding-providers.mdfor the full provider matrix anddocs/operations/headless-install.mdfor Docker/CI sequencing.Hourly cron sync keeps timing out on a federated brain? v0.41.13.0 ships two flags + a recommended pattern. Switch your cron to a per-source loop with shell
timeout(1)doing the OS-level kill and gbrain self-terminating gracefully half-a-minute earlier:When
--timeoutfires mid-import,gbrain syncexits 0 with statuspartialandlast_commitUNCHANGED — the next run re-walks the same diff andcontent_hashshort-circuits already-imported files. The--max-age 1800first command self-heals any wedged-but-alive locks left by a hung previous run, using the v98last_refreshed_atsemantic (NOTacquired_at) so healthy long-running holders are safe by construction. See the v0.41.13.0 entry inCHANGELOG.mdfor the honest scope notes (extract + embed phases run to completion; 30-min rollout window for--max-agepost-migration v98; full-sync triggers deferred to v0.42+).Dream cycle silently losing wiki links on Supabase? v0.41.19.0 fixes the bug class structurally. The engine now self-retries every bulk batch write (
addLinksBatch/addTimelineEntriesBatch/upsertChunks) on Supavisor pooler blips, with a 12s worst-case wait that covers the full 5-10s circuit-breaker recovery window.gbrain doctorsurfaces incidents via the newbatch_retry_healthcheck (reads the last 24h of~/.gbrain/audit/batch-retry-YYYY-Www.jsonl). To tune for an unusually slow pooler:Bad values surface at
gbrain doctorstartup with a paste-ready fix (not at first-retry mid-cycle). PGLite-only installs pay zero cost — the retry wrap is engine-level, but PGLite has no pooler so retries never fire in practice.Dream cycle losing ~150 link rows per run with
'No database connection: connect() has not been called'errors in the log? v0.41.27.0 makes the retry layer self-heal on a nulled-out database singleton. A newreconnectcallback onwithRetryrebuilds the connection between attempts;PostgresEngine.batchRetryinjects() => this.reconnect()so engine-level batch writes survive a mid-cycle disconnect by something else in the same process. Same release:gbrain captureno longer trails a'No database connection'stderr line from a background facts:absorb worker firing after CLI exit — the op-dispatch finally block awaitsgetFactsQueue().drainPending({timeout: 1000})beforeengine.disconnect(). To find which code path is still calling disconnect mid-process, rungbrain doctor --json | jq '.checks[] | select(.id=="batch_retry_health")'; the extended check now surfaces 24h disconnect-call count and the most-recent caller frame from a new~/.gbrain/audit/db-disconnect-YYYY-Www.jsonlaudit. (Closes #1570.)gbrain brainstormreturningjudge_failed: truewith 0 scored ideas? v0.41.21.0 closes the two bugs that caused it. The judge hard-coded a 4K-token output cap; for any run past ~40 ideas the call truncated mid-JSON and the parser threw. Same release closes a slash- form pricing miss:gbrain brainstorm --judge-model anthropic/claude-sonnet-4-6 --max-cost 5failed withBudgetExhausted reason=no_pricingbecause every pricing site only matched the colon form. Both shapes work now. No config change, no schema migration —gbrain upgradeis the whole fix.Docs
docs/INSTALL.md— every install path, end to enddocs/what-schemas-unlock.md— why schemas matter: 7 killer use cases, the structural argument for typed page kinds, the agent-co-curates pattern (v0.40.7.0)docs/schema-author-tutorial.md— 5-minute walkthrough: fork the bundled pack, add a custom type, backfill existing pages, prove the wiring viagbrain whoknowsdocs/architecture/— system design, topologies, retrieval theorydocs/guides/— how-to runbooks (sub-agent routing, minion deployment, skill development, brain-first lookup, idea capture, diligence ingestion)docs/integrations/— connecting external data sources (voice, email, calendar, embedding providers)docs/mcp/— per-client MCP setup (Claude Desktop, Code, Cursor, ChatGPT, Perplexity, Cowork)docs/eval/— eval framework, metric glossary, methodologydocs/ethos/— philosophy (thin harness, fat skills, markdown as recipes, origin story)AGENTS.md— entry point for non-Claude agentsCLAUDE.md— entry point for Claude Code (deep operating context)CONTRIBUTING.md— contributor guide, test discipline, eval-capture modeSECURITY.md— OAuth threat model, hardening defaultsContributing
Run
bun run testfor the fast loop,bun run verifyfor the pre-push gate,bun run ci:localto run the full Docker-backed CI stack locally. Detailed test discipline inCONTRIBUTING.md.Community PRs are batched into release waves rather than merged one-by-one — see the “PR wave workflow” section in
CLAUDE.md. Contributor attribution stays attached viaCo-Authored-By:trailers. We credit every accepted contribution inCHANGELOG.md.If you find a bug or want a feature: open an issue first. Quick fixes (typo, doc bug, obvious regression) can go straight to a PR. Anything touching schema, retrieval ranking, MCP protocol, or the security boundary needs a design discussion in the issue first.
License + credit
MIT. I built GBrain to run my OpenClaw and Hermes deployments — the production brain behind my AI agents.
Origin story:
docs/ethos/ORIGIN.md.Community PR contributors are credited in
CHANGELOG.mdper release. ZeroEntropy (@zeroentropy) for the embedding + reranker stack that ships as the default. Voyage AI for the asymmetric-encoding recipe template. Ramp Labs for the search quality improvements lineage.