Skip to main content
Runs a semantic (RAG) search over a public brain and returns the most relevant passages of indexed content, ranked by relevance. This is the main way to pull accurate, up-to-date context about a library or topic into the agent. Get the brain ID from list_public_brains first.

Input

Example

Prompt:
“Using the Supabase brain, how do I set up Row Level Security policies?”
Tool call:
Response:
Each result carries a Score, a Source, and a Node ID. Pass that node ID to get_brain_node to read the full source.
query_brain is metered. Every call counts against your brain-query usage.
The underlying endpoint reports query failures inside the response body rather than as an HTTP error. The tool surfaces a clear Query failed: ... message when that happens, so you do not need to handle status codes yourself.

When to use it

  • The agent needs precise, sourced context about a library and a general answer is not enough.
  • You want to ground the agent in real documentation instead of relying on its training data.
  • You have already picked a brain with list_public_brains.

See also