name: atomic_research
你可以通过联网搜索工具 search_posts 获取来自 Github、小红书、微信公众号、知乎等渠道的信息。对于需要深度交互的网页内容,使用浏览器工具进行操作。
goal 工具管理搜索的过程,或者使用文档记录搜索的中间或最终结果。(可以着重参考browser的工具来辅助搜索)Step 1: 拆解搜索维度
goal(add="搜索工具, 搜索案例, 搜索方法论")
Step 2: 多维度搜索
search_posts(query="PDF table extraction tool")search_posts(query="PDF table extraction usercase site:github.com")search_posts(query="PDF table extraction definition")search_posts(query="PDF table extraction best practice")Step 3: 结构化记录 每发现一条有价值的信息,立即保存为结构化知识:
knowledge_save(
task="在什么情景下,要完成什么目标,得到能达成一个什么结果",
content="这条知识实际的核心内容",
types=["tool"], # tool/usecase/definition/plan/strategy/user_profile
urls=["参考的论文/github/博客等"],
agent_id="当前 agent ID",
score=5
)
Step 4: 输出知识列表
goal(done="已完成调研,共记录 N 条知识")
.cache/knowledge_atoms/ 目录,每条知识一个 JSON 文件atom-YYYYMMDD-HHMMSS-XXXX.json每条知识原子包含以下字段:
格式:atom-YYYYMMDD-NNN
示例:atom-20260302-001
单条知识可以包含多个标签:
| 类型 | 说明 | 示例 |
|---|---|---|
| tool | 工具相关信息,包含使用案例和使用方法 | pdfplumber 库的使用方法 |
| usercase | 针对任务的用户案例,某个用户完成任务的方法 | 某用户如何提取 PDF 表格的完整流程 |
| definition | 内容的具体定义,或任务的问题定义 | 什么是 PDF 表格提取,有哪些技术挑战 |
| plan | 完成任务的通用计划、方法论或流程 | PDF 表格提取的标准流程和最佳实践 |
格式:在 [情景] 下,完成 [目标],得到 [预期结果]。
示例:
在 Python 3.11 环境下,需要从结构复杂的 PDF(包含多列、嵌套表格)中提取表格数据,
并保留单元格坐标信息,最终得到可用于数据分析的结构化数据。
这条知识实际的核心内容,使用 Markdown 格式,根据类型不同包含不同信息:
tool 类型:
usercase 类型:
definition 类型:
plan 类型:
⚠️ 具体的避坑指南或核心建议。
示例:
⚠️ 如果 PDF 包含隐形表格线,务必开启 explicit_horizontal_lines 参数
⚠️ 使用 page.crop() 先裁剪区域再提取,可提升 3-5 倍速度
包含:
urls: 参考的论文、GitHub、博客等(URL 列表)agent_id: 执行此调研的 agent IDtimestamp: 记录时间示例:
{
"urls": ["https://github.com/jsvine/pdfplumber"],
"agent_id": "research_agent_001",
"timestamp": "2026-03-02T12:45:41Z"
}
包含:
helpful: 好用的使用次数(初始值为 1)harmful: 不好用的使用次数(初始值为 0)示例:
{
"helpful": 1,
"harmful": 0
}
包含:
helpful: 好用的使用案例描述列表(字符串数组,初始为空)harmful: 不好用的使用案例描述列表(字符串数组,初始为空)示例:
{
"helpful": [],
"harmful": []
}
{
"research_report": {
"goal": "找到 PDF 表格提取的最佳方案",
"task": "从复杂 PDF 中提取表格数据",
"summary": "共记录 3 条核心知识原子,涵盖工具选型与实战 SOP",
"atoms": [
{
"id": "atom-20260302-001",
"tags": ["tool", "plan", "usercase"],
"summary": "在 Python 3.11 环境下,从结构复杂的 PDF(包含多列、嵌套表格)中提取表格数据,并保留单元格坐标信息,最终得到可用于数据分析的结构化数据。",
"content": "## 推荐工具\npdfplumber - 专注于 PDF 表格提取\n\n## 核心 API\n使用 extract_tables() 方法\n\n## 代码示例\n```python\nimport pdfplumber\nwith pdfplumber.open('file.pdf') as pdf:\n tables = pdf.pages[0].extract_tables()\n```",
"tips": "⚠️ 如果 PDF 包含隐形表格线,务必开启 explicit_horizontal_lines 参数\n⚠️ 使用 page.crop() 先裁剪区域再提取,可提升 3-5 倍速度",
"trace": {
"urls": ["https://github.com/jsvine/pdfplumber"],
"agent_id": "research_agent_001",
"timestamp": "2026-03-02T12:45:41Z"
},
"eval": {
"helpful": 1,
"harmful": 0
},
"execute_history": {
"helpful": [],
"harmful": []
}
},
{
"id": "atom-20260302-002",
"tags": ["usercase"],
"summary": "针对 500MB 以上的大型扫描版 PDF 进行自动化处理。",
"content": "使用纯 Python 库(如 pdfplumber/PyMuPDF)性能极差且准确率低。",
"tips": "建议方案:先使用 PaddleOCR 进行版面分析,再提取坐标区域。",
"trace": {
"urls": ["https://reddit.com/r/python/comments/..."],
"agent_id": "research_agent_01",
"timestamp": "2026-03-02T13:00:00Z"
},
"eval": {
"helpful": 1,
"harmful": 0
},
"execute_history": {
"helpful": [],
"harmful": []
}
}
]
}
}
knowledge_save(
task="在 Python 3.11 环境下,从复杂 PDF 中提取表格数据,并保留单元格坐标信息。",
content="""
## 推荐工具
pdfplumber - 专注于 PDF 表格提取
## 核心 API
使用 extract_tables() 方法
## 代码示例
```python
import pdfplumber
with pdfplumber.open('file.pdf') as pdf:
tables = pdf.pages[0].extract_tables()
```
⚠️ 必须设置 explicit_horizontal_lines=True 以识别隐形表格线
""",
types=["tool", "plan"],
urls=["https://github.com/jsvine/pdfplumber"],
agent_id="research_agent_001",
score=5
)
knowledge_update(
knowledge_id="knowledge-20260302-001",
add_helpful_case={
"description": "在解析 2025 年报 PDF 时,通过配置 explicit_lines 成功提取了 100+ 嵌套表格。",
"trace_id": "trace-xxx"
}
)
或添加失败案例:
knowledge_update(
knowledge_id="knowledge-20260302-001",
add_harmful_case={
"description": "在处理 300MB 的扫描版 PDF 时,该方案因缺乏 OCR 能力导致提取结果为空。",
"trace_id": "trace-xxx"
}
)
搜索关键词:
[任务] tool python[任务] library comparison[任务] vs site:reddit.com记录重点:
搜索关键词:
[任务] example site:github.com[任务] tutorialhow to [任务]记录重点:
搜索关键词:
what is [任务][任务] definition[任务] explained记录重点:
搜索关键词:
[任务] best practice[任务] workflow[任务] step by step记录重点:
调研完成后,输出知识列表摘要:
📚 调研完成报告
目标:找到 PDF 表格提取的最佳方案
任务:从复杂 PDF 中提取表格数据
共记录 5 条知识:
1. [tool] pdfplumber - PDF 表格提取工具
评分:⭐⭐⭐⭐⭐ (5/5)
反馈:helpful: 1, harmful: 0
2. [usercase] 财报 PDF 表格提取案例
评分:⭐⭐⭐⭐ (4/5)
反馈:helpful: 1, harmful: 0
3. [definition] PDF 表格提取技术原理
评分:⭐⭐⭐⭐ (4/5)
反馈:helpful: 1, harmful: 0
4. [plan] PDF 表格提取标准流程
评分:⭐⭐⭐⭐⭐ (5/5)
反馈:helpful: 1, harmful: 0
5. [tool] tabula-py - 替代方案
评分:⭐⭐⭐ (3/5)
反馈:helpful: 1, harmful: 0
知识文件保存在:.cache/knowledge_atoms/