Prerequisites
Before starting, ensure you have:- A SambaCloud account and API key
- An Exa account and API key
- Python 3.9+ or Node.js 18+
Setup
Follow the steps below to install the required dependencies and configure your environment.Install dependencies
Install the required SDKs for your preferred language.
- Python
- Node.js
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).Search the web with Exa
Use Exa to retrieve relevant web content and highlights for your query.
- Python
- Node.js
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.- Python
- Node.js
Search modes and freshness controls
Exa supports multiple search strategies:| Search type | Best for |
|---|---|
auto | Recommended. Best balance of quality and speed. |
fast | Lowest-latency search experience. |
deep | Most comprehensive search coverage. |
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
- Exa Documentation: Full reference for the Exa Python and Node.js SDKs
- Exa Search API Reference: Detailed API parameters and response schemas
- SambaNova Documentation: Model options, API endpoints, and usage guides

