docs: update Exa integration examples (#31547)

## Description

Updating Exa integration documentation to showcase the latest features
and best practices.

## Changes

- Added examples for `ExaSearchResults` tool with advanced search
options
- Added examples for `ExaFindSimilarResults` tool
- Updated agent example to use LangGraph
- Demonstrated text content options, summaries, and highlights
- Included examples of search type control and live crawling

## Additional Context

I'm from the Exa team updating our integration documentation to reflect
current capabilities and best practices.
This commit is contained in:
Jacob Peddicord 2025-06-09 18:24:42 -07:00 committed by GitHub
parent 9ce974247c
commit b21526fe38
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 308 additions and 649 deletions

View File

@ -1,117 +1,107 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Exa\n",
"\n",
">[Exa](https://exa.ai/) is a knowledge API for AI and developers.\n",
">\n",
"\n",
"## Installation and Setup\n",
"\n",
"`Exa` integration exists in its own [partner package](https://pypi.org/project/langchain-exa/). You can install it with:"
]
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Exa\n",
"\n",
">[Exa](https://exa.ai/) is a knowledge API for AI and developers.\n",
">\n",
"\n",
"## Installation and Setup\n",
"\n",
"`Exa` integration exists in its own [partner package](https://pypi.org/project/langchain-exa/). You can install it with:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%pip install -qU langchain-exa"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In order to use the package, you will also need to set the `EXA_API_KEY` environment variable to your Exa API key.\n",
"\n",
"## Retriever\n",
"\n",
"You can use the [`ExaSearchRetriever`](/docs/integrations/tools/exa_search#using-exasearchretriever) in a standard retrieval pipeline. You can import it as follows.\n",
"\n",
"See a [usage example](/docs/integrations/tools/exa_search).\n"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"id": "y8ku6X96sebl"
},
"outputs": [],
"source": [
"from langchain_exa import ExaSearchRetriever"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": "## Tools\n\nYou can use Exa as an agent tool as described in the [Exa tool calling docs](/docs/integrations/tools/exa_search#use-within-an-agent).\n\nSee a [usage example](/docs/integrations/tools/exa_search).\n\n### ExaFindSimilarResults\n\nA tool that queries the Metaphor Search API and gets back JSON."
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from langchain_exa.tools import ExaFindSimilarResults"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### ExaSearchResults\n",
"\n",
"Exa Search tool."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from langchain_exa.tools import ExaSearchResults"
]
}
],
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
}
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%pip install -qU langchain-exa"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In order to use the package, you will also need to set the `EXA_API_KEY` environment variable to your Exa API key.\n",
"\n",
"## Retriever\n",
"\n",
"You can use the [`ExaSearchRetriever`](/docs/integrations/tools/exa_search#using-exasearchretriever) in a standard retrieval pipeline. You can import it as follows.\n",
"\n",
"See a [usage example](/docs/integrations/tools/exa_search).\n"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"id": "y8ku6X96sebl"
},
"outputs": [],
"source": [
"from langchain_exa import ExaSearchRetriever"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Tools\n",
"\n",
"You can use Exa as an agent tool as described in the [Exa tool calling docs](/docs/integrations/tools/exa_search#using-the-exa-sdk-as-langchain-agent-tools).\n",
"\n",
"See a [usage example](/docs/integrations/tools/exa_search).\n",
"\n",
"### ExaFindSimilarResults\n",
"\n",
"A tool that queries the Metaphor Search API and gets back JSON."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from langchain_exa.tools import ExaFindSimilarResults"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### ExaSearchResults\n",
"\n",
"Exa Search tool."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from langchain_exa.tools import ExaSearchResults"
]
}
],
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 4
"nbformat": 4,
"nbformat_minor": 4
}

File diff suppressed because one or more lines are too long