mirror of
https://github.com/IgorWarzocha/Opencode-Workflows.git
synced 2026-09-14 16:22:53 +08:00
2.2 KiB
2.2 KiB
description
| description |
|---|
| Run Perplexica searches with smart mode selection and structured citations |
Arguments
$ARGUMENTScontains the full natural-language query (context + desired outcome).- If
$ARGUMENTSis empty or unclear, ask the user to restate the question.
CRITICAL – follow these steps exactly
Steps
- Parse the user request and restate the research goal (topic + desired output).
- Choose the best Perplexica focus mode:
webSearch– general news or mixed sourcesacademicSearch– research papers, reports, datawritingAssistant– drafting or outlining contentredditSearch– community sentiment or discussionsyoutubeSearch– video explainers or walkthroughswolframAlphaSearch– factual calculations or reference data
- Execute the query exclusively through the CLI:
node Scripts/perplexica-cli.js "$QUERY" --mode $FOCUS_MODE- The CLI builds the payload, enforces a 300s timeout, and returns JSON with
message(summary) andsources(title + URL).
- The CLI builds the payload, enforces a 300s timeout, and returns JSON with
- Parse the CLI output:
- Extract the primary answer from
message. - Collect each source title and URL from
sources. - Capture the reported runtime (printed by the CLI).
- Extract the primary answer from
- Produce the final response:
- 2–3 sentence summary covering the main findings.
- Bullet list of the top sources with titles + URLs.
- Mention number of sources, focus mode, and elapsed time.
Query optimization tips
- Add “latest” or “recent” for up-to-date info.
- Use “how to” for procedural queries.
- Add “comparison”/“vs” for trade-off analysis.
- Use “analysis” or “report” for deep dives.
Sample queries
- “What are the latest NIST controls for AI supply-chain security audits?”
- “How do open-weight LLMs reduce compliance inference costs in 2025 enterprise workloads?”
- “Which newly approved NASA missions will monitor solar storms over the next decade?”
Error handling
- If a specialized mode fails, retry with
webSearch. - Confirm the Perplexica endpoint (default
http://localhost:3000/api/search). - The CLI already retries on transient failures; only rerun if it exits with an error.
Output: Summary paragraph followed by a numbered source list and search metadata.