retrieval-reflex

Retrieves brain pages for salient entities before answering from memory.

29.4k|4.4k|Updated Apr 5, 2026
One-click install
npx skills add https://github.com/garrytan/gbrain --skill retrieval-reflex
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: retrieval-reflex
Source: https://github.com/garrytan/gbrain/tree/main/recipes/retrieval-reflex/skills/retrieval-reflex
Command: npx skills add https://github.com/garrytan/gbrain --skill retrieval-reflex

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

AI agents often answer questions about people, companies, or projects from memory alone, producing stale or fabricated details even when a knowledge base already holds the correct page. This Skill encodes a retrieve-before-answering reflex so the agent opens the relevant brain page whenever an entity becomes the subject of the exchange.

Core Features & Use Cases

  • Trigger policy: Defines when to retrieve — when an entity is the subject of the message, a brain-page pointer appears in context, an unrecognized notable name appears, or the agent is about to assert a non-trivial detail from memory.
  • Escalating retrieval spec: Pulls only what the task needs, from pointer metadata, to the full page via get_page, to graph neighbors via traverse_graph and get_backlinks.
  • Skip rules: Avoids wasteful lookups for trivial passing mentions, logistics pings, and entities already loaded in context.
  • Use Case: During a conversation about a named investor, the agent opens that person's brain page before stating their role or history, instead of guessing from memory.

Quick Start

Ask the agent a question about a named person or company and have it open the corresponding brain page before answering.

Frequently Asked Questions about retrieval-reflex

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make an AI agent check a knowledge base before answering?

Encode a retrieval reflex that triggers when an entity becomes the subject of the exchange. The agent opens the entity's page with get_page before asserting details, rather than relying on memory alone.

When should an agent retrieve a page versus answer from context?

Retrieve when the entity is the subject of the message, a brain-page pointer appeared in context, or a non-trivial detail is about to be asserted. Skip retrieval for trivial passing mentions, logistics pings, and pages already loaded in context.

What tools does the retrieval reflex use to look up entities?

It uses get_page to open a full page, query for search, and traverse_graph plus get_backlinks for relationship context. Over the CLI, traverse_graph and get_backlinks map to gbrain graph and gbrain backlinks.

Does the retrieval reflex write or modify knowledge base pages?

No. The skill is read-only: its frontmatter sets mutating to false and writes_pages to false. It only retrieves pages, graph neighbors, and backlinks needed to ground the current answer.

How is retrieval-reflex different from a search or query skill?

Retrieval-reflex fires on the ambient retrieve-before-answering instinct when an entity is salient, not on explicit search requests. Direct lookup questions like "who is X" route to the separate query skill instead.