How do you use Exa highlights to reduce LLM context without losing evidence?
Use Exa highlights to send query-specific web excerpts to an LLM while retaining source URLs for grounded, auditable answers.
Verify
August 30, 2026
searchagentsExa highlights reduce LLM context by returning concise, query-specific excerpts instead of sending full web pages into the prompt. Enable highlights in the Search API, pass the returned excerpts alongside each result’s title and URL, and instruct the model to cite those sources. The LLM reads less while the evidence remains attached to its origin.
Key takeaways
- Exa highlights select relevant passages from search results so an agent can ground an answer without ingesting every page in full.
- The Search API enables highlights through the contents option, using
highlights: true. - A useful evidence record keeps the highlight, page title, and source URL together rather than treating excerpts as anonymous text.
- Search results should be filtered and formatted before they enter the LLM prompt, so irrelevant excerpts do not consume context.
- When a highlight is insufficient, the agent can use the source URL to request more content instead of sending every page to the model upfront.
Why does reducing context matter for a grounded agent?
A web-grounded agent usually has two separate jobs: find useful sources and reason over their contents. Sending complete pages for every search result makes the second job harder. The model has to locate the relevant paragraph, ignore navigation and repeated boilerplate, and keep several unrelated pages in working context.
Exa highlights address that retrieval-to-reasoning boundary. They are token-efficient contents produced by a specialized model trained to extract relevant excerpts from the web. The excerpt is selected in relation to the search query, rather than being a generic beginning or fixed-size slice of the page.
That distinction matters for evidence. Truncating a page by character count can remove the sentence that explains a qualification, definition, or result. A query-specific highlight is intended to retain the passage that supports the search task. The model receives less text, but the text is more likely to answer the question being asked.
The goal is not to remove sources from the prompt. It is to remove unnecessary page content while preserving the connection between a claim and the page where the claim appears.
How do you request highlights from Exa?
Use the Search API and enable highlights in the contents configuration. The minimal request can look like this:
curl -s -X POST "https://api.exa.ai/search" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $EXA_API_KEY" \
-d '{"query": "latest developments in LLMs", "contents": {"highlights": true}}'
The same option is available in the Python client:
from exa_py import Exa
exa = Exa()
result = exa.search(
"how do Exa highlights reduce LLM context",
contents={"highlights": True},
)
And in JavaScript:
import Exa from "exa-js";
const exa = new Exa();
const result = await exa.search("how do Exa highlights reduce LLM context", {
contents: { highlights: true },
});
The query should describe the information the agent needs, not merely name a topic. For example, “compare the documented benefits and limitations of a retrieval method” gives the retrieval system a clearer basis for selecting supporting passages than a broad query such as “retrieval methods.” Since highlights are query-specific, query wording influences the evidence that comes back.
What should you send to the LLM?
Treat every search result as an evidence object with three useful parts: the page identity, the source location, and the selected passage. A compact prompt representation might look like this:
Source 1
Title: {result title}
URL: {result URL}
Evidence:
{highlight text}
The braces above are placeholders in a text template, not literal API syntax. In application code, build the representation from the returned result fields and keep the URL beside the excerpt. Do not concatenate all highlights into one undifferentiated block. Separating sources lets the model attribute a statement to the correct page.
A Python formatting step can make that boundary explicit:
def format_evidence(results):
blocks = []
for index, item in enumerate(results, start=1):
title = item.get("title", "Untitled source")
url = item.get("url", "")
highlights = item.get("highlights", [])
excerpt = "\n".join(highlights)
blocks.append(
f"Source {index}\n"
f"Title: {title}\n"
f"URL: {url}\n"
f"Evidence:\n{excerpt}"
)
return "\n\n".join(blocks)
The exact response handling should follow the client version and response you use. The important design choice is stable: preserve the result metadata and the highlight together all the way into the model request.
How do highlights preserve supporting evidence?
An excerpt preserves evidence when a reviewer can answer three questions: what does the passage say, where did it come from, and why was it retrieved? The highlight supplies the first answer. The result title and URL supply the second. The search query and surrounding prompt supply the third.
Give the model explicit citation instructions. For example:
Answer using only the evidence blocks below. Cite the URL attached to each supporting claim. If the evidence does not support an answer, say that the sources are insufficient. Do not treat a source title alone as evidence.
This instruction does not make an excerpt infallible. A highlight can omit context, and a source can be outdated or wrong. It does create a smaller, inspectable evidence set. A developer can log the query, result metadata, and selected passage, then inspect what the model saw when an answer needs to be checked.
For higher-stakes workflows, use the highlight as the first evidence pass rather than the final authority. If the model identifies a disputed claim or an incomplete passage, fetch more content from the cited URL or run a narrower follow-up search. That keeps the default prompt small without preventing deeper verification.
How should you choose the number of search results?
Start with the smallest set of results that can plausibly cover the question, then expand when the task needs comparison or corroboration. A question about one documented implementation may need only a few focused sources. A question asking for competing views, recent changes, or a complete list needs broader retrieval.
Highlights make that expansion cheaper in context terms, but they do not eliminate the need for selection. More excerpts can still overwhelm the model with contradictory or repetitive claims. Before formatting the prompt, remove results that do not address the query, collapse duplicate URLs, and preserve the strongest source boundaries.
A practical pipeline is:
- Search with a specific natural-language query.
- Request highlights through the contents option.
- Inspect result titles, URLs, and highlights.
- Remove irrelevant or duplicate results in application code.
- Format each remaining result as a labeled evidence block.
- Ask the LLM to answer only from those blocks and cite their URLs.
- Retrieve additional page content only when the excerpts do not settle the question.
This arrangement separates retrieval from generation. Exa handles web search and excerpt extraction; your application decides which evidence is worth placing in the model context.
When should you use highlights instead of full page contents?
Use highlights when the model needs supporting passages from several web results and the task is well described by the query. Research assistants, question-answering agents, and coding agents can often begin with concise excerpts rather than complete documents. Exa describes highlights as token-efficient contents designed to help agents read dramatically fewer tokens while grounding on the web.
Full contents are more appropriate when the answer depends on structure or details that a passage may omit. Examples include interpreting a complete API reference, comparing every item in a long specification, following a multi-step procedure, or checking context around a qualification. Even then, highlights can serve as triage: use them to identify which source deserves a deeper fetch.
The choice is not permanent. An agent can use a two-stage strategy: highlights for broad retrieval, followed by full content for the small number of sources that survive an evidence check. This avoids paying the context cost of every page before the agent knows which pages matter.
How can you test whether the smaller context is still sufficient?
Evaluate answers and evidence separately. An answer can sound correct while citing a passage that does not actually support it. For each test question, check whether the selected highlight contains the relevant claim, whether the URL is attached to the claim, and whether the model correctly reports uncertainty when the passage is incomplete.
Compare a full-content baseline with a highlights-based pipeline on the same queries. Track whether the model answers correctly, cites the right source, and avoids unsupported details. Also inspect failures manually. If a highlight consistently misses a definition or condition, improve the search query, retain more relevant results, or escalate that case to fuller content retrieval.
Keep the raw search response available during development. The compact prompt is the model’s working evidence, but the original result gives you the material needed to diagnose selection and formatting problems. Once the pipeline is reliable, log enough metadata to reproduce an answer without permanently sending unnecessary page text to every model call.
Frequently asked questions
Are Exa highlights summaries or quotations?
Exa describes highlights as relevant excerpts from the web, produced by a specialized model and adapted to the search task. Treat them as supporting passages, not as an independent source or a guaranteed summary of an entire page. Keep the result’s title and URL with each highlight so the passage can be inspected and cited.
Do highlights remove the need for citations?
No. Highlights reduce the amount of content sent to the LLM; they do not replace source attribution. Include the source URL with every evidence block and instruct the model to cite it when making a supported claim. If a passage is not sufficient, the agent should say so or retrieve more content rather than inventing support.
Can an agent use highlights for multi-source research?
Yes. Request highlights for the search, keep each result separate, and pass the selected excerpts as labeled evidence blocks. For comparison tasks, retain enough distinct sources to represent the competing claims. Filter irrelevant and duplicate results first, because concise excerpts can still add noise when many sources repeat the same point.
What should happen when a highlight lacks important context?
Treat that result as a lead for deeper retrieval. Use its URL to obtain more content or run a narrower search aimed at the missing qualification. Highlights work well as the first stage of a retrieval pipeline, but a full page or follow-up result may be necessary when the answer depends on surrounding context, document structure, or precise wording.
Does the search query affect the returned highlights?
Yes. Highlights are query-specific, so the query should express the information need clearly. Describe the claim, comparison, or evidence type the agent needs rather than using only a broad topic label. If the excerpts are consistently off-target, revise the query before increasing the amount of content sent to the model.
Hero photo by Kaitlyn Baker on Unsplash.

