PDF RAG 智能问答助手
第 6 部分 · 案例 1.2 · 🤖 AI 助手
难度 🟡 中等 · 耗时 ~40 分钟 · 核心节点 Vector Store Tool × Pinecone × Embeddings
这是 5.5 节 RAG 实战的”查询端”完整 workflow。把它跟 5.5 节的”建索引端” workflow 配对就能搭出企业级 PDF 问答助手。
- 公司有一本 200 页员工手册,新人提问总要翻
- 把手册灌进 Pinecone,做个”手册问答机器人”
- 跟 Telegram AI Bot 结合可以做内部 Slack/Telegram 智能客服
前置:先按 5.5 节 Ingest workflow 把 PDF 切块写入 Pinecone index my-knowledge-base。
🔍 工作流连线图
Section titled “🔍 工作流连线图” ▦ workflow pdf-rag-assistant.workflow.json Lv.2
注意这是 3 层挂载:
- AI Agent ← Vector Store Tool ← Pinecone ← OpenAI Embeddings
📋 关键节点配置
Section titled “📋 关键节点配置”AI Agent
Section titled “AI Agent” ⚙ agent-config.txt
Prompt: ={{ $json.chatInput }}
System Message:
你是文档智能助手。必须先用 knowledge_search 工具检索原文,
再综合回答。引用时标注 [文档 §X]。
找不到就说 "知识库无此内容",不要捏造。
Temperature: 0.3 (确保稳定)
Vector Store Tool(重点)
Section titled “Vector Store Tool(重点)” ⚙ vstore-tool.txt
Name: knowledge_search
Description: 按用户问题搜索 PDF 知识库,返回最相关的 3 段原文
⚠ Description 是 LLM 决策依据,写不清 Agent 不会调它
Pinecone (Retrieve)
Section titled “Pinecone (Retrieve)” ⚙ pinecone-retrieve.txt
Pinecone Index: my-knowledge-base
Top K: 3
挂载的 Embeddings: OpenAI Embeddings (text-embedding-3-small)
⚠ 必须跟 Ingest 时用的 Embeddings 模型完全一致
📥 一键复制 Workflow JSON
Section titled “📥 一键复制 Workflow JSON” 📋 pdf-rag-assistant.workflow.json