Documentation Index
Fetch the complete documentation index at: https://nvd-54.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Perplexity Search is a web search API that returns ranked, source-attributed results designed for use by LLMs and agents. The Search API endpoint returns the underlying web results that power Perplexity’s answer engine.我们可以将其用作检索器。 它将展示此集成特有的功能。 After going through, it may be useful to explore relevant use-case pages to learn how to use this retriever as part of a larger chain.
设置
安装
The integration lives in thelangchain-perplexity package:
凭证
You’ll need a Perplexity API key to use this integration. Create one in the Perplexity API key dashboard, then set it as thePPLX_API_KEY environment variable (the integration also accepts PERPLEXITY_API_KEY).
实例化
PerplexitySearchRetriever accepts the following constructor arguments:
k— max number of results (1–20). Defaults to10.max_tokens— max total tokens across all results.max_tokens_per_page— max tokens returned per result page.country— ISO country code to bias results (e.g."US").search_domain_filter— list of domains to include or exclude (max 20). Prefix a domain with-to exclude it. See the domain filter docs.search_recency_filter— one of"day","week","month","year". See the date and time filter docs.search_after_date/search_before_date— date strings inMM/DD/YYYYformat.
用法
Document has the result snippet as its page_content, plus title, url, date, and last_updated in metadata.
Filtered usage
You can constrain the search with the same filters supported by the Perplexity Search API:在链中使用
We can easily combine this retriever into a chain to build a simple RAG pipeline.API 参考
For detailed documentation of the Perplexity Search API and all of its options, see the Search API reference and the Perplexity API documentation.连接这些文档到 Claude、VSCode 等工具,通过 MCP 获取实时答案。

