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

ParameterTypeRequiredDescription
brainIdstringYesThe brain to search. Get it from list_public_brains.
querystringYesNatural-language description of the context you need.
limitnumberNoMax passages to return. Default 5, max 20.
entitiesstring[]NoOptional entity names to focus the search on.

Example

Prompt:
“Using the Supabase brain, how do I set up Row Level Security policies?”
Tool call:
{
  "brainId": "fa8d5392-fc77-4eb4-8a4c-64e0005c56b6",
  "query": "How do I set up Row Level Security policies?",
  "limit": 3
}
Response:
3 results for "How do I set up Row Level Security policies?":

- Result: 1
- Score: 0.821
- Source: supabase.com/docs/guides/database/postgres/row-level-security
- URL: https://supabase.com/docs/guides/database/postgres/row-level-security
- Node ID: ab699e6d-0a57-4383-a191-8fbed2832f9f
- Content:
You can enable RLS for any table using the `enable row level security` clause:

    alter table "table_name" enable row level security;

Once you have enabled RLS, no data will be accessible via the API when using a
publishable key, until you create policies.
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