query
What it does
This skill answers your questions using the knowledge stored in your brain. Each claim comes with a link to the page it came from.
When to use it
- ✓When you ask your agent a question that your saved notes should answer.
- ✓When you want to look up a person, company, or project from your brain.
- ✓When you want an answer that combines several of your pages, with sources.
Skill link
https://github.com/garrytan/gbrain/blob/master/plugin-variants/gbrain-coding/skills/query/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
“What did I decide about pricing in my meeting notes last month? Give me the sources.”
5 new skills a week. 1 minute to read.
How it works
The agent searches your brain in layers, reads the matching pages, and writes an answer. Each claim is tied to a page, and it says clearly when the brain has no information.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Query Skill
Answer questions using the brain's knowledge with 3-layer search and synthesis.
Memory verbs (MEMORY_VERBS v1, gbrain ≥ 0.43). When connected to a brain over MCP, prefer the seven frozen memory verbs for memory work — they carry provenance, evidence, and a server-enforced token budget:
recall(query | entity, budget_tokens)— the budget-packed memory read. Use it instead of baresearchfor "what do we know that we SAVED about X".entity(name)— a zero-LLM person/company/project card (aliases, last-touched, open threads, top edges). Use it instead ofget_page+get_backlinkswhen you just need the card.synthesize(question)— the explicitly-expensive cross-page answer; the heavy version ofquery. Reach for it only when the answer must combine evidence across pages. Fall back tosearch/query/get_pagewhen the verbs aren't on the surface (pre-0.43 servers;--surface fullincludes the verbs alongside every other op). Seedocs/protocol/MEMORY_VERBS_v1.md.
Contract
This skill guarantees:
- Every answer is grounded in brain content (no hallucination)
- Every claim has a citation tracing back to a specific page slug
- Gaps are flagged explicitly ("the brain doesn't have information on X")
- Source precedence is respected (user statements > compiled truth > timeline > external)
- Conflicting sources are noted with both citations
Phases
- Decompose the question into search strategies:
- Keyword search for specific names, dates, terms
- Semantic query for conceptual questions
- Structured queries (list by type, backlinks) for relational questions
- Execute searches:
- Cheap-hybrid search gbrain for exact tokens / known names (search)
- Full-hybrid search gbrain for concept questions (query;
--expandadds multi-query expansion) - List pages in gbrain by type or check backlinks for structural queries
- Narrow with filters instead of grepping the brain checkout:
--types '["meeting"]',--match keyword,gbrain query "<q>" --since 2026-09-01 --until 2026-09-30,--source <id>. Copyable examples: "Retrieval: gbrain first" inskills/conventions/brain-first.md.
- Read top results. Read the top 3-5 pages from gbrain to get full context.
- Synthesize answer with citations. Every claim traces back to a specific page slug.
- Flag gaps. If the brain doesn't have info, say "the brain doesn't have information on X" rather than hallucinating. Read the result's notices first (see "When it fails"): a degraded or truncated result is not a gap.
When it fails
Follow the agent operator protocol for any gbrain error code, exit code, [AGENT] block or notice block. Specific to this skill:
- Check each retrieval result for notices before answering: on MCP, extra text blocks whose first line looks like [gbrain notice empty_retrieval kind=degraded], mirrored in
_meta.gbrain_notices; on the CLI, the[AGENT]block,search_degraded, or anote: search degradedline. empty_retrievalwithkind=degraded(orsearch_degraded: keyword_only_no_embedding_provider): an empty result is NOT proof the user has no notes. Tell the user "your brain is searching keywords only right now, so I may be missing notes on X", try exact names and synonyms withgbrain search, and point to the notice's fix (usually enabling embeddings).empty_retrievalwith "no retrieval degradation — this is a clean miss": then say "the brain doesn't have information on X".listing_truncatedorbudget_truncated: the list was cut off. Say "showing the first N", and page or narrow the query before claiming something is absent.page_not_foundfromget_page: the slug is wrong or in another source; search by title (and check--source) before reporting the page missing.
Anti-Patterns
- Answering from general knowledge when the brain has relevant content
- Hallucinating facts not in the brain
- Silently picking one source when sources conflict
- Loading full pages when search chunks are sufficient
- Ignoring source precedence (user statements are highest authority)
Output Format
Answers should include:
- Direct response to the question
- Citations: "According to [Source: people/jane-doe, compiled truth]..."
- Gap flags: "The brain doesn't have information on X"
- Conflict notes when sources disagree
Quality Rules
- Never hallucinat
FAQ
What if my brain does not know the answer?
The skill says so directly instead of guessing, and it names the gap so you know what is missing.
Which source wins if two pages disagree?
Your own statements rank highest, then the compiled page, then the timeline, and outside sources come last.
Does it search the open web?
Only as a last resort. Your own notes are checked first.
Details
Original description by the author
Answer questions using the brain's knowledge with 3-layer search, synthesis, and citation propagation. Use when the user asks a question, wants a lookup, or needs information from the brain.
repo: garrytan/gbrain
Popularity
- GitHub stars
- 31k
- Ranking position
- #9265
- 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.