How to Replace Keyword Search with Exa’s Neural Search API

November 9, 2026

Exa is a search API built for descriptions rather than keywords. You send a sentence like “a blog post explaining Postgres MVCC internals” and get back pages that match the idea, not pages that contain those three words.

The model behind it embeds the web, so it can find a page that never uses the phrase you typed. That is either exactly what your agent needed or a source of results you cannot explain to a stakeholder. This guide covers both sides.

Setup assumes the exa-py Python client, version 1.x, as of November 2026.

Keyword search matches tokens. Exa matches meaning. Ask for “startups that pivoted from consumer to enterprise” and a keyword engine returns articles about pivoting. Exa returns company pages, funding announcements and founder interviews where the pivot is the subject.

For agents, that is the difference between research and link-fetching. An agent doing competitive analysis needs the second behaviour.

Who this is for: research agents, RAG pipelines that need fresh pages, and internal tools where users type a question rather than a query. Who it is not for: anything where you need to page through results deterministically, or where the answer must be a specific known URL that keyword search already finds.

How do you set up Exa and run the first query?

Get an API key from dashboard.exa.ai. Then:

pip install exa-py
from exa_py import Exa
exa = Exa(api_key=KEY)
res = exa.search_and_contents(
    "blog posts explaining how vector databases handle updates",
    type="neural",
    num_results=5,
)

type="neural" is the natural-language mode. type="keyword" gives you classic token matching on Exa’s index, which is useful for exact product names and error codes where semantic search gets fuzzy. type="auto" lets Exa pick based on the query, and it is a reasonable default for a general agent.

Each result arrives with url, title, published_date, author and score. The score is not a probability; treat it as a ranking signal only.

How do you get page text back without a second request?

The _and_contents variant asks Exa to fetch and return page text in the same call. You control how much:

res = exa.search_and_contents(
    query, num_results=8,
    text={"max_characters": 4000},
    highlights={"num_sentences": 3},
)

Three trade-offs worth knowing:

  • text returns raw page text up to your cap. 4,000 characters is roughly 1,000 tokens per result, so 8 results is 8,000 tokens in your prompt.
  • highlights returns only the sentences relevant to your query. Much cheaper, but you lose context if the model needs to summarise rather than quote.
  • summary asks Exa’s own model for a summary per result. Nested LLM calls add latency, typically a second or two per batch.

For a RAG pipeline, highlights first, then fetch full text only for the two or three results the model actually cites.

How do domain and date filters change result quality?

Filters are the difference between usable and unusable for most teams.

  • include_domains=["arxiv.org", "github.com"] restricts to sources you trust. Worth setting for anything user-facing.
  • category accepts a fixed list including research paper, news, company, github and pdf. This is often better than a domain list because it is maintained by Exa.
  • start_published_date="2025-01-01" removes stale results. For fast-moving topics this single flag changes output more than any prompt tweak.
  • num_results above 25 rarely helps and always costs.

What does it cost, and what is the rate limit?

Exa prices per 1,000 searches, with content retrieval billed separately from the search itself. The free tier covers prototyping (a few hundred searches), and paid plans are volume-tiered.

The numbers that matter when sizing: a search with contents is meaningfully more expensive than a bare search, so a 5,000-query-per-day agent that always returns full text is going to notice. Cache aggressively; the same query within an hour usually returns the same top results.

Rate limits are per-key and enforced per minute. Batch your calls rather than firing 50 in parallel, or you will spend your time handling 429s instead of results.

Which queries does neural search get wrong?

Real failures, from teams running this in production:

  1. Exact identifiers. “error 0x80070005” or “RFC 9110” work better with type="keyword". Neural search returns conceptually related pages that are not the spec.
  2. Very fresh pages. Index freshness lags by hours to a day for small sites. If you need something published in the last hour, this is not the tool.
  3. Negative constraints. “Python libraries that are not pandas” pulls pandas, because embeddings do not handle negation well. Express constraints as filters instead.
  4. Niche jargon. Internal product names with no web presence get matched on fuzzy similarity and produce confident nonsense.

How do you justify results to a user?

Return the URL and the published date in the UI. Neural search users frequently ask “why this page”, and the honest answer is “it is semantically close to your description”, which is fine for research and not fine for a compliance audit. If your use case needs citation-grade traceability, restrict include_domains to a vetted list so every result is explainable by source alone.

Quick Summary

  • Exa accepts a natural-language description and returns semantically matching pages, which suits research agents better than token matching.
  • Use search_and_contents with highlights for cheap RAG context and fetch full text only for results you actually cite.
  • Switch to type="keyword" for error codes and spec numbers, where semantic matching reliably fails.
  • Filter with include_domains, category and start_published_date; freshness filtering changes output more than prompt tuning.
  • Search and content retrieval bill separately per 1,000 calls, so cache repeated queries before scaling up.
Tags: