The Perplexity Search API returns real-time, grounded web search results that you can drop directly into a retrieval pipeline.Documentation Index
Fetch the complete documentation index at: https://docs.langchain.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
This will help you get started withPerplexitySearchRetriever retrieval. For detailed documentation of all PerplexitySearchRetriever features and configurations head to the API reference.
Integration details
| Retriever | Source | Package | PY support |
|---|---|---|---|
PerplexitySearchRetriever | The web, via the Perplexity Search API. | @langchain/perplexity | ✅ |
Setup
You will need to populate aPERPLEXITY_API_KEY environment variable with your Perplexity API key, or pass it into the constructor as apiKey. Get a key from the Perplexity API key dashboard.
Installation
This retriever lives in the@langchain/perplexity package:
Instantiation
maxResults, country, searchDomainFilter, searchRecencyFilter, searchAfterDate, and searchBeforeDate. See the Perplexity Search API parameters for details.
Usage
Document has the search result snippet as pageContent and { title, url, date, lastUpdated } in metadata.
Use within a chain
Like other retrievers,PerplexitySearchRetriever can be incorporated into LLM applications via chains.
API reference
For detailed documentation of allPerplexitySearchRetriever features and configurations head to the API reference.
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

