微信扫码
添加专属顾问
我要投稿
PlanRAG技术:它通过两个主要的推理类型来回答问题:首先是制定计划,其次是基于检索结果的推理。PlanRAG技术的核心在于,它使用单个语言模型来执行这两种类型的推理,以减少使用不同语言模型可能带来的副作用。
PlanRAG的推理过程:PlanRAG的推理过程包括三个主要步骤:
规划(Planning):语言模型接收决策问题、数据库架构和业务规则作为输入,生成一个初始的数据分析计划。
检索与回答(Retrieving & Answering):与之前的RAG技术不同,PlanRAG在这一步骤中不仅考虑问题和规则,还包括初始计划,以更有效地生成数据分析查询。
重新规划(Re-planning):如果初始计划不足以解决问题,PlanRAG会根据每次检索的结果评估当前计划,并生成新的计划或纠正先前分析的方向。
在定位场景中,先前的迭代RAG与PlanRAG 推理过程的示例
IterRAG-LM和PlanRAGLM 在简单回答(SR)和多步回答(MR)问题上的准确率(%)
# PrefixYou are a decision-making agent answering a given question.You should collect the data to answer the question:# Tool descriptionsGraph DB: Useful for when you need to collect the data thatfollows the following schema (You MUST generate a Cypher querystatement to interact with this tool):(n:Trade_node {{name, local_value, is_inland, total_power,outgoing, ingoing}});(m:Country {{name, home_node, development}});(Trade_node)-[r:source {{flow}}]->[Trade_node](Country)-[NodeCountry{{is_home,has_merchant,base_trading_power,calculated_trading_power}}]->(Trade_node), args: {{{{'tool_input': {{{{'type': 'string'}}}}}}}}Self thinking: Useful for when there is no available tool., args:{{{{'tool_input': {{{{'type': 'string'}}}}}}}}# Format instructionsUse the following Strict format:Question: the input question you must answer.Thought: you should always think about what to do.Action: a suitable database name, MUST be one of [‘Graph DB’,‘Self-thinking’].Action input: a syntactically correct query statement only, MUSTbe written by Cypher query language.Observation: the result of the action.Thought: I now know the answer.Final answer: the final answer to the question based on theobserved data.# SuffixBegin! Keep in mind that Your response MUST follow the validformat above.
# PrefixYou are a decision-making agent answering a given question.You have already collected the data to answer the question.Indeed, you should make your Final answer immediately.:# Tool descriptionsGraph DB: Useful for when you need to collect the data thatfollows the following schema (You MUST generate a Cypher querystatement to interact with this tool):(n:Trade_node {{name, local_value, is_inland, total_power,outgoing, ingoing}});(m:Country {{name, home_node, development}});(Trade_node)-[r:source {{flow}}]->[Trade_node](Country)-[NodeCountry{{is_home,has_merchant,base_trading_power,calculated_trading_power}}]->(Trade_node), args: {{{{'tool_input': {{{{'type': 'string'}}}}}}}}Self thinking: Useful for when there is no available tool., args:{{{{'tool_input': {{{{'type': 'string'}}}}}}}}# Format instructionsUse the following Strict format:Final answer: the final answer to the question based on theobserved data.# SuffixBegin!
https://arxiv.org/pdf/2406.12430PlanRAG: A Plan-then-Retrieval Augmented Generation for Generative Large Language Models as Decision Makershttps://github.com/myeon9h/PlanRAG.
53AI,企业落地大模型首选服务商
产品:场景落地咨询+大模型应用平台+行业解决方案
承诺:免费场景POC验证,效果验证后签署服务协议。零风险落地应用大模型,已交付160+中大型企业
2025-04-30
聊聊AI智能体框架MetaGPT下的RAG实践
2025-04-30
如何用大模型+RAG给宠物做一个AI健康助手(干货分享)?
2025-04-30
HiRAG:基于层级知识索引和检索的高精度RAG
2025-04-29
教程|通义Qwen 3 +Milvus,混合推理模型才是优化RAG成本的最佳范式
2025-04-29
RAG开发框架LangChain与LlamaIndex对比解析:谁更适合你的AI应用?
2025-04-29
RAG性能暴增20%!清华等推出“以笔记为中心”的深度检索增强生成框架,复杂问答效果飙升
2025-04-29
超神了,ChatWiki 支持GraphRAG,让 AI 具备垂直深度推理能力!
2025-04-29
AI 产品思维:我如何把一个 AI 应用从基础 RAG 升级到 multi-agent 架构
2024-10-27
2024-09-04
2024-07-18
2024-05-05
2024-06-20
2024-06-13
2024-07-09
2024-07-09
2024-05-19
2024-07-07
2025-04-30
2025-04-29
2025-04-29
2025-04-26
2025-04-25
2025-04-22
2025-04-22
2025-04-20