Skip to main content
This guide covers how to build AI agents with powerful web search capabilities using Exa integration. Exa provides semantic search that understands the meaning of queries, enabling agents to find highly relevant, up-to-date information from across the web.
Exa-powered agents can search the web semantically, find current information, and cite sources—making them ideal for research, fact-checking, and knowledge-intensive tasks.

Quick Start

Exa Search Configuration

Exa provides semantic search capabilities that go beyond keyword matching. Web search is enabled per-request by adding "auto_search" to the tools_enabled list on the agent completion body (a sibling of agent_config, not a field inside it).

Configuration Options

Search depth and result formatting are controlled by the agent itself (via its system_prompt and reasoning), not by request-level parameters — there are no exa_search_num_results or exa_search_max_characters fields to tune. Enable search the same way regardless of how much research the task needs — depth is a function of the task and system prompt, not a tunable request parameter:

Use Cases

Market Research Agent

Technical Documentation Research

News and Current Events

Academic Research Assistant

Using Exa with Multi-Agent Systems

Combine Exa search with multi-agent architectures for sophisticated research workflows.
tools_enabled (and therefore auto_search) is only available on /v1/agent/completions (single-agent runs). The /v1/swarm/completions endpoint has no tools_enabled field, so web search cannot be enabled directly on a swarm — give individual agents search-oriented system prompts, or run a search-enabled single agent as a preprocessing step and feed its findings into the swarm’s task.

Research Team with Specialized Agents

Best Practices

1. Craft Effective Search-Oriented Prompts

Structure your system prompts to leverage search capabilities:

2. Match Prompt Depth to Task Complexity

Since auto_search has no tunable result-count or snippet-length parameters, control research depth through the system prompt instead — instruct the agent how many sources to consult and how thoroughly to synthesize them for the task at hand (quick fact lookup vs. comprehensive analysis).

3. Use Appropriate Temperature Settings

  • Factual research (0.1-0.2): When accuracy is critical
  • Balanced analysis (0.3-0.4): For synthesis and interpretation
  • Creative exploration (0.5-0.7): For brainstorming and ideation

4. Handle Time-Sensitive Information

For topics where recency matters, include temporal context in your task:

5. Request Source Citations

Include citation requirements in your system prompt:

Error Handling

Response Format

Search-enabled agents return the standard /v1/agent/completions response shape. The outputs field contains the agent’s final synthesized answer (including any citations the agent chose to include in its text) — there is no separate structured search_results array; source handling happens inside the agent’s tool call and reasoning, not as a distinct response field.
Note: the total_cost in usage reflects token costs only. The flat $0.04 auto_search tool fee is deducted from your account credits separately and does not appear in this usage object.

Cost Optimization

Each auto_search tool call costs a flat $0.04 (search_cost), deducted from your account credits, on top of normal token costs. Optimize usage with these strategies:
  1. Only enable search when needed: Omit tools_enabled (or leave auto_search out of it) for tasks that don’t require live web data — you’ll skip the $0.04 fee entirely.
  2. Cache research results: Store responses for repeated similar queries instead of re-running search.
  3. Use appropriate models: Use gpt-4.1-mini for simpler research tasks to reduce token costs.
  4. Limit output length: Set a smaller max_tokens on agent_config to control response length and cost.