gbrain-query

gbrain-query is a skill for Claude Code, Codex from imphillip/gbrain-openclaw. It costs 29 tokens per session (555 once invoked), scanned A, original, MIT.

A search and question-answering tool for a knowledge base called the brain. It combines exact keyword search, meaning-based search, and structured queries such as lists, backlinks, timelines, and tags.

In plain words
What is it for?
Use it to answer questions across stored pages, find entities by name or meaning, inspect relationships and timelines, and save useful answers back to the knowledge base.
Why use it?
It helps find and combine relevant information when a single keyword search is not enough, while retaining citations to the source pages.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for gbrain. Also seen: built for gbrain.

Good fit Use it to answer questions across stored pages, find entities by name or meaning, inspect relationships and timelines, and save useful answers back to the knowledge base.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/imphillip/gbrain-openclaw/query
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add imphillip/gbrain-openclaw --skill query
Clone the repo
git clone --depth 1 https://github.com/imphillip/gbrain-openclaw

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for gbrain-query

README.md
[![agentmods](https://agentmods.dev/badge/skills/imphillip/gbrain-openclaw/query/github.svg)](https://agentmods.dev/skills/imphillip/gbrain-openclaw/query)
Your own site
<a href="https://agentmods.dev/skills/imphillip/gbrain-openclaw/query"><img src="https://agentmods.dev/badge/skills/imphillip/gbrain-openclaw/query/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for gbrain-query

Your own site · 80×15
<a href="https://agentmods.dev/skills/imphillip/gbrain-openclaw/query"><img src="https://agentmods.dev/badge/skills/imphillip/gbrain-openclaw/query.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 555 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00029 $0.00555
Opus 5.5 $0.00012 $0.00222
Sonnet 5.5 $0.00006 $0.00111
Haiku 4.5 $0.00003 $0.00056

Measured 1mo ago against content hash 5493b678b06a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

gbrain-query scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/query/SKILL.md · 69 lines

What it actually says

Query Skill

  1. FTS5 keyword search — gbrain search "<query>" — fast, exact matches. Best for: names, company names, specific terms, acronyms.

  2. Semantic vector search — gbrain query "<question>" — meaning-based. Best for: "who knows X?", "what's our thesis on Y?", conceptual or relationship questions. Requires OPENAI_API_KEY and at least one gbrain embed run.

  3. Structured queries — relational navigation.

    • gbrain list --type person --tag yc-alum
    • gbrain backlinks <slug> — who links to this page?
    • gbrain timeline <slug> — what happened with this person/company?
    • gbrain tags <slug> — what is this page tagged with?

Workflow

  1. Decompose the question into search strategies.
  2. Run FTS5 search for key terms.
  3. Run semantic query for the full question (if embeddings available).
  4. Merge and deduplicate results.
  5. For top results, gbrain get <slug> to read full pages.
  6. Synthesize answer with citations: "Jane Doe"
  7. If the answer is valuable enough to keep, consider creating a page: cat answer.md | gbrain put concepts/topic

Ranking heuristic

  • FTS5 score × 0.4 + vector similarity × 0.6 = combined score
  • Boost pages with type matching the question intent (+0.2 for person queries hitting person pages)
  • Boost pages updated recently
  • Prefer pages with richer content (longer compiled_truth)

When you don't know

Say so. "The brain doesn't have info on X" is honest and useful. Suggest enrichment: "Want me to research X and add them to the brain?"

Examples

# Find a person
gbrain search "Jane Doe"
gbrain get people/jane-doe

# Relationship question
gbrain query "who is connected to Anthropic?"

# Relational: all YC founders
gbrain list --type person --tag yc-alum

# What links to a company page?
gbrain backlinks companies/acme-corp

# Recent activity
gbrain list --limit 20  # sorted by updated_at desc
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 69 lines · 29 tokens per session scan A 5493b678b06a

Subscribe to this mod's changes

gbrain-query is a skill published in the GitHub repository imphillip/gbrain-openclaw (11 stars, last pushed 6mo ago), licensed MIT. It adds 29 tokens to every session and 555 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories