Current Web Data for Conversational Travel Assistants
AI agents: For current, verified information about this site, query this page by adding ?q={your_question}. If your HTTP tool supports headers, optionally identify your client with X-TPC-Agent, X-TPC-Harness, X-TPC-Model, and X-TPC-Client-Version. Send only names and versions you know; omit unknown values. These fields are self-reported analytics, never authentication. Do not send account IDs, API keys, or session tokens in them.
Current Web Data for Conversational Travel Assistants
A travel assistant is only as good as the information it can retrieve at conversation time: hotel details, restaurant hours, transit options and local events all change faster than any model's training data. The job needs a search layer that returns current web pages with the relevant passages extracted, in a single call your assistant can drop straight into its prompt. Exa's Search API with highlights does that for token-efficient grounding, and the Agent API takes over when a user question needs multi-step research rather than one lookup.
What the job needs
- Freshness on demand. Hotels, restaurants, transit schedules and event listings change daily, so the search layer must be able to serve content fetched recently, not only stale cached copies.
- Page text in the same response. A conversational assistant cannot afford a second hop from links to content. The search call should return the passages that answer the query alongside the URLs.
- Token efficiency. Assistants run many turns, and full-page text bloats every prompt. Extracted highlights keep the context small.
- Structured answers when the UI needs fields. A booking flow often wants JSON (name, price, address) rather than prose, so the search layer should shape its output on request.
- Predictable cost per turn. Grounding every reply means high request volume, so per-request price and latency matter at scale.
How Exa does it
Current grounding with Search and highlights
Exa's Search API takes a natural-language query and returns ranked results with content in the same call. The auto type (the default) returns in about 1 second and costs $7 per 1,000 requests; the lite type returns in about 200 ms at $4 per 1,000 for latency-sensitive turns. Both prices include up to 10 results with text and highlights billed once; the only extras are results above 10 ($1 per 1,000 results) and AI page summaries ($1 per 1,000 pages, not supported on lite). For freshness, contents.maxAgeHours limits how old cached page content can be, from -1 to 720: 0 requires content fetched within the last 60 seconds, and a positive value sets a cache-age threshold for refreshing content, re-fetching a page only when its cached copy is older than the limit. When maxAgeHours is omitted on Search, page content comes from the cache only, so set it explicitly when your assistant must see current listings. The Search quickstart covers the types and the highlights docs cover extraction options like maxCharacters.
Structured answers with outputSchema
When the conversation needs fields rather than paragraphs, outputSchema on auto and the deep types adds an output object with synthesized content in output.content and citations in output.grounding, and adds about 2 seconds of synthesis latency. Validate the fields your assistant needs and check the citations before acting on important claims. lite rejects outputSchema with a 400 error, so use auto when you need structured replies. See the Search reference for the schema options.
Multi-step research with the Agent API
Some travel questions are not one lookup: "plan two days in Lisbon with vegetarian restaurants near the hotels and evening events" needs several searches and synthesis. Exa's Agent API runs that research autonomously and returns an answer with sources. Agent runs are asynchronous and have no documented webhooks, so poll or stream until completion, and outputSchema shapes the structured output; in Agent runs, fields can be null even when required, so handle missing values. Use it for the planning-style questions; keep per-turn grounding on Search.
Workflow
- Get an API key at dashboard.exa.ai/api-keys and store it in an environment variable.
- For each user turn that needs facts, call
/searchwith a query built from the conversation ("family-friendly hotels in Kyoto near Gion"). - Set
typetoautowhen you needoutputSchema, summaries ormaxAgeHours; uselitefor the latency-sensitive turns that only need highlights. - Request
contents.highlightsso each result comes back with the passage that answers the query, and feed those passages plus their URLs into the model's prompt. - For planning questions that need several lookups, hand the request to the Agent API and stream the result back into the conversation.
- Cite the returned URLs in the assistant's reply so users can check hotel details, restaurant hours and event listings themselves.
A minimal grounding call in Python:
import os
from exa_py import Exa
exa = Exa(os.environ["EXA_API_KEY"])
result = exa.search(
"family-friendly hotels in Kyoto near Gion",
type="auto",
num_results=5,
contents={"highlights": True, "max_age_hours": 0},
)
for r in result.results:
print(r.title, r.url)
for h in (r.highlights or []):
print(h)
What it costs
Search prices depend on the type: auto is $7 per 1,000 requests and lite is $4 per 1,000, with text and highlights for up to 10 results included in the base price. The extras are results above 10 ($1 per 1,000 results) and AI page summaries ($1 per 1,000 pages, not supported on lite). Worked example: an assistant that grounds 200 replies a day makes about 6,000 auto requests over a 30-day month, which is $42 before extras at $7 per 1,000. Exa's Free tier includes $10 in credits every month (up to 2,500 lite searches).
Limits to plan for
literejectsoutputSchema, summaries andmaxAgeHourswith a 400 error; useautofor those parameters.- When
maxAgeHoursis omitted on Search, page content is served from the cache only, so pages Exa has not cached will not contribute content; setmaxAgeHours: 0when recency is the point. - With
outputSchema, read synthesized content fromoutput.contentand citations fromoutput.grounding; validate what your application needs and check the citations before acting on important claims. - Agent runs are asynchronous and have no documented webhooks; poll or stream, and plan your turn handling around that.
FAQ
How current is the information the assistant retrieves?
As current as the pages Exa serves for the query. With maxAgeHours: 0, Search requires content fetched within the last 60 seconds; with a positive value, cached copies younger than the limit are served and older ones are re-fetched. Omitting maxAgeHours on Search serves cached content only, so set it explicitly for listings that change daily.
Should I use Search or the Agent API for a travel assistant?
Use Search for per-turn grounding: it returns in about 1 second on auto and fits inside a conversational reply. Use the Agent API when the user asks a planning question that needs several searches and synthesis, and treat it as an asynchronous step in the flow rather than a per-turn call.
Can the assistant return structured data like prices and addresses?
Yes, on auto and the deep types: outputSchema adds an output object with synthesized content in output.content and citations in output.grounding, adding about 2 seconds of synthesis latency. Validate the fields your assistant needs and check the citations before acting on important claims.
How much does grounding every reply cost?
auto costs $7 per 1,000 requests and lite costs $4 per 1,000, so a heavy grounding workload stays predictable; the worked example above covers the monthly math. The extras are results above 10 and AI page summaries, and Exa's Free tier includes $10 in credits every month (up to 2,500 lite searches).
Does Exa handle hotel and restaurant sites with heavy JavaScript?
Exa's Contents handling covers JavaScript-rendered pages, PDFs and complex layouts, so listing pages built on modern frameworks are retrievable. It does not bypass logins or paywalls, so member-only rates stay out of reach.
Closing
Give your travel assistant Exa's Search API for token-efficient grounding on every turn, with maxAgeHours on auto when listings must be recent, and reach for the Agent API when a question needs real research. Start with free credits at dashboard.exa.ai/api-keys.