Discover

From Lambenthan/empiricalwiki · View interactive version

Discover is an AI agent skill from the GitHub repository Lambenthan/empiricalwiki. 基于 anchor 论文、topic 关键词或当前 wiki 状态,产出一份排好序的候选论文 shortlist,供用户或上游 skill 决定是否进一步 `/ingest`。当用户问 "接下来该读什么"、"找和这篇相似的论文"、"推荐相关工作"、"这个方向周围有什么" 时触发;`/ingest --discover` 也会内部调用本 skill。本身不 ingest,只提出候选。

How to use this skill

Skill file

/discover

从三种 seed 模式之一产出一份排好序的候选论文 shortlist,附带每条候选的 rationale,呈现给用户或调用方 skill。/discover 绝不自动 ingest —— 它只负责提出候选,实际动作由 /ingest 负责。

按需打开下列本地参考文件:

Inputs

--anchor、--topic、--from-wiki 三者必须恰好选一。

Outputs

/discover 除了 log.md 外不向 wiki/ 写入任何内容,也不触碰 raw/。是否把候选拉进 wiki 是调用方的决定(之后的 /ingest)。

Wiki Interaction

Reads

Writes

Graph edges created

Workflow

前置条件:工作目录包含 wiki/、raw/、tools/。一次解析 Python 解释器路径并复用:

if [ -x .venv/bin/python ]; then
  PYTHON_BIN=.venv/bin/python
elif [ -x .venv/Scripts/python.exe ]; then
  PYTHON_BIN=.venv/Scripts/python.exe
else
  PYTHON_BIN=python3
fi
export PYTHON_BIN

Step 1: 选定 seed 模式

把用户请求映射到 from-anchors、from-topic 或 from-wiki 之一。决策规则见 references/seed-modes.md,简版:

如果用户同时提到 "不要这些",在 anchor 模式下通过 --negative 传入。

Step 2: 运行 discovery 工具

"$PYTHON_BIN" tools/discover.py from-anchors \
  --id <arxiv-id> [--id <arxiv-id>...] [--negative <id>...] \
  --wiki-root wiki \
  --limit 10 \
  --output-checkpoint .checkpoints/ \
  --markdown

或 topic / wiki 模式:

"$PYTHON_BIN" tools/discover.py from-topic "<query>" --wiki-root wiki --limit 10 --output-checkpoint .checkpoints/ --markdown
"$PYTHON_BIN" tools/discover.py from-wiki --wiki-root wiki --limit 10 --output-checkpoint .checkpoints/ --markdown

anchor(与 wiki)模式每个 anchor 默认跑三个 S2 通道 —— recommend + references + citations。这正是 /discover 明显区别于 /daily-arxiv 的关键:references 带进 anchor 站在其肩膀上的 canonical 老论文,citations 带进高影响后续工作。只有在 API 成本成为硬约束时才考虑 --no-citation-expand 退回到只跑 recommend —— 质量退化会很明显。

工具内部处理候选抓取、wiki dedup、ranking,并写 checkpoint。始终传 --wiki-root wiki,否则已 ingest 论文会继续出现在 shortlist 中,浪费用户 review 时间。

topic 模式下若 S2 不可用,工具会继续用可用的通道产出;检查输出并向用户说明 degraded discovery。若全部通道失败,需明确报错而不是把空 shortlist 当作真实推荐返回。

Step 3: 展示 shortlist

把 markdown 输出呈现给用户。每条候选要能让用户判断是否值得 ingest:

最后附一行 "next step" 提示:

如需 ingest:/ingest https://arxiv.org/abs/<arxiv-id>

不要自行 ingest。选择权归用户。

Step 4: 日志

"$PYTHON_BIN" tools/research_wiki.py log wiki "discover | mode=<anchors|topic|wiki> | seed=<short-desc> | shortlist=<N>"

Internal Callers

/discover 既供用户手动调用,也供其他 skill 作为子例程调用。

来自 `/ingest --discover`

/ingest 支持可选的 --discover flag(默认关闭)。开启时,/ingest 在最终 report 之后以刚 ingest 论文的 arXiv ID 作为单 anchor 调用 /discover,并把 shortlist 以 "接下来可能想 ingest 的相关论文" 段落附在 report 里。/ingest 不会从这份列表自动 ingest 任何东西。

来自 `/init`

/init 不调用 /discover。/init 的 planner(tools/init_discovery.py plan)有自己的打分策略,偏爱 survey、广覆盖、seed anchor —— 适合 bootstrap 场景。/discover 的 ranking 有意不同(不偏 survey;以 anchor 相似度 + influential citations 为主),替换进 /init 会稀释 shortlist 质量。两者保持独立。

Constraints

Error Handling

Dependencies

Tools(via Bash)

Skills

External APIs

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.