"fascinating article about cats" and compare the search results from Google and Exa. Google gives us SEO-optimized listicles based on the keyword “fascinating”. Exa just works.
本 notebook 介绍如何使用 Exa Search with LangChain。
设置
安装
Install the LangChain Exa integration package:凭证
You’ll need an Exa API key to use this integration. Get $10 free credit (plus more by completing certain actions like making your first search) by signing up here.Using ExaSearchResults tool
ExaSearchResults is a tool that can be used with LangChain agents to perform Exa searches. It provides a more structured interface for search operations:Advanced features for ExaSearchResults
You can use advanced search options like controlling search type, live crawling, and content filtering:Using ExaFindSimilarResults tool
ExaFindSimilarResults allows you to find webpages similar to a given URL. This is useful for finding related content or competitive analysis:Use within an Agent
We can use the ExaSearchResults and ExaFindSimilarResults tools with a LangGraph agent. This gives the agent the ability to dynamically search for information and find similar content based on the user’s queries. First, let’s set up the 语言模型. 你需要 provide your OpenAI API key:Using ExaSearchRetriever
ExaSearchRetriever is a retriever that uses Exa Search to retrieve relevant documents.The
max_characters parameter for TextContentsOptions used to be called max_length which is now deprecated. 确保 use max_characters instead.Basic usage
Here’s a simple example of using ExaSearchRetriever:Advanced features
You can use advanced features like controlling the number of results, search type, live crawling, summaries, and text content options:API 参考
所有 Exa API features and configurations, visit the Exa API documentation.Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

