Skip to content

Commit e0619e1

Browse files
feat: add Exa search integration. Added Search and Contents (crawling) tools. (#231)
* Added Exa, the web search api, search and contents tools * Code formatting and linting completed * added max_char feature * updated code with relevant url examples
1 parent d48acff commit e0619e1

File tree

3 files changed

+955
-1
lines changed

3 files changed

+955
-1
lines changed

README.md

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Strands Agents Tools is a community-driven project that provides a powerful set
3939
- 📁 **File Operations** - Read, write, and edit files with syntax highlighting and intelligent modifications
4040
- 🖥️ **Shell Integration** - Execute and interact with shell commands securely
4141
- 🧠 **Memory** - Store user and agent memories across agent runs to provide personalized experiences with both Mem0 and Amazon Bedrock Knowledge Bases
42-
- 🕸️ **Web Infrastructure** - Perform web searches, extract page content, and crawl websites with Tavily-powered tools
42+
- 🕸️ **Web Infrastructure** - Perform web searches, extract page content, and crawl websites with Tavily and Exa-powered tools
4343
- 🌐 **HTTP Client** - Make API requests with comprehensive authentication support
4444
- 💬 **Slack Client** - Real-time Slack events, message processing, and Slack API access
4545
- 🐍 **Python Execution** - Run Python code snippets with state persistence, user confirmation for code execution, and safety features
@@ -108,6 +108,8 @@ Below is a comprehensive table of all available tools, how to use them with an a
108108
| tavily_extract | `agent.tool.tavily_extract(urls=["www.tavily.com"], extract_depth="advanced")` | Extract clean, structured content from web pages with advanced processing and noise removal |
109109
| tavily_crawl | `agent.tool.tavily_crawl(url="www.tavily.com", max_depth=2, instructions="Find API docs")` | Crawl websites intelligently starting from a base URL with filtering and extraction |
110110
| tavily_map | `agent.tool.tavily_map(url="www.tavily.com", max_depth=2, instructions="Find all pages")` | Map website structure and discover URLs starting from a base URL without content extraction |
111+
| exa_search | `agent.tool.exa_search(query="Best project management tools", text=True)` | Intelligent web search with auto mode (default) that combines neural and keyword search for optimal results |
112+
| exa_get_contents | `agent.tool.exa_get_contents(urls=["https://example.com/article"], text=True, summary={"query": "key points"})` | Extract full content and summaries from specific URLs with live crawling fallback |
111113
| python_repl* | `agent.tool.python_repl(code="import pandas as pd\ndf = pd.read_csv('data.csv')\nprint(df.head())")` | Running Python code snippets, data analysis, executing complex logic with user confirmation for security |
112114
| calculator | `agent.tool.calculator(expression="2 * sin(pi/4) + log(e**2)")` | Performing mathematical operations, symbolic math, equation solving |
113115
| code_interpreter | `code_interpreter = AgentCoreCodeInterpreter(region="us-west-2"); agent = Agent(tools=[code_interpreter.code_interpreter])` | Execute code in isolated sandbox environments with multi-language support (Python, JavaScript, TypeScript), persistent sessions, and file operations |
@@ -316,6 +318,71 @@ result = agent.tool.tavily_map(url="www.tavily.com")
316318

317319
```
318320

321+
### Exa Search and Contents
322+
323+
```python
324+
from strands import Agent
325+
from strands_tools.exa import exa_search, exa_get_contents
326+
327+
agent = Agent(tools=[exa_search, exa_get_contents])
328+
329+
# Basic search (auto mode is default and recommended)
330+
result = agent.tool.exa_search(
331+
query="Best project management software",
332+
text=True
333+
)
334+
335+
# Company-specific search when needed
336+
result = agent.tool.exa_search(
337+
query="Anthropic AI safety research",
338+
category="company",
339+
include_domains=["anthropic.com"],
340+
num_results=5,
341+
summary={"query": "key research areas and findings"}
342+
)
343+
344+
# News search with date filtering
345+
result = agent.tool.exa_search(
346+
query="AI regulation policy updates",
347+
category="news",
348+
start_published_date="2024-01-01T00:00:00.000Z",
349+
text=True
350+
)
351+
352+
# Get detailed content from specific URLs
353+
result = agent.tool.exa_get_contents(
354+
urls=[
355+
"https://example.com/blog-post",
356+
"https://github.com/microsoft/semantic-kernel"
357+
],
358+
text={"maxCharacters": 5000, "includeHtmlTags": False},
359+
summary={
360+
"query": "main points and practical applications"
361+
},
362+
subpages=2,
363+
extras={"links": 5, "imageLinks": 2}
364+
)
365+
366+
# Structured summary with JSON schema
367+
result = agent.tool.exa_get_contents(
368+
urls=["https://example.com/article"],
369+
summary={
370+
"query": "main findings and recommendations",
371+
"schema": {
372+
"type": "object",
373+
"properties": {
374+
"main_points": {"type": "string", "description": "Key points from the article"},
375+
"recommendations": {"type": "string", "description": "Suggested actions or advice"},
376+
"conclusion": {"type": "string", "description": "Overall conclusion"},
377+
"relevance": {"type": "string", "description": "Why this matters"}
378+
},
379+
"required": ["main_points", "conclusion"]
380+
}
381+
}
382+
)
383+
384+
```
385+
319386
### Python Code Execution
320387

321388
*Note: `python_repl` does not work on Windows.*
@@ -737,6 +804,13 @@ These variables affect multiple tools:
737804
| TAVILY_API_KEY | Tavily API key (required for all Tavily functionality) | None |
738805
- Visit https://www.tavily.com/ to create a free account and API key.
739806

807+
#### Exa Search and Contents Tools
808+
809+
| Environment Variable | Description | Default |
810+
|----------------------|-------------|---------|
811+
| EXA_API_KEY | Exa API key (required for all Exa functionality) | None |
812+
- Visit https://dashboard.exa.ai/api-keys to create a free account and API key.
813+
740814
#### Mem0 Memory Tool
741815

742816
The Mem0 Memory Tool supports three different backend configurations:

0 commit comments

Comments
 (0)