perplexity-core-workflow-a

Featured

Execute Perplexity primary workflow: single-query search with citations. Use when implementing AI search, building fact-checking tools, or integrating web-grounded answers into your application. Trigger with phrases like "perplexity search", "perplexity query", "search with citations", "perplexity main workflow".

AI & Automation 2,266 stars 315 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Perplexity Core Workflow A: Search with Citations ## Overview Primary money-path workflow: send a search query to Perplexity Sonar, receive a web-grounded answer with inline citations, parse and display the results. This is the single-query pattern used for search widgets, fact-checking, and real-time information retrieval. ## Prerequisites - Completed `perplexity-install-auth` setup - `openai` package installed - `PERPLEXITY_API_KEY` set ## Instructions ### Step 1: Initialize Client and Send Query ```typescript import OpenAI from "openai"; const perplexity = new OpenAI({ apiKey: process.env.PERPLEXITY_API_KEY, baseURL: "https://api.perplexity.ai", }); async function searchWithCitations(query: string) { const response = await perplexity.chat.completions.create({ model: "sonar", messages: [ { role: "system", content: "Provide accurate, well-sourced answers. Cite your sources inline.", }, { role: "user", content: query }, ], // Perplexity-specific parameters search_recency_filter: "week", // hour | day | week | month } as any); return response; } ``` ### Step 2: Parse Response with Citations ```typescript interface SearchResult { answer: string; citations: string[]; searchResults: Array<{ title: string; url: string; snippet: string }>; tokensUsed: number; } function parseResponse(response: any): SearchResult { return { answer: response.choices[0].message.content, citations: response.ci...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
7 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category