Exa Search Integration
Quick Reference
| Topic |
When to Use |
Reference |
| Search Modes |
Choosing between auto, neural, and keyword search |
search-modes.md |
| Filters |
Domain, date, text, and category filtering |
filters.md |
| Contents |
Text extraction, highlights, summaries, livecrawl |
contents.md |
| SDK Patterns |
Python (exa_py) and TypeScript (exa-js) usage |
sdk-patterns.md |
Essential Patterns
Basic Search (Python)
from exa_py import Exa
exa = Exa(api_key="your-api-key") # or set EXA_API_KEY env var
results = exa.search_and_contents(
"latest developments in quantum computing",
type="auto",
num_results=10,
text=True,
highlights=True
)
for result in results.results:
print(f"{result.title}: {result.url}")
print(result.text[:500])
Basic Search (TypeScript)
import Exa from "exa-js";
const exa = new Exa(process.env.EXA_API_KEY);
const results = await exa.searchAndContents(
"latest developments in quantum computing",
{
type: "auto",
numResults: 10,
text: true,
highlights: true,
}
);
results.results.forEach((result) => {
console.log(`${result.title}: ${result.url}`);
});
Search with Filters
results = exa.search_and_contents(
"AI startup funding rounds",
type="neural",
num_results=10,
include_domains=["techcrunch.com", "venturebeat.com"],
start_published_date="2024-01-01",
text={"max_characters": 2000},
summary=True
)
Find Similar Links
similar = exa.find_similar_and_contents(
"https://example.com/interesting-article",
num_results=10,
exclude_source_domain=True,
text=True
)
Search Mode Selection
| Mode |
When to Use |
Notes |
auto |
Default for most queries |
Exa optimizes between neural/keyword automatically |
neural |
Natural language, conceptual queries |
Best for "what is...", "how to...", topic exploration |
keyword |
Exact matches, technical terms, names |
Best for specific product names, error codes, proper nouns |
Common Mistakes
- Using
keyword for conceptual queries - Neural search understands intent better; use auto or neural for natural language questions
- Not setting
text=True - Search returns URLs only by default; explicitly request content with text=True
- Ignoring
highlights - Use highlights=True for relevant snippets without downloading full page text
- Missing API key - Set
EXA_API_KEY environment variable or pass explicitly to constructor
- Over-filtering initially - Start with broad searches, then add domain/date filters to refine
- Not using
summary - For RAG applications, summary=True provides concise context without full page text
- Expecting scores in auto mode - Relevance scores are only returned with
type="neural"; auto mode doesn't include them
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: ejirocodes-agent-skills-exa-search3description: Exa Search Integration4---56# Exa Search Integration78## Quick Reference910| Topic | When to Use | Reference |11|-------|-------------|-----------|12| **Search Modes** | Choosing between auto, neural, and keyword search | [search-modes.md](references/search-modes.md) |13| **Filters** | Domain, date, text, and category filtering | [filters.md](references/filters.md) |14| **Contents** | Text extraction, highlights, summaries, livecrawl | [contents.md](references/contents.md) |15| **SDK Patterns** | Python (exa_py) and TypeScript (exa-js) usage | [sdk-patterns.md](references/sdk-patterns.md) |1617## Essential Patterns1819### Basic Search (Python)2021```python22from exa_py import Exa2324exa = Exa(api_key="your-api-key") # or set EXA_API_KEY env var2526results = exa.search_and_contents(27 "latest developments in quantum computing",28 type="auto",29 num_results=10,30 text=True,31 highlights=True32)3334for result in results.results:35 print(f"{result.title}: {result.url}")36 print(result.text[:500])37```3839### Basic Search (TypeScript)4041```typescript42import Exa from "exa-js";4344const exa = new Exa(process.env.EXA_API_KEY);4546const results = await exa.searchAndContents(47 "latest developments in quantum computing",48 {49 type: "auto",50 numResults: 10,51 text: true,52 highlights: true,53 }54);5556results.results.forEach((result) => {57 console.log(`${result.title}: ${result.url}`);58});59```6061### Search with Filters6263```python64results = exa.search_and_contents(65 "AI startup funding rounds",66 type="neural",67 num_results=10,68 include_domains=["techcrunch.com", "venturebeat.com"],69 start_published_date="2024-01-01",70 text={"max_characters": 2000},71 summary=True72)73```7475### Find Similar Links7677```python78similar = exa.find_similar_and_contents(79 "https://example.com/interesting-article",80 num_results=10,81 exclude_source_domain=True,82 text=True83)84```8586## Search Mode Selection8788| Mode | When to Use | Notes |89|------|-------------|-------|90| `auto` | Default for most queries | Exa optimizes between neural/keyword automatically |91| `neural` | Natural language, conceptual queries | Best for "what is...", "how to...", topic exploration |92| `keyword` | Exact matches, technical terms, names | Best for specific product names, error codes, proper nouns |9394## Common Mistakes95961. **Using `keyword` for conceptual queries** - Neural search understands intent better; use `auto` or `neural` for natural language questions972. **Not setting `text=True`** - Search returns URLs only by default; explicitly request content with `text=True`983. **Ignoring `highlights`** - Use `highlights=True` for relevant snippets without downloading full page text994. **Missing API key** - Set `EXA_API_KEY` environment variable or pass explicitly to constructor1005. **Over-filtering initially** - Start with broad searches, then add domain/date filters to refine1016. **Not using `summary`** - For RAG applications, `summary=True` provides concise context without full page text1027. **Expecting scores in auto mode** - Relevance scores are only returned with `type="neural"`; auto mode doesn't include them103104---105> Converted and distributed by [TomeVault](https://tomevault.io/claim/ejirocodes) — claim your Tome and manage your conversions.106<!-- tomevault:4.0:skill_md:2026-04-11 -->