Skip to main content
Exa is a web search API built for AI applications. It returns clean, ready-to-use page content with every result, making it easy to ground SambaNova model responses in current web data.

Prerequisites

Before starting, ensure you have:

Setup

Follow the steps below to install the required dependencies and configure your environment.
1

Install dependencies

Install the required SDKs for your preferred language.
The Node.js examples use ES modules and top-level await. Save them with a .mjs extension (or set "type": "module" in your package.json).
2

Configure API keys

Create a .env file in your project directory:
3

Search the web with Exa

Use Exa to retrieve relevant web content and highlights for your query.
4

Ground a SambaNova model with search results

Using the results from the previous step, format the Exa search results as context and pass them to a SambaNova-hosted model.
5

(Optional) Enable tool calling with Exa

For agentic workflows, expose Exa search as a function tool so the model can decide when to search the web.

Search modes and freshness controls

Exa supports multiple search strategies:
Search typeBest for
autoRecommended. Best balance of quality and speed.
fastLowest-latency search experience.
deepMost comprehensive search coverage.
Use max_age_hours (Python) or maxAgeHours (Node.js) to control how recent the returned content must be. Setting this to 0 forces Exa to fetch only live content, while 24 permits results up to one day old.

Example use cases

Here are some common use cases this integration enables:
  • Ground chatbot responses with current web information
  • Build research assistants with source citations
  • Retrieve recent news and developments
  • Add web search capabilities to AI agents
  • Create retrieval-augmented generation (RAG) workflows without maintaining your own search infrastructure

Additional resources