brave_llm_context
brave_llm_contextRetrieve relevance-ranked web content with actual page text, tables, and code for AI grounding and RAG pipelines.
Instructions
Retrieves pre-extracted, relevance-ranked web content using Brave's LLM Context API, optimized for AI agents, LLM grounding, and RAG pipelines. Unlike a traditional web search that returns links and short descriptions, this tool returns the actual substance of matching pages — text chunks, tables, code blocks, and structured data — so the model can reason over it directly.
When to use:
- Grounding answers in fresh, relevant web content (RAG)
- Giving an AI agent ready-to-use page content from a single search call
- Question answering and fact-checking against current sources
- Gathering source material for research without manually fetching pages
- When you need the contents of pages, not just titles, descriptions, and URLs
When relaying results in markdown-supporting environments, cite the source URLs from the "sources" map.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | The maximum number of search results considered to select the LLM context data. The default is 20 and the maximum is 50. | |
| query | Yes | The user's search query term. Query can not be empty. Maximum of 400 characters and 50 words in the query. | |
| accept | No | The default supported media type is application/json. | |
| country | No | The search query country, where the results come from. The country string is limited to 2 character country codes of supported countries. | |
| goggles | No | Goggles act as a custom re-ranking on top of Brave's search index. The parameter supports both a url where the Goggle is hosted or the definition of the Goggle. Multiple goggle URLs and/or definitions can be provided in an array. For more details, refer to the Goggles repository (i.e., https://github.com/brave/goggles-quickstart). | |
| freshness | No | Filters search results by when they were discovered. The following values are supported: 'pd' - Discovered within the last 24 hours. 'pw' - Discovered within the last 7 days. 'pm' - Discovered within the last 31 days. 'py' - Discovered within the last 365 days. 'YYYY-MM-DDtoYYYY-MM-DD' - Timeframe is also supported by specifying the date range e.g. 2022-04-01to2022-07-30. | |
| x-loc-lat | No | The latitude of the client's geographical location in degrees, to provide relevant local results. The latitude must be greater than or equal to -90.0 degrees and less than or equal to +90.0 degrees. | |
| spellcheck | No | Whether to enable spellcheck on the query. | |
| user-agent | No | The user agent originating the request. Brave search can utilize the user agent to provide a different experience depending on the device as described by the string. The user agent should follow the commonly used browser agent strings on each platform. For more information on curating user agents, see RFC 9110. | |
| x-loc-city | No | The generic name of the client city | |
| x-loc-long | No | The longitude of the client's geographical location in degrees, to provide relevant local results. The longitude must be greater than or equal to -180.0 and less than or equal to +180.0 degrees. | |
| api-version | No | The API version to use. This is denoted by the format YYYY-MM-DD. Default is the latest that is available. Read more about API versioning at https://api-dashboard.search.brave.com/documentation/guides/versioning. | |
| search_lang | No | The search language preference. The 2 or more character language code for which the search results are provided. | |
| x-loc-state | No | A code which could be up to three characters, that represent the client's state/region. The region is the first-level subdivision (the broadest or least specific) of the ISO 3166-2 code. | |
| enable_local | No | Whether to enable local recall. Not setting this value means auto-detect and uses local recall if any of the localization headers are provided. | |
| cache-control | No | Brave Search will return cached content by default. To prevent caching set the Cache-Control header to no-cache. This is currently done as best effort. | |
| x-loc-country | No | The two letter country code for the client’s country. For a list of country codes, see ISO 3166-1 alpha-2 | |
| x-loc-state-name | No | The name of the client’s state/region. The region is the first-level subdivision (the broadest or least specific) of the ISO 3166-2 code. | |
| x-loc-postal-code | No | The client’s postal code | |
| context_threshold_mode | No | The mode to use to determine the threshold for including content in context. Default is balanced. | |
| enable_source_metadata | No | Enable source metadata enrichment (site_name, favicon) in the sources attribute of the response. | |
| maximum_number_of_urls | No | Maximum number of different URLs to include in LLM context. | |
| maximum_number_of_tokens | No | Approximate maximum number of tokens to include in context. The default is 8192 and maximum is 32768. | |
| maximum_number_of_snippets | No | Maximum number of different snippets (or chunks of text) to include in LLM context. The default is 50 and maximum is 256. | |
| maximum_number_of_tokens_per_url | No | Maximum number of tokens to include per URL. The default is 4096 and maximum is 8192. | |
| maximum_number_of_snippets_per_url | No | Maximum number of snippets to include per URL. The default is 50 and maximum is 100. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sources | Yes | Metadata for each referenced URL, keyed by URL. Known fields include title, hostname, and age; site_name, favicon, and thumbnail are present when enable_source_metadata is true. Unknown fields are preserved as-is. | |
| grounding | Yes |