/query
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.
$ npx -y skills add garrytan/gbrain --skill query --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/query
Context preview
The summary Claude sees to decide when to auto-load this skill.
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.
SKILL.md
query.SKILL.mdname: query
version: 1.0.0
description: |
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.
triggers:
- "what do we know about"
- "tell me about"
- "who is"
- "what happened"
- "search for"
- "look up"
- "background on"
- "notes on"
- "who knows who"
- "relationship between"
- "connections"
- "graph query"
tools:
- search
- query
- get_page
- list_pages
- get_backlinks
- traverse_graph
- get_timeline
mutating: false
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 five 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 bare `search` for "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 of `get_page` + > `get_backlinks` when you just need the card. > - **`synthesize(question)`** — the explicitly-expensive cross-page answer; the > heavy version of `query`. Reach for it only when the answer must combine > evidence across pages. > Fall back to `search`/`query`/`get_page` when the verbs aren't on the surface > (pre-0.43 servers; `--surface full` includes the verbs alongside every other > op). See `docs/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
1. **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
2. **Execute searches:**
- Cheap-hybrid search gbrain for exact tokens / known names (search)
- Full-hybrid search gbrain with multi-query expansion for concept questions (query)
- List pages in gbrain by type or check backlinks for structural queries
3. **Read top results.** Read the top 3-5 pages from gbrain to get full context. 4. **Synthesize answer** with citations. Every claim traces back to a specific page slug. 5. **Flag gaps.** If the brain doesn't have info, say "the brain doesn't have information on X" rather than hallucinating.
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 hallucinate. Only answer from brain content.
- Cite sources: "According to concepts/do-things-that-dont-scale..."
- Flag stale results: if a search result shows [STALE], note that the info may be outdated
- For "who" questions, use backlinks and typed links to find connections
- For "what happened" questions, use timeline entries
- For "what do we know" questions, read compiled_truth directly
Token-Budget Awareness
Search returns **chunks**, not full pages. Read the excerpts first before deciding whether to load a full page.
- `gbrain search` / `gbrain query` return ranked chunks with context snippets.
These are often enough to answer the question directly.
- Only use `gbrain get <slug>` to load the full page when a chunk confirms the
page is relevant and you need more context (e.g., compiled truth, timeline).
- **"Tell me about X"** -- get the full page (the user wants the complete picture).
- **"Did anyone mention Y?"** -- search results are enough (the user wants a yes/no with evidence).
Source precedence
When multiple sources provide conflicting information, follow this precedence:
1. **User's direct statements** (highest authority -- what the user told you directly) 2. **Compiled truth** (the brain's synthesized, cited understanding) 3. **Timeline entries** (raw evidence, reverse-chronological) 4. **External sources** (web search, API enrichment -- lowest authority)
When sources conflict, note the contradiction with both citations. Don't silently pick one.
Citation in Answers
When referencing brain pages in your answer, propagate inline citations:
- Cite the page: "According to [Source: people/jane-doe, compiled truth]..."
- When brain pages have inline `[Source: ...]` citations, propagate them so
the user can trace facts to their origin
- When you synthesize across multiple pages, cite all sources
Graph Traversal (v0.10.1+)
For relationship questions ("who knows who at X?", "connections between A and B", "who works at Acme?", "who attended the standup?"), use the graph layer instead of full-text search:
- `gbrain graph-query <slug> --type <link_type> --depth N --direction in|out|both`
- Available link types: `attended`, `works_at`, `invested_in`, `founded`, `advises`, `mentions`, `source`
- `--direction in` answers "who points to X?" (e.g., who works at company X)
- `--direction out` answers "what does X point to?" (default)
- `--depth N` controls multi-hop traversal (default 5)
Examples:
- "Who works at Acme?" → `gbrain graph-query companies/acme --type works_at --direction in`
- "Who at
Read more
name: query version: 1.0.0 description: | 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. triggers: - "what do we know about" - "tell me about" - "who is" - "what happened" - "search for" - "look up" - "background on" - "notes on" - "who knows who" - "relationship between" - "connections" - "graph query" tools: - search - query - get_page - list_pages - get_backlinks - traverse_graph - get_timeline mutating: false
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 five 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 bare `search` for "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 of `get_page` + > `get_backlinks` when you just need the card. > - **`synthesize(question)`** — the explicitly-expensive cross-page answer; the > heavy version of `query`. Reach for it only when the answer must combine > evidence across pages. > Fall back to `search`/`query`/`get_page` when the verbs aren't on the surface > (pre-0.43 servers; `--surface full` includes the verbs alongside every other > op). See `docs/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
1. **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
2. **Execute searches:**
- Cheap-hybrid search gbrain for exact tokens / known names (search)
- Full-hybrid search gbrain with multi-query expansion for concept questions (query)
- List pages in gbrain by type or check backlinks for structural queries
3. **Read top results.** Read the top 3-5 pages from gbrain to get full context. 4. **Synthesize answer** with citations. Every claim traces back to a specific page slug. 5. **Flag gaps.** If the brain doesn't have info, say "the brain doesn't have information on X" rather than hallucinating.
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 hallucinate. Only answer from brain content.
- Cite sources: "According to concepts/do-things-that-dont-scale..."
- Flag stale results: if a search result shows [STALE], note that the info may be outdated
- For "who" questions, use backlinks and typed links to find connections
- For "what happened" questions, use timeline entries
- For "what do we know" questions, read compiled_truth directly
Token-Budget Awareness
Search returns **chunks**, not full pages. Read the excerpts first before deciding whether to load a full page.
- `gbrain search` / `gbrain query` return ranked chunks with context snippets.
These are often enough to answer the question directly.
- Only use `gbrain get <slug>` to load the full page when a chunk confirms the
page is relevant and you need more context (e.g., compiled truth, timeline).
- **"Tell me about X"** -- get the full page (the user wants the complete picture).
- **"Did anyone mention Y?"** -- search results are enough (the user wants a yes/no with evidence).
Source precedence
When multiple sources provide conflicting information, follow this precedence:
1. **User's direct statements** (highest authority -- what the user told you directly) 2. **Compiled truth** (the brain's synthesized, cited understanding) 3. **Timeline entries** (raw evidence, reverse-chronological) 4. **External sources** (web search, API enrichment -- lowest authority)
When sources conflict, note the contradiction with both citations. Don't silently pick one.
Citation in Answers
When referencing brain pages in your answer, propagate inline citations:
- Cite the page: "According to [Source: people/jane-doe, compiled truth]..."
- When brain pages have inline `[Source: ...]` citations, propagate them so
the user can trace facts to their origin
- When you synthesize across multiple pages, cite all sources
Graph Traversal (v0.10.1+)
For relationship questions ("who knows who at X?", "connections between A and B", "who works at Acme?", "who attended the standup?"), use the graph layer instead of full-text search:
- `gbrain graph-query <slug> --type <link_type> --depth N --direction in|out|both`
- Available link types: `attended`, `works_at`, `invested_in`, `founded`, `advises`, `mentions`, `source`
- `--direction in` answers "who points to X?" (e.g., who works at company X)
- `--direction out` answers "what does X point to?" (default)
- `--depth N` controls multi-hop traversal (default 5)
Examples:
- "Who works at Acme?" → `gbrain graph-query companies/acme --type works_at --direction in`
- "Who at
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.
Repo: garrytan/gbrain
Other skills on gbrain.
- /voice-persona-mars
Route to Mars (introspective thought partner / demo showman voice persona). Used when the operator wants depth, meaning, or impressive social demos rather than logistics. Mars handles SOLO mode (philosophy, presence, patterns) and DEMO mode (tool-driven showmanship)
Open skill - /voice-persona-venus
Route to Venus (sharp executive-assistant voice persona). Used for logistics — calendar, tasks, recent messages, brain lookups — at sub-second phone-call latency. The default voice persona unless DEFAULT_PERSONA=mars is set.
Open skill - /voice-post-call
Post-call handling for a voice session — turn the transcript into a brain page, post the summary to the operator's messaging surface, archive the audio. Belt-and-suspenders: fires both from a tool the voice persona can call mid-call AND from the automatic call-end handler in
Open skill - /retrieval-reflex
When/what to retrieve — open the brain page for a salient entity before answering from memory.
Open skill - /academic-verify
Verify a research claim or academic citation by tracing it through publication → methodology → raw data → independent replication. Routes through perplexity-research for the actual web lookup, then formats results as a citation-checked brain page. Use when a
Open skill - /archive-crawler
Universal archivist for personal file archives (Dropbox/B2/Gmail-takeout/local-mount/hard-drive-dump). Filters for high-value content (the user's own writing, ideas, relationships) and surfaces it interactively. REFUSES TO RUN without an explicit gbrain.yml
Open skill

