langchain-exa integration provides tools and retrievers for searching the web and finding similar content.
Installation
Install thelangchain-exa package:
Setup
Get an API key from Exa and set it as an environment variable:Components
The integration provides three main components:- ExaSearchResults - Tool for neural search
- ExaFindSimilarResults - Tool for finding similar pages
- ExaSearchRetriever - Retriever for RAG applications
ExaSearchResults Tool
TheExaSearchResults tool performs neural search and returns detailed search results.
Basic Usage
Advanced Features
Parameters
query- The search query (required)num_results- Number of results to return (1-100, default: 10)text_contents_options- Content extraction options:True- Return full text{"max_characters": N}- Limit text length
highlights- Include highlighted excerptssummary- Include AI-generated summariestype- Search type:"neural","keyword", or"auto"include_domains- Filter to specific domainsexclude_domains- Exclude specific domainsstart_published_date- Filter by publish date (YYYY-MM-DD)end_published_date- Filter by publish date (YYYY-MM-DD)start_crawl_date- Filter by crawl date (YYYY-MM-DD)end_crawl_date- Filter by crawl date (YYYY-MM-DD)use_autoprompt- Auto-optimize query for better resultslivecrawl- Crawl live pages:"always","fallback", or"never"
ExaFindSimilarResults Tool
Find pages similar to a given URL.ExaSearchRetriever
The retriever is designed for RAG (Retrieval-Augmented Generation) applications.Basic Retriever
Retriever with Highlights
Retriever with Summary
Configuration Options
The retriever supports the same parameters asExaSearchResults: