> ## Documentation Index
> Fetch the complete documentation index at: https://docs.perplexity.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Cookbook

> Guides, runnable examples, and community projects for building with the Perplexity Agent, Search, and Embeddings APIs. Search or filter by product and category.

All cookbook recipes, newest first:

* [Use Decisions API grounded web search to fact check claims](https://docs.perplexity.ai/docs/cookbook/examples/decisions-api-web-grounding/README.md): Fact check claims with the Decisions API in web\_grounding mode. Put the claim first in each state so the search sees it, read search\_results, and let your code turn the probability the model returns into a supported, contradicted, or review verdict.
* [Search Your Docs Folder with pplx-embed-v2, Dense and Contextual](https://docs.perplexity.ai/docs/cookbook/examples/embeddings-docs-search/README.md): Index a folder of Markdown files with pplx-embed-v2 in dense and contextual mode, and store them as int8 vectors. Score approaches against your own questions. Query the 9b index with the 0.6b model.
* [Track What the Web Said Each Week About a Topic, and Build a Report](https://docs.perplexity.ai/docs/cookbook/examples/agent-api-story-timeline/README.md): Search engines tell you what the web says today. This recipe shows what was being reported about a topic during each week of a date range: the Agent API searches each week with publication-date filters, explains how the story changed, and counts the outlets that covered it, while your code writes the timeline and draws the chart.
* [Catch Visual Bugs in CI with the Decisions API](https://docs.perplexity.ai/docs/cookbook/examples/decisions-api-visual-qa-gate/README.md): Use Playwright screenshots and Decisions API probabilities to check selected pages for visual defects. Your code applies cutoffs, reports warnings, and fails CI when a failure rule fires.
* [Enrich a CSV of Companies Overnight with the Batch API](https://docs.perplexity.ai/docs/cookbook/examples/batch-api-company-enrichment/README.md): Write one web-grounded Agent API request per CSV row to a JSONL file, run them asynchronously with the Batch API, and join the output back to your rows by custom\_id.
* [Check a Chart for Misleading Design with a Decision Model](https://docs.perplexity.ai/docs/cookbook/examples/decisions-api-chart-check/README.md): Send a chart image to the Decisions API with yes/no questions about misleading design and your brand guide, and get a probability for each. Your code gates the checks by chart type, compares them to cutoffs, labels the chart, and prints why.
* [Rank Search Results to Answer Questions with the Best Quote Using Decisions API](https://docs.perplexity.ai/docs/cookbook/examples/decisions-quote-finder/README.md): Use Decisions API probabilities to rank sentences from your Search API results, then return the quote that best answers the question, with its URL.
* [Check Agent Actions Before They Run with Decisions API](https://docs.perplexity.ai/docs/cookbook/examples/decisions-api-action-gate/README.md): Run an accounts-payable agent that can pay vendors, but checks proposed functions before they run using Decisions API. The Decisions API provides probabilities for questions about whether the proposed function should run, and your code compares those probabilities to cutoffs to allow, ask about, or block the call before your agent takes action.
* [Judge Citation Accuracy with Decisions API](https://docs.perplexity.ai/docs/cookbook/examples/decisions-api-answer-gate/README.md): Ask the Agent API a question with web search, score every sentence against its sources with the Decisions API, and send low-scoring sentences back to the Agent API to search again. Your code keeps only the rewrites the sources support.
* [Drive a Browser with the Decisions API](https://docs.perplexity.ai/docs/cookbook/examples/decisions-api-browser-agent/README.md): Build a browser agent that asks the Decisions API six questions about a numbered screenshot and gets probabilities back. Your code compares them to cutoffs and does the clicking, scrolling, and stopping. One Decisions API request per step, plus retries if needed.
* [Triage Support Tickets with the Decisions API](https://docs.perplexity.ai/docs/cookbook/examples/decisions-api-ticket-triage/README.md): Route inbound support tickets with three probabilistic questions per ticket from the Decisions API, then send only the escalations to the Agent API.
* [Build a Data Analytics Agent Using Custom Connectors](https://docs.perplexity.ai/docs/cookbook/examples/agent-api-data-analyst/README.md): Ask your agent why conversions fell, have it inspect the data, and turn the investigation into a chart for you to review.
* [Turn Agent Failures into Regression Tests](https://docs.perplexity.ai/docs/cookbook/examples/agent-api-regression-testing/README.md): Build a web-grounded API troubleshooting advisor, then catch unsafe retry advice and unsupported answers before switching models.
* [Search as Code for coding agents](https://docs.perplexity.ai/docs/cookbook/articles/search-as-code-coding-agents/README.md): Use the Perplexity Search SDK to build a source-backed dependency migration packet that any coding agent can inspect before it edits code.
* [Build an incident responder with Profiles, Skills, and Managed Connectors](https://docs.perplexity.ai/docs/cookbook/articles/incident-responder/README.md): Combine a saved Profile, an Incident Response Skill, Sandbox, and Datadog, GitHub, and Slack managed connectors, then launch the custom agent with the Agent API.
* [Enrich Customer Data with Agent API](https://docs.perplexity.ai/docs/cookbook/examples/customer-enrichment-agent-api/README.md): Use Agent API with people\_search to enrich a ClickHouse customer data row and append the result to the table.
* [GitHub investigation agent using managed connectors](https://docs.perplexity.ai/docs/cookbook/examples/triage-bug-report-connectors/README.md): Use managed Slack and GitHub connectors to investigate a linked bug report and reply in its Slack thread.
* [Customizing Effort Levels](https://docs.perplexity.ai/docs/cookbook/examples/agent-api-effort/README.md)
* [Grounded Data Story with Kimi K3](https://docs.perplexity.ai/docs/cookbook/examples/data-story-kimi-k3/README.md): Turn any topic into a self-contained, source-linked interactive HTML report using Kimi K3, live web search, and the Agent API.
* [Daily News Digest with LLM Deduplication](https://docs.perplexity.ai/docs/cookbook/articles/news-dedupe-digest/README.md): Build a daily news digest that reports each story once. One Agent API request runs code in the sandbox to fetch the day's news, groups coverage into stories, and delivers the digest and a story registry as files.
* [Daily AI Stock News PDF with Skills](https://docs.perplexity.ai/docs/cookbook/articles/agent-skills/README.md): Generate a daily one-page AI-industry stock news PDF with the Agent API using the built-in office skill and an inline design skill.
* [Model Picker](https://docs.perplexity.ai/docs/cookbook/examples/model-picker/README.md): Describe a task and get a grounded shortlist of open models to use. One Agent API request combines the Hugging Face MCP server with web search to find, verify, and recommend a model.
* [Talent Sourcer](https://docs.perplexity.ai/docs/cookbook/examples/talent-sourcer/README.md): Build a vetted engineer sourcing shortlist with one Agent API request. The model works in a Python sandbox - segmenting the brief, calling people\_search across sub-segments, verifying each candidate's role, location, and tenure with web\_search, collecting GitHub, social, and publication links, scoring and de-duplicating in code, then rendering an HTML shortlist and sharing it with share\_file.
* [Competitor Buzz Tracker](https://docs.perplexity.ai/docs/cookbook/examples/competitor-buzz-tracker/README.md): Turn a basket of searches and keyword rules into a one-page share-of-voice chart (PDF) with two chained Agent API requests. The first searches and counts inside the sandbox and returns a structured-output JSON contract. The second renders the bar chart and shares it as a downloadable file.
* [VC Investment Memo Agent with LangGraph](https://docs.perplexity.ai/docs/cookbook/articles/langchain-vc-memo-agent/README.md): Build an auditable, citation-grounded VC research agent with LangGraph and the Perplexity Agent API, and pick the best search provider with a LangSmith eval harness.
* [Multi-Provider Orchestration](https://docs.perplexity.ai/docs/cookbook/articles/multi-provider-orchestration/README.md): Route between OpenAI, Anthropic, Google, and xAI models through Perplexity's Agent API with transparent pricing, build fallback chains, and compare providers side-by-side
* [Function Calling End-to-End](https://docs.perplexity.ai/docs/cookbook/articles/function-calling-e2e/README.md): Complete multi-turn function calling patterns for the Perplexity Agent API, including orchestration, web search integration, error handling, and parallel calls
* [RAG with Perplexity Embeddings](https://docs.perplexity.ai/docs/cookbook/articles/embeddings-rag/README.md): Build an end-to-end retrieval-augmented generation pipeline using Perplexity's standard and contextualized embedding models.
* [Structured Output Extraction](https://docs.perplexity.ai/docs/cookbook/articles/structured-output-extraction/README.md): Get typed, schema-validated JSON responses from the Agent API using response\_format with JSON schemas for data extraction, pipelines, and structured research
* [Academic and Scholarly Search](https://docs.perplexity.ai/docs/cookbook/articles/academic-search/README.md): Use the Agent API's domain filtering to restrict search to academic sources, extract DOIs and paper metadata, build citation chains, and create research summaries with proper attribution
* [Search Domain Filtering Patterns](https://docs.perplexity.ai/docs/cookbook/articles/search-domain-filtering/README.md): Use search\_domain\_filter for focused search — allowlist patterns for trusted sources, denylist for excluding domains, and practical patterns for news, government, and competitive intelligence
* [Streaming Citation Parsing](https://docs.perplexity.ai/docs/cookbook/articles/streaming-citations/README.md): Consume streaming responses from the Agent API and extract, validate, and display citations in real-time as chunks arrive
* [TypeScript Agent CLI](https://docs.perplexity.ai/docs/cookbook/examples/typescript-agent-cli/README.md): An interactive TypeScript CLI with streaming responses, model selection, and web search using the Perplexity Agent API
* [Agent Research Assistant](https://docs.perplexity.ai/docs/cookbook/examples/agent-research-assistant/README.md): A CLI tool that uses Perplexity's Agent API with the medium effort level to conduct multi-step web research and produce structured reports
* [Multi-Provider Model Comparison](https://docs.perplexity.ai/docs/cookbook/examples/model-comparison/README.md): A CLI tool that sends the same prompt to multiple AI models via Perplexity's Agent API and compares response quality, latency, and cost
* [Search News Monitor](https://docs.perplexity.ai/docs/cookbook/examples/search-news-monitor/README.md): A CLI tool that uses Perplexity's Search API to monitor real-time news across multiple configurable topics with domain and recency filtering
* [Document Q\&A](https://docs.perplexity.ai/docs/cookbook/examples/file-attachment-qa/README.md): Load documents and ask questions about them via the Agent API — text extraction, web search enrichment, multi-turn Q\&A, and structured output extraction
* [Document Q\&A with Embeddings](https://docs.perplexity.ai/docs/cookbook/examples/document-qa/README.md): A self-contained RAG system that ingests documents, generates contextualized embeddings, and answers questions using the Agent API
* [Image Analysis](https://docs.perplexity.ai/docs/cookbook/examples/image-analysis/README.md): Vision-powered image analysis with web search for context-enriched results using the Perplexity Agent API
* [SEC Filing Search](https://docs.perplexity.ai/docs/cookbook/examples/sec-filing-search/README.md): Use search domain filtering to query SEC.gov and EDGAR for financial filings, extract key financial data, and build structured financial summaries
* [Deep Research Workflows](https://docs.perplexity.ai/docs/cookbook/articles/async-deep-research/README.md): Use the Agent API medium effort level for comprehensive, multi-step research tasks — synchronous usage, batch concurrency, result processing, and production patterns
* [Equity Research Brief](https://docs.perplexity.ai/docs/cookbook/examples/equity-research-brief/README.md): Generate institutional-grade equity research briefs from any public ticker using the Perplexity Agent API and the built-in finance\_search tool.
