agentleFS
escapeWuescapeWu/perplexity-ai/.agents/skills/perplexity-search/SKILL.md

perplexity-search

Skill168 starsChanged 2 months agoMITView on GitHub

Search the current public web with citations through either the perplexity-mcp v2 tools or the bundled Python REST client. Use for recent information, news, fact checks, source-backed comparisons, research, file-assisted questions, native follow-ups, and detached tasks. Both transports expose the same perplexity_ask_v2, perplexity_research_v2, and task method names and response shapes.

  • Reads credentials

11 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use deeptools, dnanexus-integration and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • yf8578Skill

    deeptools

    NGS analysis toolkit. BAM to bigWig conversion, QC (correlation, PCA, fingerprints), heatmaps/profiles (TSS, peaks), for ChIP-seq, RNA-seq, ATAC-seq visualization.

    Also in 4 projects that use this

  • yf8578Skill

    dnanexus-integration

    DNAnexus cloud genomics platform. Build apps/applets, manage data (upload/download), dxpy Python SDK, run workflows, FASTQ/BAM/VCF, for genomics pipeline development and execution.

    Also in 4 projects that use this

  • ZanderRussSkill

    scientific-brainstorming

    Research ideation partner. Generate hypotheses, explore interdisciplinary connections, challenge assumptions, develop methodologies, identify research gaps, for creative scientific problem-solving.

    Also in 5 projects that use this

  • +9 more from yf8578

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 3 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 10 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Use one workflow regardless of transport.

    line 10
  2. Distinctive:

    Never print, quote, log, or commit real credentials.

    line 47
  3. Very specific:

    Use perplexity_ask_v2 for current facts, news, comparisons, source-backed analysis, and ordinary searches.

    line 51
  4. Very specific:

    Use perplexity_research_v2 for broad investigations with several subtopics, many sources, or report-like synthesis.

    line 77
  5. Very specific:

    Check status before using a result.

    line 107
  6. Distinctive:

    Keep the session ID with its operation family.

    line 132
  7. Distinctive:

    Use detached tasks only when work must survive caller disconnects, is expected to run for a long time, or consists of independent …

    line 156

“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Perplexity Search

Use one workflow regardless of transport. A connected perplexity-mcp server exposes tools directly; the bundled scripts/client.py exposes matching Python methods over REST.

OperationMCP toolPython REST method
Focused search or cited answerperplexity_ask_v2client.perplexity_ask_v2(...)
Broad Deep Researchperplexity_research_v2client.perplexity_research_v2(...)
Submit detached workperplexity_task_submitclient.perplexity_task_submit(...)
Observe detached workperplexity_task_statusclient.perplexity_task_status(...)
Cancel detached workperplexity_task_cancelclient.perplexity_task_cancel(...)

Choose the available transport, then keep the same operation names, arguments, session rules, and output handling. Do not switch to legacy MCP tools such as search, research, or perplexity_search; they are deprecated.

Python REST client

The client uses only the Python standard library. Load it from this skill's scripts directory:

import sys
from pathlib import Path

skill_dir = Path(".agents/skills/perplexity-search").resolve()
sys.path.insert(0, str(skill_dir / "scripts"))

from client import PerplexityRestClient

client = PerplexityRestClient.from_config(skill_dir / "config.json")
result = client.perplexity_ask_v2(
    "What changed in Python packaging this month? Cite primary sources."
)

Configuration is shared by every REST method:

  • PPLX_BASE_URL: service root, with or without /v1; defaults to http://127.0.0.1:8000.
  • MCP_TOKEN or PPLX_API_KEY: bearer token; MCP_TOKEN takes precedence.
  • config.json: fallback configuration when environment variables are absent.

Never print, quote, log, or commit real credentials.

Focused Ask

Use perplexity_ask_v2 for current facts, news, comparisons, source-backed analysis, and ordinary searches.

MCP arguments and Python arguments are identical:

{
  "query": "Compare the latest Python packaging changes and cite primary sources.",
  "model": "gpt-5-6-terra",
  "thinking": true,
  "session_id": null,
  "files": null
}
result = client.perplexity_ask_v2(
    query="Compare the latest Python packaging changes and cite primary sources.",
    model="gpt-5-6-terra",
    thinking=True,
)

Omit model to use perplexity-search. When selecting a model, pass the exact OAI model ID exposed by the server. Set thinking=True to select its paired thinking variant. Do not pass perplexity-deepsearch to Ask.

Deep Research

Use perplexity_research_v2 for broad investigations with several subtopics, many sources, or report-like synthesis.

result = client.perplexity_research_v2(
    query=(
        "Research the 2026 enterprise AI agent market. Compare adoption, pricing, "
        "security constraints, and primary-source evidence."
    )
)

This operation always selects perplexity-deepsearch; it does not accept model or thinking.

Response contract

Both transports return the same success shape for Ask and Research:

{
  "status": "ok",
  "session_id": "sess_...",
  "job_id": "job_...",
  "model": "perplexity-search",
  "data": {
    "answer": "...",
    "sources": []
  }
}

Check status before using a result. Read the answer from data.answer, preserve direct URLs from data.sources, and distinguish sourced facts from your synthesis.

Failures use the same top-level convention:

{
  "status": "error",
  "error_type": "...",
  "message": "..."
}

Report the non-secret error type and message. Do not silently change models, replace sessions, or treat incomplete task output as success.

Sessions

Omit session_id to create a native session. For a same-topic follow-up, call the same operation with the returned ID and only the latest instruction:

follow_up = client.perplexity_ask_v2(
    query="Add exact release dates and one primary source per claim.",
    session_id=result["session_id"],
)

Keep the session ID with its operation family. Start a new session when the topic changes. A session is permanently bound to its first account and supports at most one unfinished task; it does not fail over or accept concurrent turns.

Files

Pass attachments through files on either Ask, Research, or task submission.

For MCP, files follows the server tool schema. For Python REST, use either a filename-to-content mapping or an iterable of local paths:

client.perplexity_ask_v2(
    "Summarize the attached evidence and verify current claims on the web.",
    files=["reports/evidence.pdf"],
)

client.perplexity_ask_v2(
    "Review this note.",
    files={"note.txt": "local text content"},
)

The REST client reads local paths and sends base64 input_file content, so the remote server does not need access to the client's filesystem. Respect server limits: at most 10 files, 20 MiB per file, 100 MiB per request, and allowed extensions.

Detached tasks

Use detached tasks only when work must survive caller disconnects, is expected to run for a long time, or consists of independent concurrent conversations.

MCP users should call get_skill_index and read get_tasks_use before the task tools. Python users call the same task operations through REST:

accepted = client.perplexity_task_submit(
    query="Research WebAssembly component model adoption with primary sources.",
    model="perplexity-deepsearch",
    idempotency_key="wasm-adoption-1",
)

status = client.perplexity_task_status(
    accepted["job_id"],
    wait_seconds=20,
    include_output=False,
)

A successful submission means admission, not completion. Retain both job_id and session_id. Only state == "completed" is complete. Fetch output with include_output=True; the answer is in snapshot.answer. Treat failed, timed_out, cancelled, and interrupted as non-success even when a draft exists.

Reuse an idempotency_key only to recover the same submission after a lost receipt. Use a different session for each concurrent task. Cancel explicitly when the task is no longer needed:

client.perplexity_task_cancel(accepted["job_id"])

Cancellation cannot undo upstream work already accepted.

Command line

The CLI uses the exact MCP tool names:

python3 "$SKILL_DIR/scripts/client.py" perplexity_ask_v2 \
  "What changed this week? Cite primary sources."

python3 "$SKILL_DIR/scripts/client.py" perplexity_research_v2 \
  "Research current enterprise AI agent adoption."

python3 "$SKILL_DIR/scripts/client.py" perplexity_task_status job_... \
  --wait-seconds 20

cli.py remains a compatibility entry point and dispatches to the same client. Use client.py for new integrations.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.