Setup
28.9kConfigura GBrain con auto-aprovisionamiento de Supabase o PGLite, inyección en AGENTS.md y primera importación.
- Costo de contexto al activarse
- 7.4k tok
- Tamaño del paquete
- 1 archivo
- Última actualización
- hace 4 días
Operaciones del brain: búsqueda primero, ciclo leer-enriquecer-escribir, atribución de fuentes, enriquecimiento ambiental y back-linking. Leer antes de cualquier interacción con el brain.
Reemplaza a: Investigar entidades desde cero con APIs externas sin consultar antes la base de conocimiento
searchqueryget_pageput_pageadd_linkadd_timeline_entryget_backlinkssync_brainen todo el repo
0–100, la ruta de este skill
último commit aquí
últimos 90 días
49 tok en reposo
10 KB
Funciona con cualquier agente que lea SKILL.md
npx -y skills add garrytan/gbrain --skill brain-ops --agent claude-codeSe instala solo en este repositorio.
Di cualquiera de estas frases y el agente debería cargar este skill.
The brain is not an archive. It is a live context membrane that every interaction flows through in both directions.
Convention: See
skills/conventions/brain-first.mdfor the 5-step lookup protocol. Convention: Seeskills/conventions/quality.mdfor citation and back-link rules.
Memory verbs (MEMORY_VERBS v1, gbrain ≥ 0.43). Over MCP, prefer the five frozen memory verbs for the read/write cycle:
remember(fact, provenance, ttl?)to save a single durable fact (mandatory provenance; dedupes + supersedes),recall(query | entity, budget_tokens)to read it back budget-packed,entity(name)for a zero-LLM card,synthesize(question)for the expensive cross-page answer,forget(id)to expire a fact. Userememberinstead ofextract_factswhen you already have ONE formed fact;put_page/add_link/add_timeline_entrystay the page/graph write path. Fall back to the classic ops when the verbs aren't on the surface. Contract:docs/protocol/MEMORY_VERBS_v1.md.Keyless brains: when
extract_factsreturnsskipped: extraction_unavailable, YOU are the extractor — pull the facts from the turn yourself and write each one viarememberwithkindset (event | preference | commitment | belief) and the visibility the envelope'sagent_actionnames (default private — pin it;rememberdefaults to world), or author a## Factsfence on the entity page. Askipped: extraction_failedenvelope (server-side extractor errored on this turn;reasonnames why) invites the same manualrememberfallback for that turn — automatic extraction stays on for future writes.
This skill guarantees:
[Source: ...] citations)Every mention of a person or company with a brain page MUST create a back-link
FROM that entity's page TO the page mentioning them. An unlinked mention is a
broken brain. See skills/conventions/quality.md for format.
Before using ANY external API to research a person, company, or topic:
gbrain entity "<name>" (v0.43+) — ONE known person/company/project → full card (description, aliases, open threads, recent events, edges, backlink/fact counts). Zero LLM calls, sub-100ms. This one call replaces steps 2–6 for known-entity lookups; near-misses return suggestions.gbrain search "name" — exact-token lookup for existing pages (cheap hybrid, no expansion)gbrain query "natural question about name" — concept/landscape questions go here FIRST (expansion recovers synonym phrasings; a nonzero search count is not proof of completeness)gbrain get <slug> — if you know the slug, read the full pageThe brain almost always has something. External APIs fill gaps, not start from scratch.
⚠️ NEVER scope/count a corpus with shallow ls — query gbrain or find. Federated sources often carry MULTIPLE coexisting directory conventions — a flat legacy layer AND a date-nested meetings/YYYY/MM/ layer. A non-recursive ls dir/*.md sees only one and undercounts massively. Real example: a shallow ls of one source's meetings/ counted 132 files, almost all the user's, and concluded that WAS the corpus — missing thousands of transcripts nested under meetings/YYYY/MM/. To count/scope a brain corpus:
gbrain sources list (shows per-source indexed page counts) + gbrain query. gbrain indexes ALL federated sources correctly; trust its index, not the filesystem.find <dir> -name '*.md' | wc -l, never ls *.md. Then map the layout: find <dir> -name '*.md' | sed -E 's#(.*/)[^/]+$#\1#' | sort | uniq -c.gbrain sources list before believing a low count.For questions that need synthesis, temporal grounding, or analytical answers — not just "find the page" but "answer the question":
gbrain think "<question>" — multi-hop synthesis across pages + takes +
the graph. Temporal questions route through trajectory analysis; everything
else gets an LLM-synthesized, cited answer with conflict + gap analysis.
Returns a grounded answer, not just a list of matching pages.query for
simple page lookups where you just need the slug or a quick context check.Every message, meeting, email, or conversation that references a person or company:
User's direct statements are the highest-value data source. Write them to brain
pages immediately with attribution [Source: User, YYYY-MM-DD].
Every put_page call automatically extracts entity references and writes them
to the graph (links table) with inferred relationship types. Stale links
(refs no longer in the page text) are removed in the same call. This is
"auto-link" reconciliation.
add_link calls needed for ordinary page writes.attended (meeting -> person), works_at, invested_in,
founded, advises, source (frontmatter), mentions (default).put_page MCP response includes auto_links: { created, removed, errors }
so the agent can verify outcomes.gbrain config set auto_link false. Default is on.gbrain timeline-add
(or batch via gbrain extract timeline --source db).Before answering any question about a person, company, or topic:
Don't answer from general knowledge when a brain page exists.
This is not a special mode. This is the default. Everything the user says is an ingest event.
Rules:
No separate output. Brain-ops is an always-on behavior layer, not a report generator. The output is updated brain pages and enriched responses.
When a brain has multiple sources (wiki, gstack, yc-media, etc.), every
citation MUST include the source id: [source-id:slug]. Example:
You told me about the retry budget approach — see [wiki:topics/resilience] and [gstack:plans/retry-policy] for where this came from.
Rules:
sources.id (immutable), never sources.name (mutable display).[default:slug] OR may omit the prefix
for backward compat.search, query, get_page, list_pages
carries source_id — always use it when citing, never guess.If a search result has source_id: "gstack" and slug: "plans/foo",
the citation is [gstack:plans/foo]. That's the whole rule.
[Source: ...] citationsgbrain entity "<name>" (catches aliases + near-misses), then query with name variantssearch — cheap hybrid search (vector + keyword, no expansion)query — hybrid search + LLM multi-query expansion (concept/landscape questions)get_page — read a brain pageput_page — create/update brain pagesadd_link — cross-reference entitiesadd_timeline_entry — record eventsget_backlinks — check who references an entitysync_brain — sync changes to the indexReproducido de garrytan/gbrain bajo licencia MIT. Leer esta página en markdown.
1 archivo en el paquete. Solo se lee SKILL.md al activarse — las referencias se cargan si el skill decide que las necesita.
Requiere acceso a gbrain/MCP con las herramientas search, query, get_page, put_page, add_link, add_timeline_entry, get_backlinks y sync_brain.
Este repo incluye 75 skills. Si instalas uno, normalmente ya tienes los demás.
Configura GBrain con auto-aprovisionamiento de Supabase o PGLite, inyección en AGENTS.md y primera importación.
Chequeos de salud del brain: aplicación de back-links, auditoría de citas, validación de filing, detección de info obsoleta, páginas huérfanas y benchmarks.
Migra un brain de gbrain-base a la taxonomía de 14 tipos canónicos de gbrain-base-v2 usando gbrain onboard --check y el handler Minion unify-types.
Cuándo y qué recuperar: abre la página del brain de una entidad relevante antes de responder desde memoria.
Importa exports de ChatGPT, Claude y Perplexity y transcripciones de sesiones como páginas fechadas en conversations/, valida y extrae hechos, y mantiene el archivo sin huecos con detección y backfill.
Everything In Its Right Place: tras cualquier trabajo significativo, ejecuta una auditoría de 7 fases que archiva el conocimiento en el brain y convierte los patrones reutilizables en skills.
Archivista universal para archivos personales (Dropbox/B2/Gmail-takeout/disco local). Filtra contenido de alto valor y lo muestra de forma interactiva; exige un allow-list scan_paths explícito en gbrain.yml.
Transforma volcados de texto crudo de artículos en el brain en páginas estructuradas con resumen ejecutivo, citas textuales, insights clave, por qué importa y referencias cruzadas.
Filtro de calidad previo a la escritura para todo lo que entra al brain: nada de cp/mv en crudo. Resuelve entidades con nombre por registro y aplica el árbol de decisión de dedup leyendo el primer resultado.