mcpField
P
perplexity-research

perplexity-research

github.com/garrytan生产力31.3k204 次安装今天更新
代码仓库

关于 perplexity-research

perplexity-research 是一项用于网络研究的 Agent 技能,将 Perplexity 搜索与综合能力结合已有的脑库知识。它依据提供的上下文聚焦新信息,并要求使用可核实的引用。

主要功能

  1. 01在 Perplexity 查询中加入脑库上下文
  2. 02搜索并综合网页来源
  3. 03聚焦已有知识之外的信息
  4. 04设置时效筛选条件
  5. 05将带引用的研究保存为脑库页面

适用场景

  1. 01结合已有背景研究某个主题
  2. 02为人物或公司页面补充最新信息
  3. 03监测交易或公司的新闻
  4. 04制作简报并避免重复已知内容

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/garrytan/gbrain --skill perplexity-research

安装后在 Claude Code 中输入/perplexity-research确认已加载。

附带文件routing-eval.jsonl

详细介绍

perplexity-research — 结合大脑知识的网络研究

约定: 引用规则见 conventions/quality.md; 每一条来自网络研究的论断都必须附带可验证的引用,而不是转述。

约定: 查找链见 conventions/brain-first.md。 本 skill 通过将大脑上下文作为 Perplexity 提示词的一部分来强制执行“大脑优先”, 网络搜索会聚焦于大脑知识与当前网络状态之间的差异。

功能说明

将现有的大脑知识与 Perplexity 的网络搜索相结合。Agent 将某个主题的大脑上下文 发送到 Perplexity 查询中;Perplexity 会搜索、阅读并综合多个网页,附带引用, 并聚焦于相对于所提供上下文的新内容。

核心洞察: Perplexity 不只是搜索,它还会阅读并附带引用地综合内容。通过在指令中 发送大脑上下文,它就知道你已经了解什么,因此会呈现差异部分,而不是重复已确定的事实。

何时使用本工具而非其他工具

需求使用
带引用的深度研究本 skill — Perplexity + Opus
快速获取 URL 内容web_fetch
仅查询大脑gbrain query / gbrain search
实时社交媒体监控外部 X / 社交媒体采集器
对跟踪表进行结构化数据查询skills/data-research/SKILL.md

输出结构

研究结果会以大脑页面的形式保存在 research/<slug>.md 下,结构如下:

---
title: "[Topic] — Research [YYYY-MM-DD]"
type: research
date: YYYY-MM-DD
brain_context_slugs: ["pages whose context was sent to Perplexity"]
recency_filter: "[hour|day|week|month|none]"
---

# [Topic] — Research [YYYY-MM-DD]

> Executive summary: 2-3 sentences on the delta between brain knowledge
> and current web state.

## Key New Developments
What's changed since the brain was last updated on this topic.

## Confirming Signals
Web evidence validating existing brain knowledge.

## Contradictions or Updates
Things that conflict with the brain — these need a closer look.

## Recommended Brain Updates
Specific page updates the user might want to make based on this research.
Each item: which page, what to add or change, source URL.

## Citations
- [Source title](URL) — accessed YYYY-MM-DD
- [Source title](URL) — accessed YYYY-MM-DD
- ...

调用方式

本 skill 是 Markdown 格式的 Agent 指令;Agent 直接使用 Perplexity 的 API (或宿主提供的 perplexity 命令行工具,若已安装):

# 1. Pull brain context
gbrain get <slug>                    # or
gbrain query "<topic keywords>"

# 2. Compose the Perplexity query with brain context inline:
#    """
#    Topic: <topic>
#    Brain context (what we already know): <embedded gbrain content>
#    Find: what's NEW since 2026-MM-DD that the brain doesn't reflect.
#    Cite every claim.
#    """

# 3. Call Perplexity's Agent API (or the host's perplexity binary). The
#    Sonar chat-completions endpoint (/chat/completions with
#    "model": "sonar-pro") is being retired and refuses migrated accounts
#    with 403 agent_api_migration_required; use POST /v1/agent:
#    curl https://api.perplexity.ai/v1/agent \
#      -H "Authorization: Bearer $PERPLEXITY_API_KEY" \
#      -H "Content-Type: application/json" \
#      -d '{"preset": "low", "instructions": "Cite every claim.", "input": "..."}'
#    Read the answer from the output item with "type": "message" (SDKs
#    expose it as output_text) and the citations from the search results
#    in the output array; inline [n] markers refer to them.

# 4. Write the structured research page via put_page:
gbrain put research/<slug>      # via the put_page operation

# 5. Cross-link entities mentioned (people, companies) per Iron Law.

预设

Agent API 预设替代适用场景
"preset": "low"Sonar Pro深度分析、实体信息补充、交易研究(多步搜索)
"preset": "fast"Sonar快速查询、批量监控、简报流水线

默认使用 low。在批量或定时任务场景中,若成本比深度更重要,则改用 fast。 Perplexity 未公布预设的固定单次请求价格;运行批量任务前请查看其定价页面。

集成模式

实体信息补充

当实体页面(人物、公司)需要当前网络上下文时,由 skills/enrich/SKILL.md 调用:

BRAIN=$(gbrain get people/<slug> 2>/dev/null)
# Send <slug>'s page content as brain_context to Perplexity, get current
# news / role / context, then update the brain page with what's new.
交易 / 公司监控(定时任务)

对 deals/ 或 companies/ 下每个活跃条目:

# Weekly: pull recent news per company; flag changes for review.
晨间简报

在简报流水线中,用本 skill 替换原始的 web_fetch 调用, 使 Agent 不会重复叙述已知事实。

时效过滤

在网络搜索工具上传入时效过滤器: "tools": [{"type": "web_search", "filters": {"search_recency_filter": "week"}}], 可选值为 hour | day | week | month | year。适用于新闻周期类主题; 对于常青型研究可省略。请将该值记录为页面 frontmatter 中的 recency_filter。

失败处理

对于任何 gbrain 错误 code、退出码、[AGENT] 块或提示块,请遵循 Agent 操作协议。本 skill 的具体情况如下:

  • PERPLEXITY_API_KEY 缺失或被拒绝:告知用户网络部分无法运行;仅根据大脑作答,并说明这一点。
  • rate_limited:按照提示的延迟时间重试;批量工作时改用更便宜的模型,而不是持续循环。
  • 大脑上下文搜索为空且带有降级提示:“什么是新的、大脑已知什么”的差异比对不可靠;需说明大脑端仅使用了关键词搜索。

反模式

  • ❌ 不发送任何大脑上下文。那样它就只是普通搜索——应改用 web_fetch。
  • ❌ 截断大脑上下文。整个方法的核心在于“知道你已经知道什么”。应发送密集的上下文。
  • ❌ 丢弃引用。输出中的每一条论断都必须附带 URL。
  • ❌ 提及实体时跳过交叉链接步骤。这是铁律。

环境

  • 在 Agent 的环境中设置 PERPLEXITY_API_KEY(或在 ~/.gbrain/.env 中设置)。
  • 可选:安装 Perplexity 官方命令行工具,以获得更丰富的流式输出。

相关 Skills

  • skills/academic-verify/SKILL.md — 封装 perplexity-research,用于带引用验证的学术论断核查
  • skills/enrich/SKILL.md — 在实体丰富循环中调用 perplexity-research
  • skills/data-research/SKILL.md — 结构化数据追踪器(形式不同:参数化 YAML 配方,而非自由格式的研究)

约定

本 Skill 保证:

  • 路由与 frontmatter 中的规范触发词一致。
  • 输出写入 writes_to: 中列出的目录(如适用)。
  • 所引用的约定(quality.md、brain-first.md、_brain-filing-rules.md)得到遵循。
  • 隐私约定得到保持:不包含真实姓名、不包含特定分支的文件系统路径字面量,也不引用上游分支。

完整的行为约定记录在上方正文各节中;本节仅为一致性测试而存在。

输出格式

本 Skill 的输出结构已在正文各节中内联说明(参见"Output"、"Brain page format"或同类章节)。此处的章节标题仅为一致性测试(test/skills-conformance.test.ts)而存在。

评论

支持 Markdown