| name | gbrain-query |
| description | Answer questions from the brain using FTS5 + semantic search + structured queries. Synthesizes across multiple pages with citations. |
| metadata | {"openclaw":{"emoji":"🔍","requires":{"bins":["gbrain"]}}} |
Query Skill
Strategy: Three-layer search
-
FTS5 keyword search — gbrain search "<query>" — fast, exact matches.
Best for: names, company names, specific terms, acronyms.
-
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.
-
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
- Decompose the question into search strategies.
- Run FTS5 search for key terms.
- Run semantic query for the full question (if embeddings available).
- Merge and deduplicate results.
- For top results,
gbrain get <slug> to read full pages.
- Synthesize answer with citations: "Jane Doe"
- 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
gbrain search "Jane Doe"
gbrain get people/jane-doe
gbrain query "who is connected to Anthropic?"
gbrain list --type person --tag yc-alum
gbrain backlinks companies/acme-corp
gbrain list --limit 20