skills/langchain-exa/SKILL.md
--- name: langchain-exa description: LangChain Exa integration — semantic web search with ExaSearchRetriever (RAG), ExaSearchResults (agent tool), and ExaFindSimilarResults (find similar URLs). Unique features: use_autoprompt (LLM query rewriting), highlights (excerpts), summary (per-result LLM summaries), livecrawl (real-time), and date filtering. --- # LangChain Exa Skill Expert assistance for `langchain-exa`: Exa's neural/semantic web search as a LangChain retriever and agent tools. **Inst
npx skillsauth add enuno/claude-command-and-control skills/langchain-exaInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Expert assistance for langchain-exa: Exa's neural/semantic web search as a LangChain retriever and agent tools.
Install: pip install -U langchain-exa
Setup: export EXA_API_KEY=your_api_key
API: https://exa.ai
Reference: references/api.md (500 KB — full API reference).
Activate when:
ExaSearchRetriever to retrieve live web results as documentsExaSearchResults for tool-calling in a ReAct agentExaFindSimilarResults to find pages similar to a URLsummary=True for LLM-generated page summarieshighlights=True for relevant snippets from each pagelivecrawl="always" to bypass index and crawl liveuse_autoprompt=True for Exa to optimize the queryinclude_domains or exclude_domainsstart_published_date, end_published_date, start_crawl_date, end_crawl_datetype="neural", "keyword", or "auto"from langchain_exa import ExaSearchRetriever
retriever = ExaSearchRetriever(
k=5, # number of results
# exa_api_key="...", # or set EXA_API_KEY env var
use_autoprompt=True, # Exa rewrites query for better results
type="neural", # "neural" | "keyword" | "auto"
highlights=True, # include relevant excerpts
summary=True, # include LLM-generated page summary
livecrawl="always", # "always" | "fallback" | "never"
)
docs = retriever.invoke("How does LangGraph handle state persistence?")
for doc in docs:
print(doc.page_content[:300])
print(doc.metadata) # url, title, score, published_date, highlights, summary
from langchain_exa import ExaSearchRetriever
retriever = ExaSearchRetriever(
k=3,
include_domains=["arxiv.org", "github.com"], # only these domains
# exclude_domains=["reddit.com"], # block these domains
start_published_date="2024-01-01", # ISO date
end_published_date="2026-01-01",
# start_crawl_date="2025-01-01", # filter by when Exa crawled
use_autoprompt=True,
)
docs = retriever.invoke("LLM agent memory architectures")
from langchain_exa import ExaSearchResults
from langgraph.prebuilt import create_react_agent
from langchain_openai import ChatOpenAI
search_tool = ExaSearchResults()
# Invoke directly
result = search_tool.invoke({
"query": "latest LangChain releases 2026",
"num_results": 3,
})
print(result) # SearchResponse with Result objects
# Use in a ReAct agent
agent = create_react_agent(
ChatOpenAI(model="gpt-4o-mini"),
tools=[search_tool],
)
response = agent.invoke({"messages": [("human", "What happened in AI this week?")]})
from langchain_exa import ExaFindSimilarResults
find_similar = ExaFindSimilarResults()
# Find pages similar to a given URL
result = find_similar.invoke({
"url": "https://blog.langchain.dev/langgraph/",
"num_results": 5,
})
print(result) # Similar pages with title, url, score
from langchain_exa import ExaSearchRetriever
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.output_parsers import StrOutputParser
from langchain_openai import ChatOpenAI
from langchain_core.runnables import RunnablePassthrough
retriever = ExaSearchRetriever(
k=3,
use_autoprompt=True,
summary=True, # get summaries instead of raw text for clean context
)
llm = ChatOpenAI(model="gpt-4o-mini")
prompt = ChatPromptTemplate.from_template("""
Answer based on the following web search results:
{context}
Question: {question}
""")
def format_docs(docs):
return "\n\n".join(
f"**{doc.metadata.get('title', 'Untitled')}**\n{doc.page_content}"
for doc in docs
)
chain = (
{"context": retriever | format_docs, "question": RunnablePassthrough()}
| prompt
| llm
| StrOutputParser()
)
answer = chain.invoke("What are the latest LangGraph features?")
print(answer)
from langchain_exa import ExaSearchResults, ExaFindSimilarResults
from langchain_community.tools import WikipediaQueryRun
from langgraph.prebuilt import create_react_agent
from langchain_openai import ChatOpenAI
tools = [
ExaSearchResults(),
ExaFindSimilarResults(),
WikipediaQueryRun(),
]
agent = create_react_agent(ChatOpenAI(model="gpt-4o"), tools=tools)
ExaSearchRetriever key parameters| Param | Type | Default | Description |
|-------|------|---------|-------------|
| k | int | 10 | Number of results to return |
| type | str | "neural" | Search type: "neural", "keyword", or "auto" |
| use_autoprompt | bool | False | Exa rewrites the query using its own LLM |
| highlights | bool | False | Return relevant text excerpts from each page |
| summary | bool | False | Return LLM-generated summary of each page |
| livecrawl | str | "never" | "always", "fallback" (if not indexed), "never" |
| include_domains | list[str] | None | Only return results from these domains |
| exclude_domains | list[str] | None | Never return results from these domains |
| start_published_date | str | None | ISO date: only pages published after this |
| end_published_date | str | None | ISO date: only pages published before this |
| start_crawl_date | str | None | ISO date: only pages crawled after this |
| end_crawl_date | str | None | ISO date: only pages crawled before this |
| exa_api_key | str | None | API key (or EXA_API_KEY env) |
Each result includes: url, id, title, score, published_date, author, text, highlights, highlight_scores, summary
| Feature | Exa | Perplexity | SerpAPI |
|---------|-----|-----------|---------|
| Search type | Semantic + keyword | Web search | Google |
| find_similar | ✅ | ❌ | ❌ |
| Per-result summaries | ✅ | ❌ | ❌ |
| Highlights/excerpts | ✅ | ❌ | Limited |
| livecrawl | ✅ | Implicit | ❌ |
| Domain filtering | ✅ | ❌ | ❌ |
| Date filtering | ✅ | Limited | ❌ |
| File | Size | Contents |
|------|------|----------|
| references/api.md | 500 KB | Full API reference |
| references/llms.md | 28 KB | Doc index |
| references/llms-full.md | 500 KB | Complete page content |
Source: https://reference.langchain.com/python/langchain-exa
API key: https://exa.ai
GitHub: https://github.com/langchain-ai/langchain/tree/main/libs/partners/exa
tools
MemPalace local-first AI memory system. Use when setting up persistent memory for Claude Code sessions, mining project files or conversation transcripts, querying past context, configuring MCP tools, managing the knowledge graph, or troubleshooting palace operations.
tools
LangSmith Python SDK — trace, evaluate, and monitor LLM applications. Covers @traceable decorator, trace context manager, Client API, evaluate() / aevaluate(), comparative evaluation, custom evaluators, dataset management, prompt caching, ASGI middleware, and pytest plugin.
development
LangGraph (Python) — build stateful, controllable agent graphs with checkpointing, streaming, persistence, interrupts, fault tolerance, and durable execution. Covers both Graph API (StateGraph) and Functional API (@entrypoint/@task).
development
LangGraph Graph API (Python) — build explicit DAG agent workflows with StateGraph, typed state, nodes, edges, Command routing, Send fan-out, checkpointers, interrupts, and streaming. Use when you need explicit control flow and graph topology.