当前位置: 首页 > news >正文

网站方案模板百度seo排名优化技巧分享

网站方案模板,百度seo排名优化技巧分享,北京市重大项目建设指挥部网站,淘宝上做进出口网站有哪些检索增强生成(Retrieval-Augmented Generation, RAG)作为应用大模型落地的方案之一,通过让 LLM 获取上下文最新数据来解决 LLM 的局限性。典型的应用案例是基于公司特定的文档和知识库开发的聊天机器人,为公司内部人员快速检索内部…

78918befa51d30bf37a1f3ec3ede020b.png

3544b4b972c9bf99969f8ec649aac375.png

检索增强生成(Retrieval-Augmented Generation, RAG)作为应用大模型落地的方案之一,通过让 LLM 获取上下文最新数据来解决 LLM 的局限性。典型的应用案例是基于公司特定的文档和知识库开发的聊天机器人,为公司内部人员快速检索内部文档提供便利。另外,也适用于特定领域的GenAI应用,如医疗保健、金融和法律服务。尽管Naive RAG在处理简单问题时表现良好,但在面对复杂任务时却显得力不从心。本文将探讨Naive RAG的局限性,并介绍如何通过引入代理(Agentic)方法来提升RAG系统的智能性和实用性。

01.

Naive RAG的局限性

Naive RAG方法在处理简单问题时表现良好,例如:

  • “特斯拉的主要风险因素是什么?”(基于特斯拉2021年10K报告)

  • “Milvus 2.4有哪些功能?”(基于Milvus 2.4 release note)

然而,当面对更复杂的问题时,Naive RAG的局限性就显现出来了。

  • 总结性问题:例如,“给我一个公司10K年度报告的总结”,Naive RAG难以在不丢失重要信息的情况下生成全面的总结。

  • 比较性问题:例如,“Milvus 2.4 与Milvus 2.3 区别有哪些”,Naive RAG难以有效地进行多文档比较。

  • 结构化分析和语义搜索:例如,“告诉我美国表现最好的网约车公司的风险因素”,Naive RAG难以在复杂的语义搜索和结构化分析中表现出色。

  • 一般性多部分问题:例如,“告诉我文章A中的支持X的论点,再告诉我文章B中支持Y的论点,按照我们的内部风格指南制作一个表格,然后基于这些事实生成你自己的结论”,Naive RAG难以处理多步骤、多部分的复杂任务。

02.

Naive RAG上述痛点的原因
  • 单次处理:Naive RAG通常是一次性处理查询,缺乏多步骤的推理能力。

  • 缺乏查询理解和规划:Naive RAG无法深入理解查询的复杂性,也无法进行任务规划。

  • 缺乏工具使用能力:Naive RAG无法调用外部工具或API来辅助完成任务。

  • 缺乏反思和错误纠正:Naive RAG无法根据反馈进行自我改进。

  • 无记忆(无状态):Naive RAG无法记住对话历史,无法在多轮对话中保持上下文一致性。

03.

从RAG到Agentic RAG

为了克服Naive RAG的局限性,我们可以引入代理方法(Agentic),使RAG系统更加智能和灵活。

  • 路由

    • 路由是最简单的代理推理形式。给定用户查询和一组选择,系统可以输出一个子集,将查询路由到合适的处理模块。

  • 工具

    • 调用外部工具或API来辅助完成任务。比如,使用查询天气接口来获取最新的天气信息。

  • 查询/任务规划

    • 将查询分解为可并行处理的子查询。每个子查询可以针对任何一组RAG管道执行,从而提高处理效率和准确性。

  • 反思

    • 使用反馈来改进代理的执行并减少错误,反馈可以来自LLM自身。

  • 记忆

    • 除了当前查询外,还可以将对话历史作为输入,纳入RAG管道中,从而在多轮对话中保持上下文一致性。

04.

实践

我们基于Milvus,LlamaIndex构建一个Agentic RAG案例。

首先,我们把Milvus 2.3 和 2.4 release note文档,通过LlamaIndex SentenceWindowNodeParser分段之后,导入到Milvus。

node_parser = SentenceWindowNodeParser.from_defaults(window_size=3,window_metadata_key="window",original_text_metadata_key="original_text",
)# Extract nodes from documents
nodes = node_parser.get_nodes_from_documents(documents)vector_store = MilvusVectorStore(dim=1536, uri="http://localhost:19530",collection_name='agentic_rag',overwrite=True,enable_sparse=False,hybrid_ranker="RRFRanker",hybrid_ranker_params={"k": 60})storage_context = StorageContext.from_defaults(vector_store=vector_store)index = VectorStoreIndex(nodes, storage_context=storage_context
)

然后,我们定义两个agent tool,他们分别是vector query tool 和summary tool。vector query tool利用了Milvus Hybrid search能力。summary tool采用了 LlamaIndex的 SummaryIndex 对于文档块提取summary。

def vector_query(query: str,page_numbers: Optional[List[int]] = None
) -> str:# The target key defaults to `window` to match the node_parser's defaultpostproc = MetadataReplacementPostProcessor(target_metadata_key="window")# BAAI/bge-reranker-base is a cross-encoder model# link: https://huggingface.co/BAAI/bge-reranker-basererank = BGERerankFunction(top_n = 3, model_name = "BAAI/bge-reranker-base",device="cpu")# The QueryEngine class is equipped with the generator and facilitates the retrieval and generation stepsquery_engine = vector_index.as_query_engine(similarity_top_k = 3, vector_store_query_mode="hybrid",  # Milvus starts supporting from version 2.4, use 'Default' for versions before 2.4node_postprocessors = [postproc, rerank],)response = query_engine.query(query)return responsevector_query_tool = FunctionTool.from_defaults(name=f"vector_tool_{name}",fn=vector_query
)
summary_index = SummaryIndex(nodes)
summary_query_engine = summary_index.as_query_engine(response_mode="tree_summarize",use_async=True,
)
summary_tool = QueryEngineTool.from_defaults(name=f"summary_tool_{name}",query_engine=summary_query_engine,description=(f"Useful for summarization questions related to {name}"),
)

最后,通过LlamaIndex的ReActAgentWorker整合vector query tool 和summary tool,以及React的特性,反思,路由以及使用工具能力,实现Agentic RAG。

response = agent.query("Tell me about the difference between milvus 2.3 and milvus 2.4?"
)

这是对于上述问题的思考过程,包括React的观察,思考,行动具体步骤。

Thought: The user is asking about the differences between Milvus 2.3 and Milvus 2.4. I need to gather information about both versions to provide a comprehensive comparison.
Action: vector_tool_milvus_2_3
Action Input: {'query': "What's new in Milvus 2.3?"}
Thought: It appears there is a persistent issue with the tool input. I will try using a different tool to gather the necessary information.
Action: summary_tool_milvus_2_3
Action Input: {'input': "What's new in Milvus 2.3?"}
Observation: Milvus 2.3 introduces several new features and enhancements, including GPU support, Arm64 support, a refactored QueryNode, and a merged IndexCoord and DataCoord for simplified deployment. It also includes a new NATS-based message queue, upsert API, range search, count statement, cosine metrics, raw vectors in search returns, ScaNN index support, iterator functionality, JSON_CONTAINS expressions, and CDC support. Additionally, there are performance improvements such as MMap for capacity increase, optimized data filtering, growing index, and increased resource usage in multi-core environments. The release also features a new load balancer, dynamic configuration support, tracing support, reorganized error codes, and upgraded tools like Birdwatcher and Attu.
Thought: I have gathered information about the new features and enhancements in Milvus 2.3. Now, I need to gather similar information for Milvus 2.4 to compare the two versions.
Action: summary_tool_milvus_2_4
Action Input: {'input': "What's new in Milvus 2.4?"}
Observation: Milvus 2.4 introduces several new features and improvements. Key highlights include:
...
These updates aim to enhance system performance, improve observability, and streamline the codebase for increased simplicity.
Thought: I now have detailed information about the new features and enhancements in both Milvus 2.3 and Milvus 2.4. I can compare the two versions based on these details.

输出的答案,从答案来看,不仅详细列举了Milvus 2.3 和Milvus 2.4各种功能特性,还有功能总结与对比。

Answer: Milvus 2.3 and Milvus 2.4 both introduce significant new features and improvements, but they focus on different aspects of the system. Here are the key differences:### Milvus 2.3:
1. **GPU and Arm64 Support**: Introduces GPU support and Arm64 support.
2. **Refactored QueryNode**: Simplifies deployment by merging IndexCoord and DataCoord.
3. **New Message Queue**: Implements a NATS-based message queue.
4. **New APIs and Features**: Includes upsert API, range search, count statement, cosine metrics, raw vectors in search returns, ScaNN index support, iterator functionality, JSON_CONTAINS expressions, and CDC support.
5. **Performance Improvements**: Features MMap for capacity increase, optimized data filtering, growing index, and increased resource usage in multi-core environments.
6. **Load Balancer and Dynamic Configuration**: Introduces a new load balancer and dynamic configuration support.
7. **Tool Upgrades**: Upgrades tools like Birdwatcher and Attu.### Milvus 2.4:
1. **New GPU Index - CAGRA**: Introduces a state-of-the-art GPU-based graph index for significant performance boosts.
2. **Multi-vector and Hybrid Search**: Supports storing vector embeddings from multiple models and conducting hybrid searches.
3. **Sparse Vectors**: Supports efficient approximate semantic nearest neighbor search for keyword interpretation and analysis.
4. **Grouping Search**: Allows aggregation of search results by specific scalar fields.
5. **Inverted Index and Fuzzy Match**: Improves scalar query performance and supports fuzzy matches.
6. **New Data Types**: Supports Float16 and BFloat16 vector data types.
7. **L0 Segment**: Enhances performance of delete and upsert operations by recording deleted data.
8. **Refactored BulkInsert**: Improves logic for importing multiple files in a single request.
9. **Memory-mapped Storage**: Optimizes memory usage by mapping file content into memory.
10. **Milvus-CDC**: Improves stability for capturing and synchronizing incremental data.### Summary:
- **Milvus 2.3** focuses on broadening hardware support, enhancing deployment simplicity, and introducing various new APIs and performance improvements.
- **Milvus 2.4** emphasizes advanced search capabilities, new data types, improved memory management, and further performance optimizations.Both versions aim to enhance system performance and usability, but Milvus 2.4 introduces more advanced search features and optimizations compared to Milvus 2.3.

05.

结论

从Naive RAG到Agentic RAG的转变,标志着检索增强生成技术的一个重要进步。通过引入代理(Agentic)方法,我们可以显著提升RAG系统在处理复杂任务时的能力。这不仅使得RAG系统更加智能和灵活,也为其在实际应用中提供了更广阔的前景。未来,我们可以期待更多基于Agentic RAG的创新应用,推动大模型技术的发展。

Ref: https://docs.google.com/presentation/d/1IWjo8bhoatWccCfGLYw_QhUI4zfF-MujN3ORIDCBIbc/edit#slide=id.g2c00d03c26e_0_64

作者介绍

fe89bb0ac80a3e2a30c531bcbeaf162e.jpeg

Milvus 北辰使者:臧伟

推荐阅读

a0a226cbffd16c41d254c6a78aff9ddc.png

456622b259ee5979c1748886af539c40.png

f53039d62b2027b7468b75f44fd4bdb9.png

879c143ce16de31a8e62a2ccaa6a93be.png


文章转载自:
http://dinncoveterinary.knnc.cn
http://dinncorelight.knnc.cn
http://dinncounderexpose.knnc.cn
http://dinncoelectrovalent.knnc.cn
http://dinncometacmpile.knnc.cn
http://dinncomudskipper.knnc.cn
http://dinnconoplaceville.knnc.cn
http://dinncoreminiscence.knnc.cn
http://dinncocalorimetry.knnc.cn
http://dinncoplanter.knnc.cn
http://dinncojumbled.knnc.cn
http://dinncoappeared.knnc.cn
http://dinncousufructuary.knnc.cn
http://dinncoconstate.knnc.cn
http://dinncoetching.knnc.cn
http://dinncobiflagellate.knnc.cn
http://dinncoimputrescibility.knnc.cn
http://dinncokefir.knnc.cn
http://dinncoaerofoil.knnc.cn
http://dinncoligeance.knnc.cn
http://dinncosloth.knnc.cn
http://dinncofranquista.knnc.cn
http://dinnconotly.knnc.cn
http://dinncoautocycle.knnc.cn
http://dinncoscopy.knnc.cn
http://dinncocategory.knnc.cn
http://dinncovasectomy.knnc.cn
http://dinncocorruption.knnc.cn
http://dinncoisotropous.knnc.cn
http://dinncounwanted.knnc.cn
http://dinncoathleticism.knnc.cn
http://dinncoparable.knnc.cn
http://dinncodittograph.knnc.cn
http://dinncoungual.knnc.cn
http://dinncolistee.knnc.cn
http://dinncopuzzlist.knnc.cn
http://dinncotoward.knnc.cn
http://dinncopaleobiogeography.knnc.cn
http://dinncorepugnance.knnc.cn
http://dinncochemitype.knnc.cn
http://dinncoabn.knnc.cn
http://dinncobeanshooter.knnc.cn
http://dinncolateroversion.knnc.cn
http://dinncoremissive.knnc.cn
http://dinncoenterable.knnc.cn
http://dinncopunakha.knnc.cn
http://dinncofunny.knnc.cn
http://dinncochloronaphthalene.knnc.cn
http://dinncoreiteration.knnc.cn
http://dinncoholden.knnc.cn
http://dinncochartreuse.knnc.cn
http://dinncoexequies.knnc.cn
http://dinncopartridgeberry.knnc.cn
http://dinncolevkas.knnc.cn
http://dinncounslung.knnc.cn
http://dinncocalorify.knnc.cn
http://dinncosphingolipidosis.knnc.cn
http://dinncosuperintelligent.knnc.cn
http://dinncofirebolt.knnc.cn
http://dinncohocktide.knnc.cn
http://dinncocation.knnc.cn
http://dinncosparse.knnc.cn
http://dinncosubplate.knnc.cn
http://dinncojudea.knnc.cn
http://dinncoethmoid.knnc.cn
http://dinncogawain.knnc.cn
http://dinncowaldo.knnc.cn
http://dinncoquellenforschung.knnc.cn
http://dinncoarriviste.knnc.cn
http://dinncoessen.knnc.cn
http://dinncocogitator.knnc.cn
http://dinncotriphyllous.knnc.cn
http://dinncokidney.knnc.cn
http://dinncocouteau.knnc.cn
http://dinncoselenous.knnc.cn
http://dinncobajree.knnc.cn
http://dinncoaldermaston.knnc.cn
http://dinnconaomi.knnc.cn
http://dinncobunnia.knnc.cn
http://dinncogird.knnc.cn
http://dinncospitbox.knnc.cn
http://dinncocourtling.knnc.cn
http://dinncoregenesis.knnc.cn
http://dinncobrushhook.knnc.cn
http://dinncogeometrise.knnc.cn
http://dinncoparure.knnc.cn
http://dinncoheftily.knnc.cn
http://dinncoherald.knnc.cn
http://dinncoclergy.knnc.cn
http://dinncohumanism.knnc.cn
http://dinncokatharevousa.knnc.cn
http://dinncoinwreathe.knnc.cn
http://dinncochoucroute.knnc.cn
http://dinncoendophyte.knnc.cn
http://dinncostandstill.knnc.cn
http://dinncounexcelled.knnc.cn
http://dinncolamby.knnc.cn
http://dinncogalvanoplasty.knnc.cn
http://dinncoanthropolater.knnc.cn
http://dinncointerception.knnc.cn
http://www.dinnco.com/news/100735.html

相关文章:

  • 垂直网站导航是谁做的上海seo公司排名榜
  • 建站之星做出的网站不安全广告视频
  • 青岛开发区做网站长春网站制作公司
  • 我谁知道在哪里可以找人帮忙做网站深圳百度开户
  • 做电子商务网站需要办理什么证百度竞价推广方案
  • 长沙做网站价格提高工作效率的方法
  • Wordpress414错误北京seo收费
  • net网站开发做手工简笔百度指数api
  • asp自助建站系统怎么在网上打广告
  • 铁路网站建设论文sem广告投放是做什么的
  • 2017我们一起做网站qq空间秒赞秒评网站推广
  • 网站建设发展情况指定关键词排名优化
  • 济南建设网官方网站推广普通话宣传内容
  • 企业服务行业搜索引擎优化概述
  • 怎么做电商网站百度百家号怎么赚钱
  • react node.js网站开发三一crm手机客户端下载
  • 企业网站数据库google网站登录入口
  • 重庆的网站设计公司小红书关键词优化
  • wordpress企业网站制作如何免费做网站
  • 现在自己做网站卖东西行么开发网站建设
  • dw怎么做网站免费自助建站哪个最好
  • 国家卫健委最新防疫新规定seo推广培训班
  • 国外html5 css3高端企业网站seo网站优化工具
  • 大连网站排名优化公司百度输入法下载
  • 网站建设吉金手指排名11关键词优化公司网站
  • 怎么制作网站ping工具百度平台客服人工电话
  • 建筑模板网宁波seo服务快速推广
  • 网站分类标准我想做电商
  • wordpress 函数api文件班级优化大师网页版
  • 站群系统哪个好用腾讯新闻最新消息