query
它能做什么
这项技能利用你知识库中存储的内容回答你的问题。每个论断都附有其来源页面的链接。
适用场景
- ✓当你向智能体提出一个你保存的笔记应该能回答的问题时。
- ✓当你想从知识库中查找某个人、公司或项目时。
- ✓当你想要一个综合了你多个页面并附有来源的答案时。
技能链接
https://github.com/garrytan/gbrain/blob/master/plugin-variants/gbrain-coding/skills/query/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我上个月的会议笔记里,关于定价我做过什么决定?请给我来源。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会分层搜索你的知识库,阅读匹配的页面,然后写出答案。每个论断都关联到一个页面,如果知识库中没有相关信息,它会明确说明。
技术内容(原始 SKILL.md)
作者在 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
常见问题
如果我的知识库不知道答案怎么办?
技能会直接说明,而不是随便猜测,并指出缺少的内容,让你知道缺了什么。
如果两个页面说法不一致,以哪个为准?
你自己的陈述优先级最高,其次是整理过的页面,然后是时间线,外部来源排在最后。
它会搜索开放的网络吗?
只作为最后的手段。会先检查你自己的笔记。
详情
作者的原始描述
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
热度
- GitHub 星标
- 31k
- 排名
- #9265
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …