Skip to content

Commit 860cdc7

Browse files
authored
Merge pull request #162 from alipay/dev
feat: Version 0.0.13 Release
2 parents a6f3c98 + 63a50f6 commit 860cdc7

File tree

249 files changed

+7582
-10372
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

249 files changed

+7582
-10372
lines changed

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,27 @@ Note - Additional remarks regarding the version.
2424
***************************************************
2525

2626
# Version Update History
27+
# [0.0.13] - 2024-09-12
28+
### Added
29+
- RAG(Retrieval-Augmented Generation) Component Version Update
30+
- This version provides a standard operating procedure for knowledge base construction and the RAG retrieval recall stage. The component covers a series of RAG atomic capabilities, including data loading, data processing, index construction, knowledge storage, intent rewriting, and retrieval re-ranking, helping users to quickly build a general RAG intelligent agent solution in open-source scenarios.
31+
32+
- Intelligent Agent Product Platform Update
33+
- This version introduces new capabilities such as intelligent agent canvas orchestration, private knowledge base construction, and custom plugin support, enabling users to quickly build and orchestrate intelligent agents through a low-code, visual approach.
34+
35+
- Added GLM Default Model Component for Zhipu
36+
- Added SQLiteStore Storage Component
37+
- Added Flow Orchestration Execution Engine
38+
39+
### Note
40+
- Default path optimization for system_db_uri
41+
The default path is already compatible with the Windows platform, for more details, please refer to [issue142](https://github.com/alipay/agentUniverse/issues/142)
42+
- Support for configurable chain stop words in ReactAgent
43+
The ReactAgent YAML configuration now supports the stop_sequence keyword, allowing users to customize chain stop words. For more details, please refer to [issue127](https://github.com/alipay/agentUniverse/issues/127)
44+
- Added an introduction to RAG principles and a quick guide for building RAG, please pay attention to the corresponding parts in the README and user guide.
45+
- Added advanced guidance documents for the intelligent agent productization platform, please pay attention to the corresponding parts in the README and user guide.
46+
- Various code optimizations and documentation updates.
47+
2748
## [0.0.12] - 2024-08-14
2849
### Added
2950
- agentUniverse Product Version Offering

CHANGELOG_zh.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,27 @@ Note - 对于版本的额外说明。
2424
***************************************************
2525

2626
# 版本更新记录
27+
## [0.0.13] - 2024-09-12
28+
### Added
29+
- RAG检索增强能力组件版本更新
30+
- 本版本提供知识库构建、RAG检索召回环节标准作业流程,组件覆盖数据加载、数据处理、索引构建、知识入库、意图改写、检索重排等一系列RAG原子能力,帮助用户在开源场景下快速构建通用RAG智能体方案。
31+
32+
- 智能体产品化平台更新
33+
- 本版本新增支持智能体画布编排、私有知识库构建、自定义插件等能力,通过低代码、可视化的方式帮助用户快速构建与编排智能体。
34+
35+
- 新增智谱GLM默认模型组件
36+
- 新增SQLiteStore存储组件
37+
- 新增flow编排执行引擎
38+
39+
### Note
40+
- system_db_uri默认路径优化
41+
- 默认路径已兼容windows平台,详情见[issue142](https://github.com/alipay/agentUniverse/issues/142)
42+
- ReactAgent支持链停止词配置化
43+
- ReactAgent yaml配置目前已经支持stop_sequence关键词,用户可以自行配置链停止词,详情见[issue127](https://github.com/alipay/agentUniverse/issues/127)
44+
- 新增RAG原理介绍与RAG快速构建指导文档,请关注README与用户指南相应部分。
45+
- 新增智能体产品化平台高阶指导文档,请关注README与用户指南相应部分。
46+
- 部分代码优化与文档更新
47+
2748
## [0.0.12] - 2024-08-14
2849
### Added
2950
- agentUniverse产品化版本提供

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Language version: [English](./README.md) | [中文](./README_zh.md) | [日本語
55
![](https://img.shields.io/badge/framework-agentUniverse-pink)
66
![](https://img.shields.io/badge/python-3.10%2B-blue?logo=Python)
77
[![](https://img.shields.io/badge/%20license-Apache--2.0-yellow)](LICENSE)
8-
[![Static Badge](https://img.shields.io/badge/pypi-v0.0.12-blue?logo=pypi)](https://pypi.org/project/agentUniverse/)
8+
[![Static Badge](https://img.shields.io/badge/pypi-v0.0.13-blue?logo=pypi)](https://pypi.org/project/agentUniverse/)
99

1010
![](docs/guidebook/_picture/logo_bar.jpg)
1111
****************************************
@@ -67,15 +67,15 @@ pip install magent-ui ruamel.yaml
6767

6868
Run the [product_application.py](sample_standard_app/app/bootstrap/product_application.py) file located in sample_standard_app/app/bootstrap for a one-click start.
6969

70-
For more details, refer to [Quick Start for Product Platform](./docs/guidebook/en/10_1_1_Product%20Platform%20Quick%20Start.md).
70+
For more details, refer to [Quick Start for Product Platform](./docs/guidebook/en/10_1_1_Product%20Platform%20Quick%20Start.md) and the [Advanced Guide](./docs/guidebook/en/10_1_2_Product_Platform_Advancement_Guide.md).
7171

7272
This feature is jointly launched by [difizen](https://github.com/difizen/magent) and agentUniverse.
7373

7474
****************************************
7575

7676
## Cases and Example Projects
7777
### 🌟 Use Cases
78-
[Legal Consultation Agent](./docs/guidebook/en/7_1_1_Legal_Consultation_Case.md)
78+
[Legal Consultation Agent v2](./docs/guidebook/en/7_1_1_Legal_Consultation_Case.md)
7979

8080
[Python Code Generation and Execution Agent](./docs/guidebook/en/7_1_1_Python_Auto_Runner.md)
8181

@@ -85,6 +85,9 @@ This feature is jointly launched by [difizen](https://github.com/difizen/magent)
8585

8686
[Andrew Ng's Reflexive Workflow Translation Agent Replication](./docs/guidebook/en/7_1_1_Translation_Case.md)
8787

88+
#### 🚩 How to Quickly Build an RAG Agent
89+
The RAG components have been fully upgraded. This tutorial provides a guide on how to quickly build an RAG agent in agentUniverse. You can refer to the documentation on [How to Build a RAG Agent](./docs/guidebook/en/2_2_4_How_To_Build_A_RAG_Agent.md). For more theoretical content, please check the documentation on [Introduction to RAG](./docs/guidebook/en/2_2_4_RAG.md).
90+
8891
#### 🚩 DataAgent - Data Autonomous Agent
8992
agentUniverse has launched DataAgent (Minimum Viable Product Version). DataAgent aims to empower your agent with the capability of self-assessment and evolution through the use of intelligent agent abilities. For more details, please refer to the documentation. [DataAgent - Data Autonomous Agent](./docs/guidebook/en/8_1_1_data_autonomous_agent.md)
9093

README_jp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
![](https://img.shields.io/badge/framework-agentUniverse-pink)
66
![](https://img.shields.io/badge/python-3.10%2B-blue?logo=Python)
77
[![](https://img.shields.io/badge/%20license-Apache--2.0-yellow)](LICENSE)
8-
[![Static Badge](https://img.shields.io/badge/pypi-v0.0.10-blue?logo=pypi)](https://pypi.org/project/agentUniverse/)
8+
[![Static Badge](https://img.shields.io/badge/pypi-v0.0.13-blue?logo=pypi)](https://pypi.org/project/agentUniverse/)
99

1010
![](docs/guidebook/_picture/logo_bar.jpg)
1111
****************************************

README_zh.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
![](https://img.shields.io/badge/framework-agentUniverse-pink)
66
![](https://img.shields.io/badge/python-3.10%2B-blue?logo=Python)
77
[![](https://img.shields.io/badge/%20license-Apache--2.0-yellow)](LICENSE)
8-
[![Static Badge](https://img.shields.io/badge/pypi-v0.0.12-blue?logo=pypi)](https://pypi.org/project/agentUniverse/)
8+
[![Static Badge](https://img.shields.io/badge/pypi-v0.0.13-blue?logo=pypi)](https://pypi.org/project/agentUniverse/)
99

1010
![](docs/guidebook/_picture/logo_bar.jpg)
1111
****************************************
@@ -65,13 +65,14 @@ pip install magent-ui ruamel.yaml
6565
运行sample_standard_app/app/boostrap下的[product_application.py](sample_standard_app/app/bootstrap/product_application.py)文件,一键启动。
6666

6767
更多详情参考 [产品化平台快速开始](./docs/guidebook/zh/10_1_1_产品化平台快速开始.md)
68+
[产品化平台进阶指南](./10_1_2_产品化平台进阶指南.md)
6869

6970
本功能由 [difizen](https://github.com/difizen/magent) X agentUniverse联合推出。
7071

7172
****************************************
7273
## 案例与样例工程
7374
### 🌟 使用案例
74-
[法律咨询Agent](./docs/guidebook/zh/7_1_1_法律咨询案例.md)
75+
[法律咨询Agent_v2](./docs/guidebook/zh/7_1_1_法律咨询案例.md)
7576

7677
[Python代码生成与执行Agent](./docs/guidebook/zh/7_1_1_Python自动执行案例.md)
7778

@@ -81,6 +82,8 @@ pip install magent-ui ruamel.yaml
8182

8283
[吴恩达反思工作流翻译智能体复刻](./docs/guidebook/zh/7_1_1_翻译案例.md)
8384

85+
#### 🚩 如何快速构建RAG智能体
86+
RAG组件全面升级,教程提供一个在agentUniverse中快速构建一个RAG智能体,可查看文档[如何构建RAG智能体](./docs/guidebook/zh/2_2_4_如何构建RAG智能体.md),更多原理性内容可查看文档[RAG介绍](./docs/guidebook/zh/2_2_4_RAG.md)
8487

8588
#### 🚩 DataAgent - 数据自治智能体
8689
agentUniverse推出了DataAgent(Minimum Viable Product版本), DataAgent旨在使用智能体能力让您的Agent拥有自我评价与演进的能力。详情见文档: [DataAgent - 数据自治智能体](./docs/guidebook/zh/8_1_1_数据自治智能体.md)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# !/usr/bin/env python3
2+
# -*- coding:utf-8 -*-
3+
4+
# @Time : 2024/7/23 13:59
5+
# @Author : fanen.lhy
6+
# @Email : fanen.lhy@antgroup.com
7+
# @FileName: __init__.py.py
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# !/usr/bin/env python3
2+
# -*- coding:utf-8 -*-
3+
4+
# @Time : 2024/8/5 14:37
5+
# @Author : fanen.lhy
6+
# @Email : fanen.lhy@antgroup.com
7+
# @FileName: text_splitter.py
8+
from typing import List, Optional
9+
from langchain.text_splitter import CharacterTextSplitter as Splitter
10+
11+
from agentuniverse.agent.action.knowledge.doc_processor.doc_processor import \
12+
DocProcessor
13+
from agentuniverse.agent.action.knowledge.store.document import Document
14+
from agentuniverse.agent.action.knowledge.store.query import Query
15+
from agentuniverse.base.config.component_configer.component_configer import \
16+
ComponentConfiger
17+
18+
19+
class CharacterTextSplitter(DocProcessor):
20+
chunk_size: int = 200
21+
chunk_overlap: int = 20
22+
separator: str = "/n/n"
23+
splitter: Optional[Splitter] = None
24+
25+
def __init__(self, **kwargs):
26+
super().__init__(**kwargs)
27+
self.splitter = Splitter(separator=self.separator,
28+
chunk_size=self.chunk_size,
29+
chunk_overlap=self.chunk_overlap)
30+
31+
def _process_docs(self, origin_docs: List[Document], query: Query = None) -> \
32+
List[Document]:
33+
lc_doc_list = self.splitter.split_documents(Document.as_langchain_list(
34+
origin_docs
35+
))
36+
return Document.from_langchain_list(lc_doc_list)
37+
38+
def _initialize_by_component_configer(self,
39+
doc_processor_configer: ComponentConfiger) -> 'DocProcessor':
40+
super()._initialize_by_component_configer(doc_processor_configer)
41+
if hasattr(doc_processor_configer, "chunk_size"):
42+
self.chunk_size = doc_processor_configer.chunk_size
43+
if hasattr(doc_processor_configer, "chunk_overlap"):
44+
self.chunk_overlap = doc_processor_configer.chunk_overlap
45+
if hasattr(doc_processor_configer, "separator"):
46+
self.separator = doc_processor_configer.separator
47+
self.splitter = Splitter(separator=self.separator,
48+
chunk_size=self.chunk_size,
49+
chunk_overlap=self.chunk_overlap)
50+
return self
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: 'character_text_splitter'
2+
description: 'langchain character text splitter'
3+
chunk_size: 200
4+
chunk_overlap: 20
5+
separators: "/n/n"
6+
metadata:
7+
type: 'DOC_PROCESSOR'
8+
module: 'agentuniverse.agent.action.knowledge.doc_processor.character_text_splitter'
9+
class: 'CharacterTextSplitter'
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# !/usr/bin/env python3
2+
# -*- coding:utf-8 -*-
3+
4+
# @Time : 2024/8/5 15:48
5+
# @Author : fanen.lhy
6+
# @Email : fanen.lhy@antgroup.com
7+
# @FileName: dashscope_reranker.py
8+
9+
from typing import List, Optional
10+
import dashscope
11+
from http import HTTPStatus
12+
13+
from agentuniverse.agent.action.knowledge.doc_processor.doc_processor import \
14+
DocProcessor
15+
from agentuniverse.agent.action.knowledge.store.document import Document
16+
from agentuniverse.agent.action.knowledge.store.query import Query
17+
from agentuniverse.base.config.component_configer.component_configer import \
18+
ComponentConfiger
19+
20+
MODEL_NAME_MAP = {
21+
"gte_rerank": dashscope.TextReRank.Models.gte_rerank
22+
}
23+
24+
25+
class DashscopeReranker(DocProcessor):
26+
model_name: str = "gte_rerank"
27+
top_n: int = 10
28+
29+
def _process_docs(self, origin_docs: List[Document], query: Query = None) -> \
30+
List[Document]:
31+
if not query or not query.query_str:
32+
raise Exception("Dashscope reranker need an origin string query.")
33+
if len(origin_docs)<1:
34+
return origin_docs
35+
documents_texts = []
36+
for _doc in origin_docs:
37+
documents_texts.append(_doc.text)
38+
resp = dashscope.TextReRank.call(
39+
model=MODEL_NAME_MAP.get(self.model_name),
40+
query=query.query_str,
41+
documents=documents_texts,
42+
top_n=self.top_n,
43+
return_documents=False
44+
)
45+
if resp.status_code == HTTPStatus.OK:
46+
results = resp.output.results
47+
else:
48+
raise Exception(f"Dashscope rerank api call error: {resp}")
49+
rerank_docs = []
50+
for _result in results:
51+
index = _result.index
52+
if origin_docs[index].metadata:
53+
origin_docs[index].metadata["relevance_score"] = _result.relevance_score
54+
else:
55+
origin_docs[index].metadata = {"relevance_score": _result.relevance_score}
56+
rerank_docs.append(origin_docs[index])
57+
58+
return rerank_docs
59+
60+
def _initialize_by_component_configer(self,
61+
doc_processor_configer: ComponentConfiger) -> 'DocProcessor':
62+
super()._initialize_by_component_configer(doc_processor_configer)
63+
if hasattr(doc_processor_configer, "model_name"):
64+
self.model_name = doc_processor_configer.model_name
65+
if hasattr(doc_processor_configer, "top_n"):
66+
self.top_n = doc_processor_configer.top_n
67+
return self
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name: 'dashscope_reranker'
2+
description: 'reranker use dashscope api'
3+
metadata:
4+
type: 'DOC_PROCESSOR'
5+
module: 'agentuniverse.agent.action.knowledge.doc_processor.dashscope_reranker'
6+
class: 'DashscopeReranker'

0 commit comments

Comments
 (0)