perplexity-architecture-variants

Featured

Choose and implement Perplexity architecture blueprints for different scales: direct search widget, cached research layer, and multi-query pipeline. Trigger with phrases like "perplexity architecture", "perplexity blueprint", "how to structure perplexity", "perplexity project layout".

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 Architecture Variants ## Overview Three validated architectures for Perplexity Sonar API at different scales. Each builds on the previous, adding caching and orchestration as volume grows. ## Decision Matrix | Factor | Direct Widget | Cached Layer | Research Pipeline | |--------|--------------|--------------|-------------------| | Volume | <500/day | 500-5K/day | 5K+/day | | Latency (p50) | 2-5s | 50ms (cached) / 2-5s (miss) | 10-30s | | Model | `sonar` | `sonar` + cache | `sonar` + `sonar-pro` | | Monthly Cost | <$150 | $50-$300 | $300+ | | Complexity | Minimal | Moderate | High | ## Instructions ### Variant 1: Direct Search Widget (<500 queries/day) Best for: Adding AI search to an existing app. No cache needed at this scale. ```typescript // Simple endpoint — add to any Express/Next.js app import OpenAI from "openai"; const perplexity = new OpenAI({ apiKey: process.env.PERPLEXITY_API_KEY!, baseURL: "https://api.perplexity.ai", }); app.post("/api/search", async (req, res) => { try { const response = await perplexity.chat.completions.create({ model: "sonar", messages: [{ role: "user", content: req.body.query }], max_tokens: 1024, }); res.json({ answer: response.choices[0].message.content, citations: (response as any).citations || [], }); } catch (err: any) { if (err.status === 429) { res.status(429).json({ error: "Rate limited. Try again shortly." }); } else { res.status(500).jso...

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

AI & Automation Featured

perplexity-reference-architecture

Implement Perplexity reference architecture with model routing, citation pipeline, and research automation. Use when designing new Perplexity integrations, reviewing project structure, or establishing architecture for search-augmented apps. Trigger with phrases like "perplexity architecture", "perplexity project structure", "how to organize perplexity", "perplexity design patterns".

2,266 Updated today
jeremylongshore
AI & Automation Featured

perplexity-performance-tuning

Optimize Perplexity Sonar API performance with caching, streaming, model routing, and batching. Use when experiencing slow API responses, implementing caching strategies, or optimizing request throughput for Perplexity integrations. Trigger with phrases like "perplexity performance", "optimize perplexity", "perplexity latency", "perplexity caching", "perplexity slow".

2,266 Updated today
jeremylongshore
AI & Automation Featured

perplexity-core-workflow-b

Execute Perplexity multi-turn research sessions and batch query pipelines. Use when conducting in-depth investigations, generating research briefs, or processing multiple related search queries. Trigger with phrases like "perplexity research", "perplexity batch search", "multi-query perplexity", "perplexity deep dive", "perplexity report".

2,266 Updated today
jeremylongshore
AI & Automation Featured

perplexity-observability

Set up monitoring for Perplexity Sonar API with latency, cost, citation quality, and error tracking. Use when implementing monitoring dashboards, setting up alerts, or tracking Perplexity API health in production. Trigger with phrases like "perplexity monitoring", "perplexity metrics", "perplexity observability", "monitor perplexity", "perplexity dashboard".

2,266 Updated today
jeremylongshore
AI & Automation Featured

perplexity-reliability-patterns

Implement reliability patterns for Perplexity Sonar API: circuit breaker, model fallback, streaming timeout, and citation validation. Trigger with phrases like "perplexity reliability", "perplexity circuit breaker", "perplexity fallback", "perplexity resilience", "perplexity timeout".

2,266 Updated today
jeremylongshore