diff --git a/docs/guidebook/_picture/db_structure.png b/docs/guidebook/_picture/db_structure.png
new file mode 100644
index 00000000..8ff081fc
Binary files /dev/null and b/docs/guidebook/_picture/db_structure.png differ
diff --git a/docs/guidebook/_picture/init_code.png b/docs/guidebook/_picture/init_code.png
new file mode 100644
index 00000000..ae7cf4bc
Binary files /dev/null and b/docs/guidebook/_picture/init_code.png differ
diff --git a/docs/guidebook/_picture/result_show.png b/docs/guidebook/_picture/result_show.png
new file mode 100644
index 00000000..e4cc8098
Binary files /dev/null and b/docs/guidebook/_picture/result_show.png differ
diff --git a/docs/guidebook/en/Examples/Disease_helper.md b/docs/guidebook/en/Examples/Disease_helper.md
new file mode 100644
index 00000000..e2cf7c40
--- /dev/null
+++ b/docs/guidebook/en/Examples/Disease_helper.md
@@ -0,0 +1,116 @@
+# Disease Helper
+
+This case is based on the RagAgentTemplate and builds a simple medical consultation agent. By retrieving relevant information from Recommendations on Drugs for Common Diseases, Introduction to Natural Therapies for Common Diseases, and Summary of Common Diseases and Symptoms, and combining it with the user's provided descriptions of physical symptoms, the agent can reasonably infer the user's disease type and provide corresponding natural treatment plans and medication treatment plans.
+
+This case is based on the Deepseek large model and the embedding and rerank functions of DashScope. Before use, you need to configure the DASHSCOPE_API_KEY in the environment variables.
+
+## Quick Start
+### Configure API Key
+For example, configure the key information in the custom_key.toml file (this file is used to manage private key configurations in agentUniverse). The discussion group uses DeepSeek as the default base model and Serper as the Google Search tool; the following sections will explain the usage methods of other models or tools.
+```toml
+[KEY_LIST]
+# serper google search key
+SERPER_API_KEY='xxx'
+# deepseek api key
+DEEPSEEK_API_KEY='xxx'
+```
+### Build a Disease Knowledge Base
+The disease knowledge base is built on the knowledge components in agentUniverse. By storing the symptoms and treatment plans of common diseases in ChromaDB and SQLite, it creates a knowledge base that is convenient for agents to access and retrieve.
+
+Materials on Symptoms and Treatment Plans of Common Diseases:
+- Summary of Common Diseases and Symptoms.docx
+- Introduction to Natural Therapies for Common Diseases.docx
+- Drug Recommendations for Common Diseases.docx
+
+disease_knowledge is defined as follows:
+```python
+name: "disease_knowledge"
+description: "常见疾病症状与治疗方法相关的知识库"
+stores:
+ - "disease_symptoms_chroma_store"
+ - "disease_therapy_one_chroma_store"
+ - "disease_therapy_two_chroma_store"
+ - "disease_symptoms_sqlite_store"
+ - "disease_therapy_one_sqlite_store"
+ - "disease_therapy_two_sqlite_store"
+query_paraphrasers:
+ - "custom_query_keyword_extractor"
+insert_processors:
+ - "recursive_character_text_splitter"
+rag_router: "nlu_rag_router"
+post_processors:
+ - "dashscope_reranker"
+readers:
+ docx: "default_docx_reader"
+metadata:
+ type: 'KNOWLEDGE'
+ module: 'sample_rag_app.intelligence.agentic.knowledge.disease_knowledge'
+ class: 'DiseaseKnowledge'
+```
+
+### Code Run
+In the examples/sample_apps/sample_rag_app example project of agentUniverse, locate the legal_advice_rag_agent.py file under the intelligence/test directory. In the chat method, enter the question you want to be answered, then run it.
+
+For example, enter the question: "Xiao Ming has recently had symptoms of fever, accompanied by chills. He experiences lethargy, difficulty concentrating, frequent dizziness, and overall obvious weakness. Please infer the type of disease Xiao Ming has, and recommend treatment methods and medications for him."
+```python
+from agentuniverse.agent.output_object import OutputObject
+from agentuniverse.agent.agent import Agent
+from agentuniverse.agent.agent_manager import AgentManager
+from agentuniverse.base.agentuniverse import AgentUniverse
+
+AgentUniverse().start(config_path='../../config/config.toml', core_mode=True)
+
+
+def chat(question: str):
+ instance: Agent = AgentManager().get_instance_obj('disease_rag_agent')
+ output_object: OutputObject = instance.run(input=question)
+
+ question = f"\nYour event is :\n"
+ question += output_object.get_data('input')
+ print(question)
+
+ background_info = f"\nRetrieved background is :\n"
+ background_info += output_object.get_data('background').replace("\n","")
+ print(background_info)
+
+ res_info = f"\nRag chat bot execution result is :\n"
+ res_info += output_object.get_data('output')
+ print(res_info)
+
+
+if name == '__main__':
+ chat("小明最近出现了发热表现,伴有畏寒现象,精神状态萎靡,注意力难以集中,时常感到头晕目眩,"
+ "整个人呈现出明显的虚弱状态,请推测小明的疾病类型,并为其推荐治疗方法和药物推荐")
+```
+### Result Demonstration
+question: "Xiao Ming has recently had symptoms of fever, accompanied by chills. He experiences lethargy, difficulty concentrating, frequent dizziness, and overall obvious weakness. Please infer the type of disease Xiao Ming has, and recommend treatment methods and medications for him."
+
+
+
+## More Details
+### Reader Component
+- [default_docx_reader](../../../../agentuniverse/agent/action/knowledge/reader/file/docx_reader.yaml)
+
+### DocProcessor Component
+- [custom_query_keyword_extractor](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/doc_processor/query_keyword_extractor.yaml)
+- [recursive_character_text_splitter](../../../../agentuniverse/agent/action/knowledge/doc_processor/recursive_character_text_splitter.yaml)
+
+### QueryParaphraser Component
+- [custom_query_keyword_extractor](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/query_paraphraser/custom_query_keyword_extractor.yaml)
+
+### RagRouter Component
+- [nlu_rag_router](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/rag_router/nlu_rag_router.yaml)
+
+### Store Component
+- [disease_symptoms_chroma_store](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/store/disease_symptoms_chroma_store.yaml)
+- [disease_therapy_one_chroma_store](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/store/disease_therapy_one_chroma_store.yaml)
+- [disease_therapy_two_chroma_store](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/store/disease_therapy_two_chroma_store.yaml)
+- [disease_symptoms_sqlite_store](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/store/disease_symptoms_sqlite_store.yaml)
+- [disease_therapy_one_sqlite_store](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/store/disease_therapy_one_sqlite_store.yaml)
+- [disease_therapy_two_sqlite_store](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/store/disease_therapy_two_sqlite_store.yaml)
+
+For your convenience, we have stored the database files containing relevant information as shown in the figure below.
+
+
+If you want to build the knowledge base from scratch, you can run the __init__.py file in the test folder. The code is as follows:
+
\ No newline at end of file
diff --git a/docs/guidebook/zh/实践应用/医疗咨询助手.md b/docs/guidebook/zh/实践应用/医疗咨询助手.md
new file mode 100644
index 00000000..d04878cb
--- /dev/null
+++ b/docs/guidebook/zh/实践应用/医疗咨询助手.md
@@ -0,0 +1,116 @@
+# 医疗咨询助手
+
+本案例基于RagAgentTemplate,搭建了一个简单的医疗咨询智能体,通过检索《常见疾病药物推荐》《常见疾病自然疗法介绍》《常见疾病及症状汇总》中的相关信息并结合用户提供的身体症状的描述合理推断用户的疾病类型并给出相应的自然治疗方案和药物治疗方案。
+
+该案例基于Deepseek大模型和DashScope的embedding和rerank功能,使用前需要您在环境变量中配置DASHSCOPE_API_KEY。
+
+## 快速开始
+### 配置API密钥
+比如在agentUniverse管理私有密钥配置的文件custom_key.toml中配置密钥信息(讨论组默认使用deepseek作为基座模型,serper作为google search工具,下文讲述其他模型或工具使用方法)
+```toml
+[KEY_LIST]
+# serper google search key
+SERPER_API_KEY='xxx'
+# deepseek api key
+DEEPSEEK_API_KEY='xxx'
+```
+### 构建疾病知识库
+疾病知识库基于agentUniverse中的知识组件,通过将常见疾病的症状及治疗方案存储至ChromaDB和Sqlite中,构建方便智能体查阅检索的知识库。
+
+常见疾病的症状及治疗方案资料:
+- 常见疾病及症状汇总.docx
+- 常见疾病自然疗法介绍.docx
+- 常见疾病药物推荐.docx
+
+disease_knowledge定义如下:
+```python
+name: "disease_knowledge"
+description: "常见疾病症状与治疗方法相关的知识库"
+stores:
+ - "disease_symptoms_chroma_store"
+ - "disease_therapy_one_chroma_store"
+ - "disease_therapy_two_chroma_store"
+ - "disease_symptoms_sqlite_store"
+ - "disease_therapy_one_sqlite_store"
+ - "disease_therapy_two_sqlite_store"
+query_paraphrasers:
+ - "custom_query_keyword_extractor"
+insert_processors:
+ - "recursive_character_text_splitter"
+rag_router: "nlu_rag_router"
+post_processors:
+ - "dashscope_reranker"
+readers:
+ docx: "default_docx_reader"
+metadata:
+ type: 'KNOWLEDGE'
+ module: 'sample_rag_app.intelligence.agentic.knowledge.disease_knowledge'
+ class: 'DiseaseKnowledge'
+```
+
+### 运行代码
+在agentUniverse的examples/sample_apps/sample_rag_app示例工程中,找到intelligence/test目录下的legal_advice_rag_agent.py文件,chat方法中输入想要解答的问题,运行即可。
+
+例如,输入问题"小明最近出现了发热表现,伴有畏寒现象,精神状态萎靡,注意力难以集中,时常感到头晕目眩,整个人呈现出明显的虚弱状态,请推测小明的疾病类型,并为其推荐治疗方法和药物推荐"
+```python
+from agentuniverse.agent.output_object import OutputObject
+from agentuniverse.agent.agent import Agent
+from agentuniverse.agent.agent_manager import AgentManager
+from agentuniverse.base.agentuniverse import AgentUniverse
+
+AgentUniverse().start(config_path='../../config/config.toml', core_mode=True)
+
+
+def chat(question: str):
+ instance: Agent = AgentManager().get_instance_obj('disease_rag_agent')
+ output_object: OutputObject = instance.run(input=question)
+
+ question = f"\nYour event is :\n"
+ question += output_object.get_data('input')
+ print(question)
+
+ background_info = f"\nRetrieved background is :\n"
+ background_info += output_object.get_data('background').replace("\n","")
+ print(background_info)
+
+ res_info = f"\nRag chat bot execution result is :\n"
+ res_info += output_object.get_data('output')
+ print(res_info)
+
+
+if name == '__main__':
+ chat("小明最近出现了发热表现,伴有畏寒现象,精神状态萎靡,注意力难以集中,时常感到头晕目眩,"
+ "整个人呈现出明显的虚弱状态,请推测小明的疾病类型,并为其推荐治疗方法和药物推荐")
+```
+### 效果演示
+问题"小明最近出现了发热表现,伴有畏寒现象,精神状态萎靡,注意力难以集中,时常感到头晕目眩,整个人呈现出明显的虚弱状态,请推测小明的疾病类型,并为其推荐治疗方法和药物推荐":
+
+
+
+## 更多细节
+### Reader组件
+- [default_docx_reader](../../../../agentuniverse/agent/action/knowledge/reader/file/docx_reader.yaml)
+
+### DocProcessor组件
+- [custom_query_keyword_extractor](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/doc_processor/query_keyword_extractor.yaml)
+- [recursive_character_text_splitter](../../../../agentuniverse/agent/action/knowledge/doc_processor/recursive_character_text_splitter.yaml)
+
+### QueryParaphraser组件
+- [custom_query_keyword_extractor](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/query_paraphraser/custom_query_keyword_extractor.yaml)
+
+### RagRouter组件
+- [nlu_rag_router](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/rag_router/nlu_rag_router.yaml)
+
+### Store组件
+- [disease_symptoms_chroma_store](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/store/disease_symptoms_chroma_store.yaml)
+- [disease_therapy_one_chroma_store](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/store/disease_therapy_one_chroma_store.yaml)
+- [disease_therapy_two_chroma_store](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/store/disease_therapy_two_chroma_store.yaml)
+- [disease_symptoms_sqlite_store](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/store/disease_symptoms_sqlite_store.yaml)
+- [disease_therapy_one_sqlite_store](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/store/disease_therapy_one_sqlite_store.yaml)
+- [disease_therapy_two_sqlite_store](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/store/disease_therapy_two_sqlite_store.yaml)
+
+为了方便您使用,我们已经将存储有相关信息的数据库文件存储如下图:
+
+
+如果您想从头构建知识库的话,您可以运行test文件夹下的__init__.py文件,代码如下:
+
\ No newline at end of file
diff --git a/examples/sample_apps/sample_rag_app/.gitignore b/examples/sample_apps/sample_rag_app/.gitignore
new file mode 100644
index 00000000..a6c808ff
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/.gitignore
@@ -0,0 +1,170 @@
+docs/source
+
+# From https://raw.githubusercontent.com/github/gitignore/main/Python.gitignore
+
+ Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+wheels/
+share/python-wheels/
+*.egg-info/
+.installed.cfg
+*.egg
+MANIFEST
+
+# PyInstaller
+# Usually these files are written by a python script from a template
+# before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.nox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*.cover
+*.py,cover
+.hypothesis/
+.pytest_cache/
+cover/
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+local_settings.py
+db.sqlite3
+db.sqlite3-journal
+
+# Flask stuff:
+instance/
+.webassets-cache
+
+# Scrapy stuff:
+.scrapy
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+.pybuilder/
+target/
+
+# Jupyter Notebook
+.ipynb_checkpoints
+
+# IPython
+profile_default/
+ipython_config.py
+
+# pyenv
+# For a library or package, you might want to ignore these files since the code is
+# intended to run in multiple environments; otherwise, check them in:
+# .python-version
+
+# pipenv
+# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
+# However, in case of collaboration, if having platform-specific dependencies or dependencies
+# having no cross-platform support, pipenv may install dependencies that don't work, or not
+# install all needed dependencies.
+#Pipfile.lock
+
+# poetry
+# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
+# This is especially recommended for binary packages to ensure reproducibility, and is more
+# commonly ignored for libraries.
+# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
+#poetry.lock
+
+# pdm
+# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
+#pdm.lock
+# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
+# in version control.
+# https://pdm.fming.dev/#use-with-ide
+.pdm.toml
+
+# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
+__pypackages__/
+
+# Celery stuff
+celerybeat-schedule
+celerybeat.pid
+
+# SageMath parsed files
+*.sage.py
+
+# Environments
+.env
+.venv
+env/
+venv/
+ENV/
+env.bak/
+venv.bak/
+
+# Spyder project settings
+.spyderproject
+.spyproject
+
+# Rope project settings
+.ropeproject
+
+# mkdocs documentation
+/site
+
+# mypy
+.mypy_cache/
+.dmypy.json
+dmypy.json
+
+# Pyre type checker
+.pyre/
+
+# pytype static type analyzer
+.pytype/
+
+# Cython debug symbols
+cython_debug/
+
+# PyCharm
+# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
+# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
+# and can be added to the global gitignore or merged into this file. For a more nuclear
+# option (not recommended) you can uncomment the following to ignore the entire idea folder.
+.idea/
+.DS_Store
+
+
+*.pyc
+
+custom_key.toml
diff --git a/examples/sample_apps/sample_rag_app/README.md b/examples/sample_apps/sample_rag_app/README.md
new file mode 100644
index 00000000..e2cf7c40
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/README.md
@@ -0,0 +1,116 @@
+# Disease Helper
+
+This case is based on the RagAgentTemplate and builds a simple medical consultation agent. By retrieving relevant information from Recommendations on Drugs for Common Diseases, Introduction to Natural Therapies for Common Diseases, and Summary of Common Diseases and Symptoms, and combining it with the user's provided descriptions of physical symptoms, the agent can reasonably infer the user's disease type and provide corresponding natural treatment plans and medication treatment plans.
+
+This case is based on the Deepseek large model and the embedding and rerank functions of DashScope. Before use, you need to configure the DASHSCOPE_API_KEY in the environment variables.
+
+## Quick Start
+### Configure API Key
+For example, configure the key information in the custom_key.toml file (this file is used to manage private key configurations in agentUniverse). The discussion group uses DeepSeek as the default base model and Serper as the Google Search tool; the following sections will explain the usage methods of other models or tools.
+```toml
+[KEY_LIST]
+# serper google search key
+SERPER_API_KEY='xxx'
+# deepseek api key
+DEEPSEEK_API_KEY='xxx'
+```
+### Build a Disease Knowledge Base
+The disease knowledge base is built on the knowledge components in agentUniverse. By storing the symptoms and treatment plans of common diseases in ChromaDB and SQLite, it creates a knowledge base that is convenient for agents to access and retrieve.
+
+Materials on Symptoms and Treatment Plans of Common Diseases:
+- Summary of Common Diseases and Symptoms.docx
+- Introduction to Natural Therapies for Common Diseases.docx
+- Drug Recommendations for Common Diseases.docx
+
+disease_knowledge is defined as follows:
+```python
+name: "disease_knowledge"
+description: "常见疾病症状与治疗方法相关的知识库"
+stores:
+ - "disease_symptoms_chroma_store"
+ - "disease_therapy_one_chroma_store"
+ - "disease_therapy_two_chroma_store"
+ - "disease_symptoms_sqlite_store"
+ - "disease_therapy_one_sqlite_store"
+ - "disease_therapy_two_sqlite_store"
+query_paraphrasers:
+ - "custom_query_keyword_extractor"
+insert_processors:
+ - "recursive_character_text_splitter"
+rag_router: "nlu_rag_router"
+post_processors:
+ - "dashscope_reranker"
+readers:
+ docx: "default_docx_reader"
+metadata:
+ type: 'KNOWLEDGE'
+ module: 'sample_rag_app.intelligence.agentic.knowledge.disease_knowledge'
+ class: 'DiseaseKnowledge'
+```
+
+### Code Run
+In the examples/sample_apps/sample_rag_app example project of agentUniverse, locate the legal_advice_rag_agent.py file under the intelligence/test directory. In the chat method, enter the question you want to be answered, then run it.
+
+For example, enter the question: "Xiao Ming has recently had symptoms of fever, accompanied by chills. He experiences lethargy, difficulty concentrating, frequent dizziness, and overall obvious weakness. Please infer the type of disease Xiao Ming has, and recommend treatment methods and medications for him."
+```python
+from agentuniverse.agent.output_object import OutputObject
+from agentuniverse.agent.agent import Agent
+from agentuniverse.agent.agent_manager import AgentManager
+from agentuniverse.base.agentuniverse import AgentUniverse
+
+AgentUniverse().start(config_path='../../config/config.toml', core_mode=True)
+
+
+def chat(question: str):
+ instance: Agent = AgentManager().get_instance_obj('disease_rag_agent')
+ output_object: OutputObject = instance.run(input=question)
+
+ question = f"\nYour event is :\n"
+ question += output_object.get_data('input')
+ print(question)
+
+ background_info = f"\nRetrieved background is :\n"
+ background_info += output_object.get_data('background').replace("\n","")
+ print(background_info)
+
+ res_info = f"\nRag chat bot execution result is :\n"
+ res_info += output_object.get_data('output')
+ print(res_info)
+
+
+if name == '__main__':
+ chat("小明最近出现了发热表现,伴有畏寒现象,精神状态萎靡,注意力难以集中,时常感到头晕目眩,"
+ "整个人呈现出明显的虚弱状态,请推测小明的疾病类型,并为其推荐治疗方法和药物推荐")
+```
+### Result Demonstration
+question: "Xiao Ming has recently had symptoms of fever, accompanied by chills. He experiences lethargy, difficulty concentrating, frequent dizziness, and overall obvious weakness. Please infer the type of disease Xiao Ming has, and recommend treatment methods and medications for him."
+
+
+
+## More Details
+### Reader Component
+- [default_docx_reader](../../../../agentuniverse/agent/action/knowledge/reader/file/docx_reader.yaml)
+
+### DocProcessor Component
+- [custom_query_keyword_extractor](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/doc_processor/query_keyword_extractor.yaml)
+- [recursive_character_text_splitter](../../../../agentuniverse/agent/action/knowledge/doc_processor/recursive_character_text_splitter.yaml)
+
+### QueryParaphraser Component
+- [custom_query_keyword_extractor](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/query_paraphraser/custom_query_keyword_extractor.yaml)
+
+### RagRouter Component
+- [nlu_rag_router](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/rag_router/nlu_rag_router.yaml)
+
+### Store Component
+- [disease_symptoms_chroma_store](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/store/disease_symptoms_chroma_store.yaml)
+- [disease_therapy_one_chroma_store](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/store/disease_therapy_one_chroma_store.yaml)
+- [disease_therapy_two_chroma_store](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/store/disease_therapy_two_chroma_store.yaml)
+- [disease_symptoms_sqlite_store](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/store/disease_symptoms_sqlite_store.yaml)
+- [disease_therapy_one_sqlite_store](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/store/disease_therapy_one_sqlite_store.yaml)
+- [disease_therapy_two_sqlite_store](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/store/disease_therapy_two_sqlite_store.yaml)
+
+For your convenience, we have stored the database files containing relevant information as shown in the figure below.
+
+
+If you want to build the knowledge base from scratch, you can run the __init__.py file in the test folder. The code is as follows:
+
\ No newline at end of file
diff --git a/examples/sample_apps/sample_rag_app/README_zh.md b/examples/sample_apps/sample_rag_app/README_zh.md
new file mode 100644
index 00000000..d04878cb
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/README_zh.md
@@ -0,0 +1,116 @@
+# 医疗咨询助手
+
+本案例基于RagAgentTemplate,搭建了一个简单的医疗咨询智能体,通过检索《常见疾病药物推荐》《常见疾病自然疗法介绍》《常见疾病及症状汇总》中的相关信息并结合用户提供的身体症状的描述合理推断用户的疾病类型并给出相应的自然治疗方案和药物治疗方案。
+
+该案例基于Deepseek大模型和DashScope的embedding和rerank功能,使用前需要您在环境变量中配置DASHSCOPE_API_KEY。
+
+## 快速开始
+### 配置API密钥
+比如在agentUniverse管理私有密钥配置的文件custom_key.toml中配置密钥信息(讨论组默认使用deepseek作为基座模型,serper作为google search工具,下文讲述其他模型或工具使用方法)
+```toml
+[KEY_LIST]
+# serper google search key
+SERPER_API_KEY='xxx'
+# deepseek api key
+DEEPSEEK_API_KEY='xxx'
+```
+### 构建疾病知识库
+疾病知识库基于agentUniverse中的知识组件,通过将常见疾病的症状及治疗方案存储至ChromaDB和Sqlite中,构建方便智能体查阅检索的知识库。
+
+常见疾病的症状及治疗方案资料:
+- 常见疾病及症状汇总.docx
+- 常见疾病自然疗法介绍.docx
+- 常见疾病药物推荐.docx
+
+disease_knowledge定义如下:
+```python
+name: "disease_knowledge"
+description: "常见疾病症状与治疗方法相关的知识库"
+stores:
+ - "disease_symptoms_chroma_store"
+ - "disease_therapy_one_chroma_store"
+ - "disease_therapy_two_chroma_store"
+ - "disease_symptoms_sqlite_store"
+ - "disease_therapy_one_sqlite_store"
+ - "disease_therapy_two_sqlite_store"
+query_paraphrasers:
+ - "custom_query_keyword_extractor"
+insert_processors:
+ - "recursive_character_text_splitter"
+rag_router: "nlu_rag_router"
+post_processors:
+ - "dashscope_reranker"
+readers:
+ docx: "default_docx_reader"
+metadata:
+ type: 'KNOWLEDGE'
+ module: 'sample_rag_app.intelligence.agentic.knowledge.disease_knowledge'
+ class: 'DiseaseKnowledge'
+```
+
+### 运行代码
+在agentUniverse的examples/sample_apps/sample_rag_app示例工程中,找到intelligence/test目录下的legal_advice_rag_agent.py文件,chat方法中输入想要解答的问题,运行即可。
+
+例如,输入问题"小明最近出现了发热表现,伴有畏寒现象,精神状态萎靡,注意力难以集中,时常感到头晕目眩,整个人呈现出明显的虚弱状态,请推测小明的疾病类型,并为其推荐治疗方法和药物推荐"
+```python
+from agentuniverse.agent.output_object import OutputObject
+from agentuniverse.agent.agent import Agent
+from agentuniverse.agent.agent_manager import AgentManager
+from agentuniverse.base.agentuniverse import AgentUniverse
+
+AgentUniverse().start(config_path='../../config/config.toml', core_mode=True)
+
+
+def chat(question: str):
+ instance: Agent = AgentManager().get_instance_obj('disease_rag_agent')
+ output_object: OutputObject = instance.run(input=question)
+
+ question = f"\nYour event is :\n"
+ question += output_object.get_data('input')
+ print(question)
+
+ background_info = f"\nRetrieved background is :\n"
+ background_info += output_object.get_data('background').replace("\n","")
+ print(background_info)
+
+ res_info = f"\nRag chat bot execution result is :\n"
+ res_info += output_object.get_data('output')
+ print(res_info)
+
+
+if name == '__main__':
+ chat("小明最近出现了发热表现,伴有畏寒现象,精神状态萎靡,注意力难以集中,时常感到头晕目眩,"
+ "整个人呈现出明显的虚弱状态,请推测小明的疾病类型,并为其推荐治疗方法和药物推荐")
+```
+### 效果演示
+问题"小明最近出现了发热表现,伴有畏寒现象,精神状态萎靡,注意力难以集中,时常感到头晕目眩,整个人呈现出明显的虚弱状态,请推测小明的疾病类型,并为其推荐治疗方法和药物推荐":
+
+
+
+## 更多细节
+### Reader组件
+- [default_docx_reader](../../../../agentuniverse/agent/action/knowledge/reader/file/docx_reader.yaml)
+
+### DocProcessor组件
+- [custom_query_keyword_extractor](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/doc_processor/query_keyword_extractor.yaml)
+- [recursive_character_text_splitter](../../../../agentuniverse/agent/action/knowledge/doc_processor/recursive_character_text_splitter.yaml)
+
+### QueryParaphraser组件
+- [custom_query_keyword_extractor](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/query_paraphraser/custom_query_keyword_extractor.yaml)
+
+### RagRouter组件
+- [nlu_rag_router](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/rag_router/nlu_rag_router.yaml)
+
+### Store组件
+- [disease_symptoms_chroma_store](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/store/disease_symptoms_chroma_store.yaml)
+- [disease_therapy_one_chroma_store](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/store/disease_therapy_one_chroma_store.yaml)
+- [disease_therapy_two_chroma_store](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/store/disease_therapy_two_chroma_store.yaml)
+- [disease_symptoms_sqlite_store](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/store/disease_symptoms_sqlite_store.yaml)
+- [disease_therapy_one_sqlite_store](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/store/disease_therapy_one_sqlite_store.yaml)
+- [disease_therapy_two_sqlite_store](../../../../examples/sample_apps/rag_app/intelligence/agentic/knowledge/store/disease_therapy_two_sqlite_store.yaml)
+
+为了方便您使用,我们已经将存储有相关信息的数据库文件存储如下图:
+
+
+如果您想从头构建知识库的话,您可以运行test文件夹下的__init__.py文件,代码如下:
+
\ No newline at end of file
diff --git a/examples/sample_apps/sample_rag_app/__init__.py b/examples/sample_apps/sample_rag_app/__init__.py
new file mode 100644
index 00000000..1575af16
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/03 20:51
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/bootstrap/__init__.py b/examples/sample_apps/sample_rag_app/bootstrap/__init__.py
new file mode 100644
index 00000000..e96df3bd
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/bootstrap/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/02 13:01
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/bootstrap/intelligence/__init__.py b/examples/sample_apps/sample_rag_app/bootstrap/intelligence/__init__.py
new file mode 100644
index 00000000..7277793c
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/bootstrap/intelligence/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/02 10:55
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/bootstrap/intelligence/mcp_application.py b/examples/sample_apps/sample_rag_app/bootstrap/intelligence/mcp_application.py
new file mode 100644
index 00000000..61db4346
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/bootstrap/intelligence/mcp_application.py
@@ -0,0 +1,24 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/02 11:26
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: mcp_application.py
+from agentuniverse.agent_serve.web.mcp.mcp_server_manager import MCPServerManager
+from agentuniverse.base.agentuniverse import AgentUniverse
+
+
+class ServerApplication:
+ """
+ Server application.
+ """
+
+ @classmethod
+ def start(cls):
+ AgentUniverse().start(core_mode=True)
+ MCPServerManager().start_server()
+
+
+if __name__ == "__main__":
+ ServerApplication.start()
diff --git a/examples/sample_apps/sample_rag_app/bootstrap/intelligence/server_application.py b/examples/sample_apps/sample_rag_app/bootstrap/intelligence/server_application.py
new file mode 100644
index 00000000..2b6d6b77
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/bootstrap/intelligence/server_application.py
@@ -0,0 +1,24 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/02 11:44
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: server_application.py
+from agentuniverse.agent_serve.web.web_booster import start_web_server
+from agentuniverse.base.agentuniverse import AgentUniverse
+
+
+class ServerApplication:
+ """
+ Server application.
+ """
+
+ @classmethod
+ def start(cls):
+ AgentUniverse().start()
+ start_web_server()
+
+
+if __name__ == "__main__":
+ ServerApplication.start()
diff --git a/examples/sample_apps/sample_rag_app/bootstrap/platform/__init__.py b/examples/sample_apps/sample_rag_app/bootstrap/platform/__init__.py
new file mode 100644
index 00000000..27c4eac1
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/bootstrap/platform/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/02 12:23
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/bootstrap/platform/product_application.py b/examples/sample_apps/sample_rag_app/bootstrap/platform/product_application.py
new file mode 100644
index 00000000..ac662f2d
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/bootstrap/platform/product_application.py
@@ -0,0 +1,26 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/02 12:44
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: product_application.py
+from agentuniverse.base.agentuniverse import AgentUniverse
+from agentuniverse_product.agentuniverse_product import AgentUniverseProduct
+
+
+class ProductApplication:
+ """
+ Product application: agentUniverse-product portal.
+
+ After startup, the system redirects to the aU-product homepage by default.
+ """
+
+ @classmethod
+ def start(cls):
+ AgentUniverse().start(core_mode=True)
+ AgentUniverseProduct().start()
+
+
+if __name__ == "__main__":
+ ProductApplication.start()
diff --git a/examples/sample_apps/sample_rag_app/config/config.toml b/examples/sample_apps/sample_rag_app/config/config.toml
new file mode 100644
index 00000000..4a64e0b8
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/config/config.toml
@@ -0,0 +1,65 @@
+[BASE_INFO]
+# The app name will be applied to all processes including agent service integration.
+appname = 'demo_app'
+
+[CORE_PACKAGE]
+# Perform a full component scan and registration for all the paths under this list.
+default = ['sample_rag_app.intelligence.agentic']
+# Scan and register agent components for all paths under this list, with priority over the default.
+agent = ['sample_rag_app.intelligence.agentic.agent']
+# Scan and register knowledge components for all paths under this list, with priority over the default.
+knowledge = ['sample_rag_app.intelligence.agentic.knowledge']
+# Scan and register llm components for all paths under this list, with priority over the default.
+llm = ['sample_rag_app.intelligence.agentic.llm']
+# Scan and register planner components for all paths under this list, with priority over the default.
+planner = []
+# Scan and register tool components for all paths under this list, with priority over the default.
+tool = ['sample_rag_app.intelligence.agentic.tool']
+# Scan and register memory components for all paths under this list, with priority over the default.
+memory = ['sample_rag_app.intelligence.agentic.memory']
+# Scan and register service components for all paths under this list, with priority over the default.
+service = ['sample_rag_app.intelligence.service.agent_service']
+# Scan and register prompt components for all paths under this list, with priority over the default.
+prompt = ['sample_rag_app.intelligence.agentic.prompt']
+# Scan and register product components for all paths under this list, with priority over the default.
+product = ['sample_rag_app.platform.difizen.product']
+# Scan and register workflow components for all paths under this list, with priority over the default.
+workflow = ['sample_rag_app.platform.difizen.workflow']
+# Scan and register store components for all paths under this list, with priority over the default.
+store = ['sample_rag_app.intelligence.agentic.knowledge.store']
+# Scan and register rag_router components for all paths under this list, with priority over the default.
+rag_router = ['sample_rag_app.intelligence.agentic.knowledge.rag_router']
+# Scan and register doc_processor components for all paths under this list, with priority over the default.
+doc_processor = ['sample_rag_app.intelligence.agentic.knowledge.doc_processor']
+# Scan and register query_paraphraser components for all paths under this list, with priority over the default.
+query_paraphraser = ['sample_rag_app.intelligence.agentic.knowledge.query_paraphraser']
+# Scan and register memory_compressor components for all paths under this list, with priority over the default.
+memory_compressor = ['sample_rag_app.intelligence.agentic.memory.memory_compressor']
+# Scan and register memory_storage components for all paths under this list, with priority over the default.
+memory_storage = ['sample_rag_app.intelligence.agentic.memory.memory_storage']
+
+[SUB_CONFIG_PATH]
+# Log config file path, an absolute path or a relative path based on the dir where the current config file is located.
+log_config_path = './log_config.toml'
+# Custom key file path, use to save your own secret key like open ai or sth else. REMEMBER TO ADD IT TO .gitignore.
+custom_key_path = './custom_key.toml'
+
+[DB]
+# A sqlalchemy db uri used for storing various info, for example, service request, generated during application running.
+# If it's empty, agentUniverse will create a local sqlite db as default choice.
+system_db_uri = ''
+
+[GUNICORN]
+# Use gunicorn as http server when activate is 'true', or only use flask.
+activate = 'false'
+# Gunicorn config file path, an absolute path or a relative path based on the dir where the current config file is located.
+gunicorn_config_path = './gunicorn_config.toml'
+
+[GRPC]
+activate = 'false'
+max_workers = 10
+server_port = 50051
+
+[MONITOR]
+activate = false
+dir = './monitor'
diff --git a/examples/sample_apps/sample_rag_app/config/custom_key.toml.sample b/examples/sample_apps/sample_rag_app/config/custom_key.toml.sample
new file mode 100644
index 00000000..8c3a693e
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/config/custom_key.toml.sample
@@ -0,0 +1,46 @@
+# Example file of custom_key.toml. Rename to custom_key.toml while using.
+[KEY_LIST]
+# Perform a full component scan and registration for all the paths under this list.
+example_key = 'AnExampleKey'
+
+# models
+#kimi default name: default_kimi_llm
+#KIMI_API_KEY='sk-xxxxxxxx'
+#
+##Qwen default name: default_qwen_llm
+#DASHSCOPE_API_KEY='sk-xxxxxx'
+#
+##Opean default name: default_openai_llm
+#OPENAI_API_KEY='sk-xxxxxx'
+#
+##DEEPSEEK default name: default_deepseek_llm
+#DEEPSEEK_API_KEY='sk-xxxxxxx'
+#DEEPSEEK_API_BASE='https://api.deepseek.com/v1'
+#
+## WenXin default name: default_wenxin_llm
+#QIANFAN_AK='xxxx'
+#QIANFAN_SK='xxxx'
+#
+##Ollama default name: default_ollama_llm
+#OLLAMA_BASE_URL='xxxxxx'
+#
+##claude default name: default_claude_llm
+#ANTHROPIC_API_KEY='xxxxxx'
+#ANTHROPIC_API_URL='xxxxxx'
+#
+##baichuan default name: default_baichuan_llm
+#BAICHUAN_API_KEY='xxxxxx'
+#
+##ZHIPU default name: default_zhipu_llm
+#ZHIPU_API_KEY='xxxxxx'
+#ZHIPU_API_BASE='https://open.bigmodel.cn/api/paas/v4/'
+
+# search
+#Google search
+#SERPER_API_KEY='xxxxxx'
+#
+##search api
+#SEARCHAPI_API_KEY='xxxxxx'
+#
+##bing search
+#BING_SUBSCRIPTION_KEY='xxxxxx'
\ No newline at end of file
diff --git a/examples/sample_apps/sample_rag_app/config/gunicorn_config.toml b/examples/sample_apps/sample_rag_app/config/gunicorn_config.toml
new file mode 100644
index 00000000..3b8836de
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/config/gunicorn_config.toml
@@ -0,0 +1,8 @@
+[GUNICORN_CONFIG]
+bind = '0.0.0.0:8888'
+backlog = 2048
+worker_class = 'gthread'
+threads = 4
+workers = 5
+timeout = 60
+keepalive = 10
diff --git a/examples/sample_apps/sample_rag_app/config/log_config.toml b/examples/sample_apps/sample_rag_app/config/log_config.toml
new file mode 100644
index 00000000..d8d1c09e
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/config/log_config.toml
@@ -0,0 +1,32 @@
+[LOG_CONFIG]
+[LOG_CONFIG.BASIC_CONFIG]
+# Loguru log level.
+log_level = "INFO"
+# Output path of the log file. If value is empty, agentuniverse will create a subdir under your workdir to save logs.
+log_path = "./.test_log_dir"
+# Specifies the log rotation policy, controlling when a new log file is created. It can be a time period
+# (e.g., "1 week"), a file size (e.g., "100 MB"), or a function returning True when rotation should occur.
+log_rotation = "100 MB"
+# Specifies the duration to keep old log files. It can be a time span (e.g., "30 days") or a function to filter the
+# files to be retained. Files outside this policy are purged.
+log_retention = "7 days"
+
+[LOG_CONFIG.EXTEND_MODULE]
+# Whether you use Aliyun Simple Log Service (SLS), if the value is "True", you should fill in the ALIYUN_SLS_CONFIG below.
+sls_log = "False"
+
+[LOG_CONFIG.ALIYUN_SLS_CONFIG]
+# Aliyun sls endpoint.
+sls_endpoint = "mock_endpoint"
+# Your sls log project name.
+sls_project = "mock_project"
+# Your sls log store name.
+sls_log_store = "mock_log_store"
+# Aliyun sls access_key_id.
+access_key_id = "mock_key_id"
+# Aliyun sls access_key_secret.
+access_key_secret = "mock_key_secret"
+# Log queue max size, agentuniverse uses a queue to save the logs to be sent, they will be sent periodically.
+sls_log_queue_max_size = 1000
+# Interval of sending logs to aliyun sls.
+sls_log_send_interval = 3.0
diff --git a/examples/sample_apps/sample_rag_app/intelligence/__init__.py b/examples/sample_apps/sample_rag_app/intelligence/__init__.py
new file mode 100644
index 00000000..3b6c9c41
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/04 15:03
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/__init__.py b/examples/sample_apps/sample_rag_app/intelligence/agentic/__init__.py
new file mode 100644
index 00000000..85ba6036
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/06 17:55
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/agent/__init__.py b/examples/sample_apps/sample_rag_app/intelligence/agentic/agent/__init__.py
new file mode 100644
index 00000000..b3864b56
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/agent/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/03 20:55
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/agent/agent_instance/__init__.py b/examples/sample_apps/sample_rag_app/intelligence/agentic/agent/agent_instance/__init__.py
new file mode 100644
index 00000000..76dfa0d9
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/agent/agent_instance/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/03 17:57
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/agent/agent_instance/rag_agent_case/__init__.py b/examples/sample_apps/sample_rag_app/intelligence/agentic/agent/agent_instance/rag_agent_case/__init__.py
new file mode 100644
index 00000000..90e72369
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/agent/agent_instance/rag_agent_case/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/03 17:46
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/agent/agent_instance/rag_agent_case/disease_rag_agent.yaml b/examples/sample_apps/sample_rag_app/intelligence/agentic/agent/agent_instance/rag_agent_case/disease_rag_agent.yaml
new file mode 100644
index 00000000..b22e2159
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/agent/agent_instance/rag_agent_case/disease_rag_agent.yaml
@@ -0,0 +1,34 @@
+info:
+ name: 'disease_rag_agent'
+ description: '个医疗顾问,可以根据用户提供的身体状况描述信息,推测用户的疾病类型并给出相应治疗方案。'
+profile:
+ introduction: 你是一位专业的 ai 医疗顾问,擅长依据各类身体状况相关信息进行分析判断。
+ target: 你的目标是根据用户提供的身体状况描述信息,推测出可能的疾病类型,并给出相应的自然治疗方案和药物治疗方案。
+ instruction: |
+ 你需要遵守的规则是:
+ 1. 必须使用中文结合背景信息做出判决,没有在背景知识中的条例不允许引用。
+ 2. 结构化答案生成,必要时通过空行提升阅读体验。
+ 3. 多考虑背景知识和场景的关联性。
+ 4. 多使用 “根据《XX 医学指南》”“依据《XX 诊疗规范》” 这种句式开头,前提是对应内容确实和所涉条目相关,否则不要提及。
+ 5. 如果背景信息和内容无关则不要引用,引用条例时不要再强调“根据背景信息”这一点。
+
+
+ 背景信息是:
+ {background}
+
+ 事件是: {input}
+ llm_model:
+ name: 'deepseek_llm'
+ model_name: 'deepseek-chat'
+# model_name: 'deepseek-reasoner'
+# name: 'qwen_llm'
+# model_name: 'qwen-max'
+action:
+ tool:
+ - 'google_search_tool'
+ knowledge:
+ - 'disease_knowledge'
+metadata:
+ type: 'AGENT'
+ module: 'agentuniverse.agent.template.rag_agent_template'
+ class: 'RagAgentTemplate'
\ No newline at end of file
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/agent/agent_template/__init__.py b/examples/sample_apps/sample_rag_app/intelligence/agentic/agent/agent_template/__init__.py
new file mode 100644
index 00000000..9cf52da0
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/agent/agent_template/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/03 18:22
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/agent/agent_template/discussion_group_template.py b/examples/sample_apps/sample_rag_app/intelligence/agentic/agent/agent_template/discussion_group_template.py
new file mode 100644
index 00000000..140726b0
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/agent/agent_template/discussion_group_template.py
@@ -0,0 +1,171 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/03 18:30
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: discussion_group_template.py
+from collections import deque
+from typing import Optional
+
+from langchain_core.output_parsers import StrOutputParser
+
+from agentuniverse.agent.agent_manager import AgentManager
+from agentuniverse.agent.input_object import InputObject
+from agentuniverse.agent.memory.memory import Memory
+from agentuniverse.agent.output_object import OutputObject
+from agentuniverse.agent.template.agent_template import AgentTemplate
+from agentuniverse.base.config.component_configer.configers.agent_configer import AgentConfiger
+from agentuniverse.base.util.agent_util import assemble_memory_output, assemble_memory_input
+from agentuniverse.base.util.common_util import stream_output
+from agentuniverse.base.util.logging.logging_util import LOGGER
+from agentuniverse.base.util.prompt_util import process_llm_token
+from agentuniverse.llm.llm import LLM
+from agentuniverse.prompt.chat_prompt import ChatPrompt
+
+
+class DiscussionGroupTemplate(AgentTemplate):
+ participant_names: Optional[list[str]] = None
+ total_round: int = 2
+ topic: Optional[str] = None
+
+ def input_keys(self) -> list[str]:
+ """Return the input keys of the Agent."""
+ return ['input']
+
+ def output_keys(self) -> list[str]:
+ """Return the output keys of the Agent."""
+ return ['output']
+
+ def parse_input(self, input_object: InputObject, agent_input: dict) -> dict:
+ agent_input['input'] = input_object.get_data('input') or self.topic
+ agent_input['participants'] = self.participant_names
+ agent_input['total_round'] = self.total_round
+ return agent_input
+
+ def parse_result(self, agent_result: dict) -> dict:
+ return agent_result
+
+ def execute(self, input_object: InputObject, agent_input: dict, **kwargs) -> dict:
+ participant_agents = self.generate_participant_agents()
+ return self.agents_run(participant_agents, agent_input, input_object)
+
+ def generate_participant_agents(self) -> dict:
+ if len(self.participant_names) == 0:
+ raise ValueError("The participant agents is empty.")
+ agents = dict()
+ for participant_name in self.participant_names:
+ agents[participant_name] = AgentManager().get_instance_obj(participant_name)
+ return agents
+
+ def agents_run(self, participant_agents: dict, agent_input: dict, input_object: InputObject) -> dict:
+ """ Invoke the participant agents and host agent.
+
+ Args:
+ participant_agents (dict): Participant agents.
+ agent_input (dict): Agent input object.
+ input_object (InputObject): The input parameters passed by the user.
+ Returns:
+ dict: The agent result.
+ """
+ total_round: int = self.total_round
+ LOGGER.info(f"The topic of discussion is {agent_input.get('input')}")
+ LOGGER.info(f"The participant agents are {'|'.join(participant_agents.keys())}")
+
+ # The memory list is used to store memory information that will be passed between participant agents.
+ shared_memory_list = deque(maxlen=len(participant_agents) - 1)
+
+ input_object.add_data('total_round', total_round)
+ input_object.add_data('participants', ' and '.join(participant_agents.keys()))
+
+ # get the host agent memory.
+ host_agent_memory: Memory = self.process_memory(agent_input)
+
+ for i in range(total_round):
+ LOGGER.info("------------------------------------------------------------------")
+ LOGGER.info(f"Start a discussion, round is {i + 1}.")
+ for participant_agent_name, participant_agent in participant_agents.items():
+ LOGGER.info("------------------------------------------------------------------")
+ LOGGER.info(f"Start speaking: agent is {participant_agent_name}.")
+ LOGGER.info("------------------------------------------------------------------")
+
+ # invoke participant agent
+ input_object.add_data('chat_history', shared_memory_list)
+ input_object.add_data('agent_name', participant_agent_name)
+ input_object.add_data('cur_round', i + 1)
+ output_object: OutputObject = participant_agent.run(**input_object.to_dict())
+
+ # get the string output.
+ current_output = output_object.get_data('output', '')
+
+ # add the memory to the host agent memory instance.
+ memory_content = (
+ f"the round {i + 1} participant agent in discussion group is: {participant_agent_name}, "
+ f"Human: {agent_input.get('input')}, AI: {current_output}")
+ # append the current memory to the shared memory list.
+ shared_memory_list = assemble_memory_output(host_agent_memory,
+ agent_input,
+ memory_content,
+ participant_agent_name,
+ shared_memory_list)
+
+ # add to the stream queue.
+ stream_output(input_object.get_data('output_stream'), {"data": {
+ 'output': current_output,
+ "agent_info": self.agent_model.info
+ }, "type": "participant_agent"})
+
+ LOGGER.info(
+ f"the round {i + 1} agent {participant_agent_name} thought: {output_object.get_data('output', '')}")
+
+ # concatenate the agent input parameters of the host agent.
+ agent_input['total_round'] = total_round
+ agent_input['participants'] = ' and '.join(participant_agents.keys())
+
+ # finally invoke host agent
+ return self.host_agent_run(agent_input, input_object)
+
+ def host_agent_run(self, agent_input: dict, input_object: InputObject) -> dict:
+ """ Invoke the host agent.
+
+ Args:
+ agent_input (dict): Agent input object.
+ input_object (InputObject): The input parameters passed by the user.
+ Returns:
+ dict: The agent result.
+ """
+ LOGGER.info("------------------------------------------------------------------")
+ LOGGER.info(f"Discussion end.")
+ LOGGER.info(f"Host agent starts summarize the discussion.")
+ LOGGER.info("------------------------------------------------------------------")
+ memory: Memory = self.process_memory(agent_input)
+
+ llm: LLM = self.process_llm()
+
+ prompt: ChatPrompt = self.process_prompt(agent_input)
+ process_llm_token(llm, prompt.as_langchain(), self.agent_model.profile, agent_input)
+
+ assemble_memory_input(memory, agent_input)
+
+ chain = prompt.as_langchain() | llm.as_langchain_runnable(self.agent_model.llm_params()) | StrOutputParser()
+ res = self.invoke_chain(chain, agent_input, input_object)
+
+ content = (f"human: {agent_input.get('input')}, "
+ f"ai: after several rounds of discussions among the participants, "
+ f"the host in the discussion group came to the conclusion:{res}")
+
+ assemble_memory_output(memory, agent_input, content, '')
+
+ LOGGER.info(f"Discussion summary is: {res}")
+ return {**agent_input, 'output': res}
+
+ def initialize_by_component_configer(self, component_configer: AgentConfiger) -> 'DiscussionGroupTemplate':
+ super().initialize_by_component_configer(component_configer)
+ if self.agent_model.profile.get('topic'):
+ self.topic = self.agent_model.profile.get('topic')
+ if self.agent_model.profile.get('participant_names'):
+ self.participant_names = self.agent_model.profile.get('participant_names')
+ if self.agent_model.profile.get('total_round'):
+ self.total_round = self.agent_model.profile.get('total_round')
+ self.prompt_version = self.agent_model.profile.get('prompt_version', 'discussion_group_agent.cn')
+ return self
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/__init__.py b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/__init__.py
new file mode 100644
index 00000000..b8efefb8
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/05 9:20
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/disease_knowledge.py b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/disease_knowledge.py
new file mode 100644
index 00000000..9dbd68fd
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/disease_knowledge.py
@@ -0,0 +1,23 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+from typing import List, Any
+
+# @Time : 2025/10/05 10:13
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: law_knowledge.py
+import json
+
+from agentuniverse.agent.action.knowledge.knowledge import Knowledge
+from agentuniverse.agent.action.knowledge.store.document import Document
+
+
+class DiseaseKnowledge(Knowledge):
+ def to_llm(self, retrieved_docs: List[Document]) -> Any:
+
+ retrieved_texts = [json.dumps({
+ "text": doc.text,
+ "from": doc.metadata["file_name"]
+ },ensure_ascii=False) for doc in retrieved_docs]
+ return '\n=========================================\n'.join(
+ retrieved_texts)
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/disease_knowledge.yaml b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/disease_knowledge.yaml
new file mode 100644
index 00000000..9db10a22
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/disease_knowledge.yaml
@@ -0,0 +1,22 @@
+name: "disease_knowledge"
+description: "常见疾病症状与治疗方法相关的知识库"
+stores:
+ - "disease_symptoms_chroma_store"
+ - "disease_therapy_one_chroma_store"
+ - "disease_therapy_two_chroma_store"
+ - "disease_symptoms_sqlite_store"
+ - "disease_therapy_one_sqlite_store"
+ - "disease_therapy_two_sqlite_store"
+query_paraphrasers:
+ - "custom_query_keyword_extractor"
+insert_processors:
+ - "recursive_character_text_splitter"
+rag_router: "nlu_rag_router"
+post_processors:
+ - "dashscope_reranker"
+readers:
+ docx: "default_docx_reader"
+metadata:
+ type: 'KNOWLEDGE'
+ module: 'sample_rag_app.intelligence.agentic.knowledge.disease_knowledge'
+ class: 'DiseaseKnowledge'
\ No newline at end of file
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/doc_processor/__init__.py b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/doc_processor/__init__.py
new file mode 100644
index 00000000..bb85816a
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/doc_processor/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/05 10:05
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/doc_processor/query_keyword_extractor.yaml b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/doc_processor/query_keyword_extractor.yaml
new file mode 100644
index 00000000..ec1c105e
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/doc_processor/query_keyword_extractor.yaml
@@ -0,0 +1,7 @@
+name: 'query_keyword_extractor'
+description: 'extract keywords from query'
+top_k: 6
+metadata:
+ type: 'DOC_PROCESSOR'
+ module: 'agentuniverse.agent.action.knowledge.doc_processor.jieba_keyword_extractor'
+ class: 'JiebaKeywordExtractor'
\ No newline at end of file
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/query_paraphraser/__init__.py b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/query_paraphraser/__init__.py
new file mode 100644
index 00000000..dc7b8f66
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/query_paraphraser/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/05 10:32
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/query_paraphraser/custom_query_keyword_extractor.yaml b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/query_paraphraser/custom_query_keyword_extractor.yaml
new file mode 100644
index 00000000..91010189
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/query_paraphraser/custom_query_keyword_extractor.yaml
@@ -0,0 +1,7 @@
+name: 'custom_query_keyword_extractor'
+description: 'extract keywords from query origin str'
+keyword_extractor: 'query_keyword_extractor'
+metadata:
+ type: 'QUERY_PARAPHRASER'
+ module: 'agentuniverse.agent.action.knowledge.query_paraphraser.query_keyword_extractor'
+ class: 'QueryKeywordExtractor'
\ No newline at end of file
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/rag_router/__init__.py b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/rag_router/__init__.py
new file mode 100644
index 00000000..9933d567
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/rag_router/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/05 11:24
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/rag_router/nlu_rag_router.yaml b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/rag_router/nlu_rag_router.yaml
new file mode 100644
index 00000000..f945a022
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/rag_router/nlu_rag_router.yaml
@@ -0,0 +1,10 @@
+name: 'nlu_rag_router'
+description: 'base rag router map query to all store'
+store_amount: 2
+llm:
+ name: qwen_llm
+ model_name: qwen-max
+metadata:
+ type: 'RAG_ROUTER'
+ module: 'agentuniverse.agent.action.knowledge.rag_router.nlu_rag_router'
+ class: 'NluRagRouter'
\ No newline at end of file
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/raw_knowledge_file/__init__.py b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/raw_knowledge_file/__init__.py
new file mode 100644
index 00000000..98aaba23
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/raw_knowledge_file/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/05 13:47
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/raw_knowledge_file/常见疾病及症状汇总.docx b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/raw_knowledge_file/常见疾病及症状汇总.docx
new file mode 100644
index 00000000..9dbc919e
Binary files /dev/null and b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/raw_knowledge_file/常见疾病及症状汇总.docx differ
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/raw_knowledge_file/常见疾病自然疗法介绍.docx b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/raw_knowledge_file/常见疾病自然疗法介绍.docx
new file mode 100644
index 00000000..befc9ebd
Binary files /dev/null and b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/raw_knowledge_file/常见疾病自然疗法介绍.docx differ
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/raw_knowledge_file/常见疾病药物推荐.docx b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/raw_knowledge_file/常见疾病药物推荐.docx
new file mode 100644
index 00000000..14bcfe18
Binary files /dev/null and b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/raw_knowledge_file/常见疾病药物推荐.docx differ
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/store/__init__.py b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/store/__init__.py
new file mode 100644
index 00000000..fd834e5a
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/store/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/05 17:32
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/store/disease_symptoms_chroma_store.yaml b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/store/disease_symptoms_chroma_store.yaml
new file mode 100644
index 00000000..5caec5f0
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/store/disease_symptoms_chroma_store.yaml
@@ -0,0 +1,9 @@
+name: 'disease_symptoms_chroma_store'
+description: '保存了常见的疾病及其症状的所有内容,以文本向量形式存储'
+persist_path: '../../intelligence/db/disease_symptoms.db'
+embedding_model: 'dashscope_embedding'
+similarity_top_k: 100
+metadata:
+ type: 'STORE'
+ module: 'agentuniverse.agent.action.knowledge.store.chroma_store'
+ class: 'ChromaStore'
\ No newline at end of file
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/store/disease_symptoms_sqlite_store.yaml b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/store/disease_symptoms_sqlite_store.yaml
new file mode 100644
index 00000000..489d6ad1
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/store/disease_symptoms_sqlite_store.yaml
@@ -0,0 +1,11 @@
+name: 'disease_symptoms_sqlite_store'
+description: '保存了常见疾病及其症状的所有内容,以文本形式存储'
+db_path: '../../intelligence/db/disease_symptoms_sqlite.db'
+k1: 1.5
+b: 0.75
+keyword_extractor: 'jieba_keyword_extractor'
+similarity_top_k: 10
+metadata:
+ type: 'STORE'
+ module: 'agentuniverse.agent.action.knowledge.store.sqlite_store'
+ class: 'SQLiteStore'
\ No newline at end of file
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/store/disease_therapy_one_chroma_store.yaml b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/store/disease_therapy_one_chroma_store.yaml
new file mode 100644
index 00000000..5d4fd18b
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/store/disease_therapy_one_chroma_store.yaml
@@ -0,0 +1,9 @@
+name: 'disease_therapy_one_chroma_store'
+description: '保存了常见疾病及其自然治疗方法的所有内容,以文本向量形式存储'
+persist_path: '../../intelligence/db/disease_therapy_one.db'
+embedding_model: 'dashscope_embedding'
+similarity_top_k: 100
+metadata:
+ type: 'STORE'
+ module: 'agentuniverse.agent.action.knowledge.store.chroma_store'
+ class: 'ChromaStore'
\ No newline at end of file
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/store/disease_therapy_one_sqlite_store.yaml b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/store/disease_therapy_one_sqlite_store.yaml
new file mode 100644
index 00000000..c103d364
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/store/disease_therapy_one_sqlite_store.yaml
@@ -0,0 +1,11 @@
+name: 'disease_therapy_one_sqlite_store'
+description: '保存了常见疾病及其自然治疗方法的所有内容,以文本形式存储'
+db_path: '../../intelligence/db/disease_therapy_one_sqlite.db'
+k1: 1.5
+b: 0.75
+keyword_extractor: 'jieba_keyword_extractor'
+similarity_top_k: 10
+metadata:
+ type: 'STORE'
+ module: 'agentuniverse.agent.action.knowledge.store.sqlite_store'
+ class: 'SQLiteStore'
\ No newline at end of file
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/store/disease_therapy_two_chroma_store.yaml b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/store/disease_therapy_two_chroma_store.yaml
new file mode 100644
index 00000000..35d928a9
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/store/disease_therapy_two_chroma_store.yaml
@@ -0,0 +1,9 @@
+name: 'disease_therapy_two_chroma_store'
+description: '保存了常见疾病及其药物推荐的所有内容,以文本向量形式存储'
+persist_path: '../../intelligence/db/disease_therapy_two.db'
+embedding_model: 'dashscope_embedding'
+similarity_top_k: 100
+metadata:
+ type: 'STORE'
+ module: 'agentuniverse.agent.action.knowledge.store.chroma_store'
+ class: 'ChromaStore'
\ No newline at end of file
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/store/disease_therapy_two_sqlite_store.yaml b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/store/disease_therapy_two_sqlite_store.yaml
new file mode 100644
index 00000000..d964bee1
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/knowledge/store/disease_therapy_two_sqlite_store.yaml
@@ -0,0 +1,11 @@
+name: 'disease_therapy_two_sqlite_store'
+description: '保存了常见疾病及其药物推荐的所有内容,以文本形式存储'
+db_path: '../../intelligence/db/disease_therapy_two_sqlite.db'
+k1: 1.5
+b: 0.75
+keyword_extractor: 'jieba_keyword_extractor'
+similarity_top_k: 10
+metadata:
+ type: 'STORE'
+ module: 'agentuniverse.agent.action.knowledge.store.sqlite_store'
+ class: 'SQLiteStore'
\ No newline at end of file
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/llm/__init__.py b/examples/sample_apps/sample_rag_app/intelligence/agentic/llm/__init__.py
new file mode 100644
index 00000000..e5e9a643
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/llm/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/06 19:09
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/llm/deepseek_llm.yaml b/examples/sample_apps/sample_rag_app/intelligence/agentic/llm/deepseek_llm.yaml
new file mode 100644
index 00000000..15243b88
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/llm/deepseek_llm.yaml
@@ -0,0 +1,8 @@
+name: 'deepseek_llm'
+description: 'default default_deepseek_llm llm with spi'
+model_name: 'deepseek-chat'
+max_tokens: 2000
+metadata:
+ type: 'LLM'
+ module: 'agentuniverse.llm.default.deep_seek_openai_style_llm'
+ class: 'DefaultDeepSeekLLM'
\ No newline at end of file
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/llm/qwen_llm.yaml b/examples/sample_apps/sample_rag_app/intelligence/agentic/llm/qwen_llm.yaml
new file mode 100644
index 00000000..53d667ba
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/llm/qwen_llm.yaml
@@ -0,0 +1,9 @@
+name: 'qwen_llm'
+description: 'demo qwen llm with spi'
+model_name: 'qwen2.5-72b-instruct'
+max_tokens: 2000
+api_key: '${DASHSCOPE_API_KEY}'
+metadata:
+ type: 'LLM'
+ module: 'agentuniverse.llm.default.qwen_openai_style_llm'
+ class: 'QWenOpenAIStyleLLM'
\ No newline at end of file
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/memory/__init__.py b/examples/sample_apps/sample_rag_app/intelligence/agentic/memory/__init__.py
new file mode 100644
index 00000000..e44dc2c4
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/memory/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/06 19:16
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/memory/demo_memory.yaml b/examples/sample_apps/sample_rag_app/intelligence/agentic/memory/demo_memory.yaml
new file mode 100644
index 00000000..f0122e58
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/memory/demo_memory.yaml
@@ -0,0 +1,16 @@
+name: 'demo_memory'
+description: 'demo memory with chroma storage'
+type: 'long_term'
+memory_key: 'chat_history'
+max_tokens: 3000
+memory_compressor: default_memory_compressor
+memory_storages:
+ # here use a ram_memory_storage, which all the memory are store in RAM
+ # and will be lost if this agentUniverse app is reboot
+ # you can change to chroma_memory_storage, which will persist the memory into chroma db
+ # for more info please refer to doc
+ - ram_memory_storage
+metadata:
+ type: 'MEMORY'
+ module: 'agentuniverse.agent.memory.memory'
+ class: 'Memory'
\ No newline at end of file
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/memory/memory_compressor/__init__.py b/examples/sample_apps/sample_rag_app/intelligence/agentic/memory/memory_compressor/__init__.py
new file mode 100644
index 00000000..471d1e30
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/memory/memory_compressor/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/06 19:25
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/memory/memory_storage/__init__.py b/examples/sample_apps/sample_rag_app/intelligence/agentic/memory/memory_storage/__init__.py
new file mode 100644
index 00000000..49ce9bd4
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/memory/memory_storage/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/06 19:44
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/memory/memory_storage/chroma_memory_storage.yaml b/examples/sample_apps/sample_rag_app/intelligence/agentic/memory/memory_storage/chroma_memory_storage.yaml
new file mode 100644
index 00000000..bc4d0877
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/memory/memory_storage/chroma_memory_storage.yaml
@@ -0,0 +1,9 @@
+name: 'chroma_memory_storage'
+description: 'demo chroma memory storage'
+collection_name: 'memory'
+persist_path: '../../db/memory.db'
+embedding_model: 'dashscope_embedding'
+metadata:
+ type: 'MEMORY_STORAGE'
+ module: 'agentuniverse.agent.memory.memory_storage.chroma_memory_storage'
+ class: 'ChromaMemoryStorage'
\ No newline at end of file
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/__init__.py b/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/__init__.py
new file mode 100644
index 00000000..cebca019
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/06 14:23
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/demo_rag_agent_cn.yaml b/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/demo_rag_agent_cn.yaml
new file mode 100644
index 00000000..41dbe5bf
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/demo_rag_agent_cn.yaml
@@ -0,0 +1,23 @@
+introduction: 你是一位精通信息分析的ai助手。
+target: 你的目标是使用中文结合查询的背景信息及你所拥有的知识回答用户提出的问题。
+instruction: |
+ 你需要遵守的规则是:
+ 1. 必须使用中文结合查询的背景信息结合你所拥有的知识回答用户提出的问题。
+ 2. 结构化答案生成,必要时通过空行提升阅读体验。
+ 3. 不采用背景信息中的错误信息。
+ 4. 要考虑答案和问题的相关性,不做对问题没有帮助的回答。
+ 5. 详尽回答问题,重点突出,不过多花哨词藻。
+ 6. 不说模糊的推测。
+
+ 背景信息是:
+ {background}
+
+ 之前的对话:
+ {chat_history}
+
+ 开始!
+
+ 需要回答的问题是: {input}
+metadata:
+ type: 'PROMPT'
+ version: 'demo_rag_agent.cn'
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/demo_rag_agent_en.yaml b/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/demo_rag_agent_en.yaml
new file mode 100644
index 00000000..b00c387d
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/demo_rag_agent_en.yaml
@@ -0,0 +1,23 @@
+Introduction: You are an AI assistant proficient in information analysis.
+Target: Your goal is to answer users' questions in Chinese by combining the background information of the query and the knowledge you possess.
+Instruction: |
+ The rules you need to follow are:
+ 1. Must answer users' questions in Chinese by combining the background information of the query and the knowledge you possess.
+ 2. Generate structured answers, and improve readability through blank lines when necessary.
+ 3. Do not adopt incorrect information from the background information.
+ 4. Consider the relevance between answers and questions, and do not provide answers that are not helpful to the questions.
+ 5. Answer questions in detail, highlight key points, and do not use excessive fancy words.
+ 6. Do not make vague speculations.
+
+ Background is:
+ {background}
+
+ Previous conversations are:
+ {chat_history}
+
+ Begin!
+
+ The question needs to be answered is: {input}
+metadata:
+ type: 'PROMPT'
+ version: 'demo_rag_agent.en'
\ No newline at end of file
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/translation/country_multi_translation_reflection_en.yaml b/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/translation/country_multi_translation_reflection_en.yaml
new file mode 100644
index 00000000..66e45c9b
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/translation/country_multi_translation_reflection_en.yaml
@@ -0,0 +1,37 @@
+introduction: You are an expert linguist specializing in translation from {source_lang} to {target_lang}.
+target: You will be provided with a source text and its translation and your goal is to improve the translation.
+instruction: |
+ Your task is to carefully read a source text and part of a translation of that text from {source_lang} to {target_lang}, and then give constructive criticism and helpful suggestions for improving the translation.
+ The final style and tone of the translation should match the style of {target_lang} colloquially spoken in {country}.
+
+ The source text is below, delimited by XML tags and , and the part that has been translated
+ is delimited by and within the source text. You can use the rest of the source text
+ as context for critiquing the translated part.
+
+
+ {tagged_text}
+
+
+ To reiterate, only part of the text is being translated, shown here again between and :
+
+ {chunk_to_translate}
+
+
+ The translation of the indicated part, delimited below by and , is as follows:
+
+ {init_agent_result}
+
+
+ When writing suggestions, pay attention to whether there are ways to improve the translation's:\n\
+ (i) accuracy (by correcting errors of addition, mistranslation, omission, or untranslated text),\n\
+ (ii) fluency (by applying {target_lang} grammar, spelling and punctuation rules, and ensuring there are no unnecessary repetitions),\n\
+ (iii) style (by ensuring the translations reflect the style of the source text and takes into account any cultural context),\n\
+ (iv) terminology (by ensuring terminology use is consistent and reflects the source text domain; and by only ensuring you use equivalent idioms {target_lang}).\n\
+
+ Write a list of specific, helpful and constructive suggestions for improving the translation.
+ Each suggestion should address one specific part of the translation.
+ Output only the suggestions and nothing else.
+
+metadata:
+ type: 'PROMPT'
+ version: 'country_multi_translation_reflection.en'
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/translation/country_translation_reflection_en.yaml b/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/translation/country_translation_reflection_en.yaml
new file mode 100644
index 00000000..433fd90e
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/translation/country_translation_reflection_en.yaml
@@ -0,0 +1,29 @@
+introduction: You are an expert linguist specializing in translation from {source_lang} to {target_lang}.
+target: You will be provided with a source text and its translation and your goal is to improve the translation.
+instruction: |
+ Your task is to carefully read a source text and a translation from {source_lang} to {target_lang}, and then give constructive criticism and helpful suggestions to improve the translation. \
+ The final style and tone of the translation should match the style of {target_lang} colloquially spoken in {country}.
+
+ The source text and initial translation, delimited by XML tags and , are as follows:
+
+
+ {source_text}
+
+
+
+ {init_agent_result}
+
+
+ When writing suggestions, pay attention to whether there are ways to improve the translation's \n\
+ (i) accuracy (by correcting errors of addition, mistranslation, omission, or untranslated text),\n\
+ (ii) fluency (by applying {target_lang} grammar, spelling and punctuation rules, and ensuring there are no unnecessary repetitions),\n\
+ (iii) style (by ensuring the translations reflect the style of the source text and takes into account any cultural context),\n\
+ (iv) terminology (by ensuring terminology use is consistent and reflects the source text domain; and by only ensuring you use equivalent idioms {target_lang}).\n\
+
+ Write a list of specific, helpful and constructive suggestions for improving the translation.
+ Each suggestion should address one specific part of the translation.
+ Output only the suggestions and nothing else.
+
+metadata:
+ type: 'PROMPT'
+ version: 'country_translation_reflection.en'
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/translation/multi_translation_improve_en.yaml b/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/translation/multi_translation_improve_en.yaml
new file mode 100644
index 00000000..675b4255
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/translation/multi_translation_improve_en.yaml
@@ -0,0 +1,42 @@
+introduction: You are an expert linguist, specializing in translation editing from {source_lang} to {target_lang}.
+target: ' '
+instruction: |
+ Your task is to carefully read, then improve, a translation from {source_lang} to {target_lang}, taking into
+ account a set of expert suggestions and constructive critisms. Below, the source text, initial translation, and expert suggestions are provided.
+
+ The source text is below, delimited by XML tags and , and the part that has been translated
+ is delimited by and within the source text. You can use the rest of the source text
+ as context, but need to provide a translation only of the part indicated by and .
+
+
+ {tagged_text}
+
+
+ To reiterate, only part of the text is being translated, shown here again between and :
+
+ {chunk_to_translate}
+
+
+ The translation of the indicated part, delimited below by and , is as follows:
+
+ {init_agent_result}
+
+
+ The expert translations of the indicated part, delimited below by and , is as follows:
+
+ {reflection_agent_result}
+
+
+ Taking into account the expert suggestions rewrite the translation to improve it, paying attention
+ to whether there are ways to improve the translation's
+
+ (i) accuracy (by correcting errors of addition, mistranslation, omission, or untranslated text),
+ (ii) fluency (by applying {target_lang} grammar, spelling and punctuation rules and ensuring there are no unnecessary repetitions), \
+ (iii) style (by ensuring the translations reflect the style of the source text)
+ (iv) terminology (inappropriate for context, inconsistent use), or
+ (v) other errors.
+
+ Output only the new translation of the indicated part and nothing else.
+metadata:
+ type: 'PROMPT'
+ version: 'multi_translation_improve.en'
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/translation/multi_translation_init_en.yaml b/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/translation/multi_translation_init_en.yaml
new file mode 100644
index 00000000..f1ffdf3d
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/translation/multi_translation_init_en.yaml
@@ -0,0 +1,22 @@
+introduction: 'You are an expert linguist, specializing in translation from {source_lang} to {target_lang}.'
+target: ' '
+instruction: |
+ Your task is provide a professional translation from {source_lang} to {target_lang} of PART of a text.
+
+ The source text is below, delimited by XML tags and . Translate only the part within the source text
+ delimited by and . You can use the rest of the source text as context, but do not translate any
+ of the other text. Do not output anything other than the translation of the indicated part of the text.
+
+
+ {tagged_text}
+
+
+ To reiterate, you should translate only this part of the text, shown here again between and :
+
+ {chunk_to_translate}
+
+
+ Output only the translation of the portion you are asked to translate, and nothing else.
+metadata:
+ type: 'PROMPT'
+ version: 'multi_translation_init.en'
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/translation/multi_translation_reflection_en.yaml b/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/translation/multi_translation_reflection_en.yaml
new file mode 100644
index 00000000..0a3e9b95
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/translation/multi_translation_reflection_en.yaml
@@ -0,0 +1,36 @@
+introduction: You are an expert linguist specializing in translation from {source_lang} to {target_lang}.
+target: You will be provided with a source text and its translation and your goal is to improve the translation.
+instruction: |
+ Your task is to carefully read a source text and part of a translation of that text from {source_lang} to {target_lang}, and then give constructive criticism and helpful suggestions for improving the translation.
+
+ The source text is below, delimited by XML tags and , and the part that has been translated
+ is delimited by and within the source text. You can use the rest of the source text
+ as context for critiquing the translated part.
+
+
+ {tagged_text}
+
+
+ To reiterate, only part of the text is being translated, shown here again between and :
+
+ {chunk_to_translate}
+
+
+ The translation of the indicated part, delimited below by and , is as follows:
+
+ {init_agent_result}
+
+
+ When writing suggestions, pay attention to whether there are ways to improve the translation's:\n\
+ (i) accuracy (by correcting errors of addition, mistranslation, omission, or untranslated text),\n\
+ (ii) fluency (by applying {target_lang} grammar, spelling and punctuation rules, and ensuring there are no unnecessary repetitions),\n\
+ (iii) style (by ensuring the translations reflect the style of the source text and takes into account any cultural context),\n\
+ (iv) terminology (by ensuring terminology use is consistent and reflects the source text domain; and by only ensuring you use equivalent idioms {target_lang}).\n\
+
+ Write a list of specific, helpful and constructive suggestions for improving the translation.
+ Each suggestion should address one specific part of the translation.
+ Output only the suggestions and nothing else.
+
+metadata:
+ type: 'PROMPT'
+ version: 'multi_translation_reflection.en'
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/translation/translation_improve_en.yaml b/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/translation/translation_improve_en.yaml
new file mode 100644
index 00000000..5480d5e8
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/translation/translation_improve_en.yaml
@@ -0,0 +1,33 @@
+introduction: You are an expert linguist specializing in translation from {source_lang} to {target_lang}.
+target: ' '
+instruction: |
+ Your task is to carefully read, then edit, a translation from {source_lang} to {target_lang}, taking into
+ account a list of expert suggestions and constructive criticisms.
+
+ The source text, the initial translation, and the expert linguist suggestions are delimited by XML tags , and \
+ as follows:
+
+
+ {source_text}
+
+
+
+ {init_agent_result}
+
+
+
+ {reflection_agent_result}
+
+
+ Please take into account the expert suggestions when editing the translation. Edit the translation by ensuring:
+
+ (i) accuracy (by correcting errors of addition, mistranslation, omission, or untranslated text),
+ (ii) fluency (by applying {target_lang} grammar, spelling and punctuation rules and ensuring there are no unnecessary repetitions),
+ (iii) style (by ensuring the translations reflect the style of the source text)
+ (iv) terminology (inappropriate for context, inconsistent use), or
+ (v) other errors.
+
+ Output only the new translation and nothing else.
+metadata:
+ type: 'PROMPT'
+ version: 'translation_improve.en'
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/translation/translation_init_en.yaml b/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/translation/translation_init_en.yaml
new file mode 100644
index 00000000..e94cb39f
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/translation/translation_init_en.yaml
@@ -0,0 +1,12 @@
+introduction: You are an expert linguist, specializing in translation from {source_lang} to {target_lang}.
+target: ' '
+instruction: |
+ This is an {source_lang} to {target_lang} translation, please provide the {target_lang} translation for this text.
+ Do not provide any explanations or text apart from the translation.
+ {source_lang}: {source_text}
+
+ {target_lang}:
+
+metadata:
+ type: 'PROMPT'
+ version: 'translation_init.en'
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/translation/translation_reflection_en.yaml b/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/translation/translation_reflection_en.yaml
new file mode 100644
index 00000000..efd887d7
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/prompt/translation/translation_reflection_en.yaml
@@ -0,0 +1,28 @@
+introduction: You are an expert linguist specializing in translation from {source_lang} to {target_lang}.
+target: You will be provided with a source text and its translation and your goal is to improve the translation.
+instruction: |
+ Your task is to carefully read a source text and a translation from {source_lang} to {target_lang}, and then give constructive criticism and helpful suggestions to improve the translation.
+
+ The source text and initial translation, delimited by XML tags and , are as follows:
+
+
+ {source_text}
+
+
+
+ {init_agent_result}
+
+
+ When writing suggestions, pay attention to whether there are ways to improve the translation's
+ (i) accuracy (by correcting errors of addition, mistranslation, omission, or untranslated text),
+ (ii) fluency (by applying {target_lang} grammar, spelling and punctuation rules, and ensuring there are no unnecessary repetitions),
+ (iii) style (by ensuring the translations reflect the style of the source text and takes into account any cultural context),
+ (iv) terminology (by ensuring terminology use is consistent and reflects the source text domain; and by only ensuring you use equivalent idioms {target_lang}).
+
+ Write a list of specific, helpful and constructive suggestions for improving the translation.
+ Each suggestion should address one specific part of the translation.
+ Output only the suggestions and nothing else.
+
+metadata:
+ type: 'PROMPT'
+ version: 'translation_reflection.en'
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/tool/google_search_tool.py b/examples/sample_apps/sample_rag_app/intelligence/agentic/tool/google_search_tool.py
new file mode 100644
index 00000000..245de169
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/tool/google_search_tool.py
@@ -0,0 +1,28 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+# @Time : 2025/10/06 17:14
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: google_search_tool.py
+from typing import Optional
+
+from pydantic import Field
+from langchain_community.utilities.google_serper import GoogleSerperAPIWrapper
+from agentuniverse.agent.action.tool.tool import Tool, ToolInput
+from agentuniverse.base.util.env_util import get_from_env
+
+class GoogleSearchTool(Tool):
+ """The demo google search tool.
+
+ Implement the execute method of demo google search tool, using the `GoogleSerperAPIWrapper` to implement a simple Google search.
+
+ Note:
+ You need to sign up for a free account at https://serper.dev and get the serpher api key (2500 free queries).
+ """
+
+ serper_api_key: Optional[str] = Field(default_factory=lambda: get_from_env("SERPER_API_KEY"))
+
+ def execute(self, input: str):
+ # get top10 results from Google search.
+ search = GoogleSerperAPIWrapper(serper_api_key=self.serper_api_key, k=10, gl="us", hl="en", type="search")
+ return search.run(query=input)
\ No newline at end of file
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/tool/google_search_tool.yaml b/examples/sample_apps/sample_rag_app/intelligence/agentic/tool/google_search_tool.yaml
new file mode 100644
index 00000000..e9889f1f
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/tool/google_search_tool.yaml
@@ -0,0 +1,12 @@
+name: 'google_search_tool'
+description: |
+ 该工具可以用来进行谷歌搜索,工具的输入是你想搜索的内容。
+ 工具输入示例:
+ 示例1: 你想要搜索上海的天气时,工具的输入应该是:上海今天的天气
+ 示例2: 你想要搜索日本的天气时,工具的输入应该是:日本的天气
+tool_type: 'api'
+input_keys: ['input']
+metadata:
+ type: 'TOOL'
+ module: 'sample_rag_app.intelligence.agentic.tool.google_search_tool'
+ class: 'GoogleSearchTool'
\ No newline at end of file
diff --git a/examples/sample_apps/sample_rag_app/intelligence/agentic/work_pattern/__init__.py b/examples/sample_apps/sample_rag_app/intelligence/agentic/work_pattern/__init__.py
new file mode 100644
index 00000000..5794c6d8
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/agentic/work_pattern/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/06 17:33
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/intelligence/service/__init__.py b/examples/sample_apps/sample_rag_app/intelligence/service/__init__.py
new file mode 100644
index 00000000..edd4cb17
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/service/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/10 9:44
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/intelligence/service/agent_service/__init__.py b/examples/sample_apps/sample_rag_app/intelligence/service/agent_service/__init__.py
new file mode 100644
index 00000000..33594c5c
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/service/agent_service/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/10 10:55
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/intelligence/service/classic_service/__init__.py b/examples/sample_apps/sample_rag_app/intelligence/service/classic_service/__init__.py
new file mode 100644
index 00000000..c1b127e2
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/service/classic_service/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/10 12:01
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/intelligence/test/__init__.py b/examples/sample_apps/sample_rag_app/intelligence/test/__init__.py
new file mode 100644
index 00000000..7cdce992
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/test/__init__.py
@@ -0,0 +1,30 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/06 22:14
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
+
+from agentuniverse.base.agentuniverse import AgentUniverse
+from agentuniverse.agent.action.knowledge.knowledge_manager import KnowledgeManager
+
+
+if __name__ == '__main__':
+ AgentUniverse().start(config_path="../../config/config.toml", core_mode=True)
+ disease_symptoms_store_list = ["disease_symptoms_sqlite_store", "disease_symptoms_chroma_store"]
+ disease_therapy_one_store_list = ["disease_therapy_one_sqlite_store", "disease_therapy_one_chroma_store"]
+ disease_therapy_two_store_list = ["disease_therapy_two_sqlite_store", "disease_therapy_two_chroma_store"]
+ disease_knowledge = KnowledgeManager().get_instance_obj("disease_knowledge")
+ disease_knowledge.insert_knowledge(
+ source_path="../resources/常见疾病自然疗法介绍.docx",
+ stores=disease_therapy_one_store_list
+ )
+ disease_knowledge.insert_knowledge(
+ source_path="../resources/常见疾病及症状汇总.docx",
+ stores=disease_symptoms_store_list
+ )
+ disease_knowledge.insert_knowledge(
+ source_path="../resources/常见疾病药物推荐.docx",
+ stores=disease_therapy_two_store_list
+ )
\ No newline at end of file
diff --git a/examples/sample_apps/sample_rag_app/intelligence/test/disease_rag_agent.py b/examples/sample_apps/sample_rag_app/intelligence/test/disease_rag_agent.py
new file mode 100644
index 00000000..1deee987
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/test/disease_rag_agent.py
@@ -0,0 +1,40 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/06 22:30
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: legal_advice_rag_agent.py
+from agentuniverse.agent.output_object import OutputObject
+from agentuniverse.agent.agent import Agent
+from agentuniverse.agent.agent_manager import AgentManager
+from agentuniverse.base.agentuniverse import AgentUniverse
+
+AgentUniverse().start(config_path='../../config/config.toml', core_mode=True)
+
+
+def chat(question: str):
+ """ Rag agent example.
+
+ The rag agent in agentUniverse becomes a chatbot and can ask questions to get the answer.
+ """
+
+ instance: Agent = AgentManager().get_instance_obj('disease_rag_agent')
+ output_object: OutputObject = instance.run(input=question)
+
+ question = f"\nYour event is :\n"
+ question += output_object.get_data('input')
+ print(question)
+
+ background_info = f"\nRetrieved background is :\n"
+ background_info += output_object.get_data('background').replace("\n","")
+ print(background_info)
+
+ res_info = f"\nRag chat bot execution result is :\n"
+ res_info += output_object.get_data('output')
+ print(res_info)
+
+
+if __name__ == '__main__':
+ chat("小明最近出现了发热表现,伴有畏寒现象,精神状态萎靡,注意力难以集中,时常感到头晕目眩,"
+ "整个人呈现出明显的虚弱状态,请推测小明的疾病类型,并为其推荐治疗方法和药物推荐")
diff --git a/examples/sample_apps/sample_rag_app/intelligence/test/test_rag_agent.py b/examples/sample_apps/sample_rag_app/intelligence/test/test_rag_agent.py
new file mode 100644
index 00000000..92bd7ae2
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/test/test_rag_agent.py
@@ -0,0 +1,35 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/06 22:55
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: test_rag_agent.py
+import unittest
+from agentuniverse.agent.agent import Agent
+from agentuniverse.agent.agent_manager import AgentManager
+from agentuniverse.agent.output_object import OutputObject
+from agentuniverse.base.agentuniverse import AgentUniverse
+from agentuniverse.base.agentuniverse import AgentUniverse
+from agentuniverse.agent.action.knowledge.knowledge_manager import KnowledgeManager
+
+class RagAgentTest(unittest.TestCase):
+ """
+ Test cases for the rag agent
+ """
+
+ def setUp(self) -> None:
+ AgentUniverse().start(config_path='../../config/config.toml', core_mode=True)
+
+ def test_rag_agent(self):
+ """Test demo rag agent."""
+ instance: Agent = AgentManager().get_instance_obj('disease_rag_agent')
+ query = '小明最近出现了发热表现,伴有畏寒现象,精神状态萎靡,注意力难以集中,时常感到头晕目眩,整个人呈现出明显的虚弱状态,请推测小明的疾病类型,并为其推荐治疗方法'
+ output_object: OutputObject = instance.run(input=query)
+ res_info = f"\nRag agent execution result is :\n"
+ res_info += output_object.get_data('output')
+ print(res_info)
+
+
+if __name__ == '__main__':
+ unittest.main()
\ No newline at end of file
diff --git a/examples/sample_apps/sample_rag_app/intelligence/utils/__init__.py b/examples/sample_apps/sample_rag_app/intelligence/utils/__init__.py
new file mode 100644
index 00000000..b3fbac1e
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/utils/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/10 16:22
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/intelligence/utils/common/__init__.py b/examples/sample_apps/sample_rag_app/intelligence/utils/common/__init__.py
new file mode 100644
index 00000000..2f758099
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/utils/common/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/10 14:37
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/intelligence/utils/common/jsonl_file_util.py b/examples/sample_apps/sample_rag_app/intelligence/utils/common/jsonl_file_util.py
new file mode 100644
index 00000000..4ea806e6
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/utils/common/jsonl_file_util.py
@@ -0,0 +1,91 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/10 15:26
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: jsonl_file_util.py
+import json
+import os
+import sys
+
+from agentuniverse.base.util.logging.logging_util import LOGGER
+
+DATA_DIR = './data/'
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
+
+
+class JsonFileOps(object):
+ def __init__(self):
+ return
+
+ @classmethod
+ def is_file_exist(cls, file_path):
+ file_name, ext = os.path.splitext(file_path)
+ if ext.lower() != '.jsonl':
+ raise Exception('Unsupported file extension')
+ return os.path.exists(file_path)
+
+
+class JsonFileReader(object):
+ def __init__(self, file_path: str):
+ self.file_handler = None
+ self.file_name = file_path
+ if JsonFileOps.is_file_exist(file_path):
+ self.file_handler = open(file_path, 'r', encoding='utf-8')
+
+ def read_json_obj(self):
+ if not self.file_handler:
+ raise Exception(f"None json file to read: {self.file_name}")
+ json_line = self.file_handler.readline()
+ if json_line:
+ try:
+ json_obj = json.loads(json_line.strip())
+ return json_obj
+ except Exception as e:
+ LOGGER.warn(f"except[read_json_line]>>>{e}:{json_line}")
+ return json.loads('{}')
+ else:
+ return None
+
+ def read_json_obj_list(self):
+ obj_list = []
+ while True:
+ obj = self.read_json_obj()
+ if obj is None:
+ break
+ obj_list.append(obj)
+ return obj_list
+
+
+class JsonFileWriter(object):
+ def __init__(self, output_file_name: str, extension='jsonl', directory=DATA_DIR):
+ self.outfile_path = directory + output_file_name + '.' + extension
+ directory = os.path.dirname(self.outfile_path)
+ if not os.path.exists(directory):
+ os.makedirs(directory)
+ self.outfile_handler = open(self.outfile_path, 'w', encoding='utf-8')
+
+ def write_json_obj(self, json_obj: dict):
+ try:
+ # confirm that it's a json string and then write.
+ json_line = json.dumps(json_obj, ensure_ascii=False)
+ self.outfile_handler.write(json_line.strip() + '\n')
+ self.outfile_handler.flush()
+ except Exception as e:
+ LOGGER.warn(f"except[write_json_obj]>>>{e}:{json_obj}")
+ return
+
+ def write_json_obj_list(self, json_obj_list: list):
+ for i in range(0, len(json_obj_list)):
+ self.write_json_obj(json_obj_list[i])
+ return
+
+ def write_json_query_answer(self, query: str, answer: str):
+ json_obj = {"query": query, "answer": answer}
+ self.write_json_obj(json_obj)
+
+ def write_json_query_answer_list(self, query_answer_list: list):
+ for i in range(0, len(query_answer_list)):
+ self.write_json_query_answer(query_answer_list[i][0], query_answer_list[i][1])
diff --git a/examples/sample_apps/sample_rag_app/intelligence/utils/common/txt_file_util.py b/examples/sample_apps/sample_rag_app/intelligence/utils/common/txt_file_util.py
new file mode 100644
index 00000000..f88d078f
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/intelligence/utils/common/txt_file_util.py
@@ -0,0 +1,50 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/10 16:13
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: txt_file_util.py
+import os
+import sys
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
+
+
+class TxtFileOps(object):
+ def __init__(self):
+ return
+
+ @classmethod
+ def is_file_exist(cls, file_path):
+ file_name, ext = os.path.splitext(file_path)
+ if ext.lower() != '.txt':
+ raise Exception('Unsupported file extension')
+ return os.path.exists(file_path)
+
+
+class TxtFileReader(object):
+
+ def __init__(self, file_path: str):
+ self.file_handler = None
+ self.file_name = file_path
+ if TxtFileOps.is_file_exist(file_path):
+ self.file_handler = open(file_path, 'r', encoding='utf-8')
+
+ def read_txt_obj(self):
+ if not self.file_handler:
+ raise Exception(f"No txt file to read: {self.file_name}")
+ txt_line = self.file_handler.readline()
+ if txt_line:
+ return txt_line.strip()
+ else:
+ return None
+
+ def read_txt_obj_list(self):
+ obj_list = []
+ while True:
+ obj = self.read_txt_obj()
+ if obj is None:
+ break
+ obj_list.append(obj)
+ return obj_list
diff --git a/examples/sample_apps/sample_rag_app/platform/__init__.py b/examples/sample_apps/sample_rag_app/platform/__init__.py
new file mode 100644
index 00000000..a7447171
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/platform/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/11 8:45
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/platform/difizen/__init__.py b/examples/sample_apps/sample_rag_app/platform/difizen/__init__.py
new file mode 100644
index 00000000..0ee6df3b
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/platform/difizen/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/11 9:09
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/platform/difizen/product/__init__.py b/examples/sample_apps/sample_rag_app/platform/difizen/product/__init__.py
new file mode 100644
index 00000000..eaf7d60e
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/platform/difizen/product/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/11 11:53
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/platform/difizen/product/agent/__init__.py b/examples/sample_apps/sample_rag_app/platform/difizen/product/agent/__init__.py
new file mode 100644
index 00000000..c99e26a5
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/platform/difizen/product/agent/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/11 10:11
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/platform/difizen/product/agent/disease_rag_agent_product.yaml b/examples/sample_apps/sample_rag_app/platform/difizen/product/agent/disease_rag_agent_product.yaml
new file mode 100644
index 00000000..c821611f
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/platform/difizen/product/agent/disease_rag_agent_product.yaml
@@ -0,0 +1,12 @@
+id: disease_rag_agent
+nickname: 医疗顾问智能体
+opening_speech: |
+ 您好,欢迎使用医疗顾问智能体,我将根据您提供的身体状况描述信息,推测您可能患有的疾病类型,并给出相应的治疗方案。你可以这样问我:
+ 问题 1: 我最近总是头疼,还伴有头晕和恶心的症状,这可能是什么病,该怎么治疗呢?
+ 问题 2: 我胸口时不时会疼一下,有时候疼得还挺厉害,这大概是什么情况,要如何应对呀?
+type: AGENT
+avatar: ../../../resources/law_agent_logo.png
+metadata:
+ class: AgentProduct
+ module: agentuniverse_product.base.agent_product
+ type: PRODUCT
\ No newline at end of file
diff --git a/examples/sample_apps/sample_rag_app/platform/difizen/product/knowledge/__init__.py b/examples/sample_apps/sample_rag_app/platform/difizen/product/knowledge/__init__.py
new file mode 100644
index 00000000..0a79d025
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/platform/difizen/product/knowledge/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/11 10:41
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/platform/difizen/product/knowledge/disease_knowledge_product.yaml b/examples/sample_apps/sample_rag_app/platform/difizen/product/knowledge/disease_knowledge_product.yaml
new file mode 100644
index 00000000..d33efb52
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/platform/difizen/product/knowledge/disease_knowledge_product.yaml
@@ -0,0 +1,7 @@
+id: disease_knowledge
+nickname: 疾病类型/疾病治疗方法知识库,可以查询疾病类型/疾病治疗方法相关内容
+type: KNOWLEDGE
+metadata:
+ type: 'PRODUCT'
+ module: 'agentuniverse_product.base.product'
+ class: 'Product'
\ No newline at end of file
diff --git a/examples/sample_apps/sample_rag_app/platform/difizen/product/llm/__init__.py b/examples/sample_apps/sample_rag_app/platform/difizen/product/llm/__init__.py
new file mode 100644
index 00000000..5bb0ecc5
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/platform/difizen/product/llm/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/11 11:05
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/platform/difizen/product/llm/qwen_llm_product.yaml b/examples/sample_apps/sample_rag_app/platform/difizen/product/llm/qwen_llm_product.yaml
new file mode 100644
index 00000000..4b832c65
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/platform/difizen/product/llm/qwen_llm_product.yaml
@@ -0,0 +1,7 @@
+id: qwen_llm
+nickname: 千问系列大模型
+type: LLM
+metadata:
+ type: 'PRODUCT'
+ module: 'agentuniverse_product.base.product'
+ class: 'Product'
\ No newline at end of file
diff --git a/examples/sample_apps/sample_rag_app/platform/difizen/product/plugin/__init__.py b/examples/sample_apps/sample_rag_app/platform/difizen/product/plugin/__init__.py
new file mode 100644
index 00000000..1d600b0f
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/platform/difizen/product/plugin/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/11 11:15
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/platform/difizen/product/plugin/google_search_plugin.yaml b/examples/sample_apps/sample_rag_app/platform/difizen/product/plugin/google_search_plugin.yaml
new file mode 100644
index 00000000..104eecbb
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/platform/difizen/product/plugin/google_search_plugin.yaml
@@ -0,0 +1,11 @@
+id: google_search_plugin
+nickname: 谷歌web搜索插件
+avatar: ../../../resources/google_search.png
+description: 谷歌web搜索插件
+type: PLUGIN
+toolset:
+- google_search_tool
+metadata:
+ class: PluginProduct
+ module: agentuniverse_product.base.plugin_product
+ type: PRODUCT
diff --git a/examples/sample_apps/sample_rag_app/platform/difizen/product/tool/__init__.py b/examples/sample_apps/sample_rag_app/platform/difizen/product/tool/__init__.py
new file mode 100644
index 00000000..a072e22e
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/platform/difizen/product/tool/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/11 11:24
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/platform/difizen/product/tool/google_search_product.yaml b/examples/sample_apps/sample_rag_app/platform/difizen/product/tool/google_search_product.yaml
new file mode 100644
index 00000000..31da2c56
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/platform/difizen/product/tool/google_search_product.yaml
@@ -0,0 +1,8 @@
+id: google_search_tool
+nickname: 谷歌web搜索工具
+type: TOOL
+avatar: ../../../resources/google_search.png
+metadata:
+ type: 'PRODUCT'
+ module: 'agentuniverse_product.base.product'
+ class: 'Product'
\ No newline at end of file
diff --git a/examples/sample_apps/sample_rag_app/platform/difizen/resources/disease_agent_logo.png b/examples/sample_apps/sample_rag_app/platform/difizen/resources/disease_agent_logo.png
new file mode 100644
index 00000000..ea6ccaa9
Binary files /dev/null and b/examples/sample_apps/sample_rag_app/platform/difizen/resources/disease_agent_logo.png differ
diff --git a/examples/sample_apps/sample_rag_app/platform/difizen/resources/google_search.png b/examples/sample_apps/sample_rag_app/platform/difizen/resources/google_search.png
new file mode 100644
index 00000000..99c904bd
Binary files /dev/null and b/examples/sample_apps/sample_rag_app/platform/difizen/resources/google_search.png differ
diff --git a/examples/sample_apps/sample_rag_app/platform/difizen/resources/rag_agent_logo.png b/examples/sample_apps/sample_rag_app/platform/difizen/resources/rag_agent_logo.png
new file mode 100644
index 00000000..83e2e723
Binary files /dev/null and b/examples/sample_apps/sample_rag_app/platform/difizen/resources/rag_agent_logo.png differ
diff --git a/examples/sample_apps/sample_rag_app/platform/difizen/workflow/__init__.py b/examples/sample_apps/sample_rag_app/platform/difizen/workflow/__init__.py
new file mode 100644
index 00000000..0c0e00cf
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/platform/difizen/workflow/__init__.py
@@ -0,0 +1,7 @@
+# !/usr/bin/env python3
+# -*- coding:utf-8 -*-
+
+# @Time : 2025/10/11 17:22
+# @Author : zhangxi
+# @Email : 1724585800@qq.com
+# @FileName: __init__.py
diff --git a/examples/sample_apps/sample_rag_app/platform/difizen/workflow/demo_workflow.yaml b/examples/sample_apps/sample_rag_app/platform/difizen/workflow/demo_workflow.yaml
new file mode 100644
index 00000000..808e7a98
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/platform/difizen/workflow/demo_workflow.yaml
@@ -0,0 +1,204 @@
+id: demo_workflow
+name: workflow示例
+description:
+graph:
+ nodes:
+ - id: '1'
+ name: 开始节点
+ description:
+ type: start
+ position:
+ x: -1330.905282101635
+ y: 152.28549219848512
+ data:
+ outputs:
+ - name: input
+ type: string
+ - id: '2'
+ name: 条件判断
+ description:
+ type: ifelse
+ position:
+ x: -652.7418910634103
+ y: 97.80700127653421
+ data:
+ inputs:
+ branches:
+ - name: branch-1
+ conditions:
+ - left:
+ value:
+ type: reference
+ content:
+ - '1'
+ - input
+ compare: equal
+ right:
+ value:
+ type: reference
+ content:
+ - '1'
+ - input
+ - id: '3'
+ name: 谷歌搜索工具
+ description:
+ type: tool
+ position:
+ x: 231.19094445748067
+ y: -602.2866867947636
+ data:
+ inputs:
+ tool_param:
+ - type: string
+ name: id
+ value: google_search_tool
+ input_param:
+ - type: string
+ name: input
+ value:
+ type: reference
+ content:
+ - '1'
+ - input
+ outputs:
+ - name: output
+ type: string
+ - id: '4'
+ name: 千问模型
+ description:
+ type: llm
+ position:
+ x: 1100.9613728387906
+ y: -754.2884138553064
+ data:
+ inputs:
+ llm_param:
+ - name: prompt
+ type: string
+ value:
+ type: value
+ content: "你是一位精通信息分析的ai助手。你的目标是使用中文结合查询的背景信息及你所拥有的知识回答用户提出的问题。\n你需要遵守的规则是:\n
+ 1. 必须使用中文结合查询的背景信息结合你所拥有的知识回答用户提出的问题。\n2. 结构化答案生成,必要时通过空行提升阅读体验。\n3.
+ 不采用背景信息中的错误信息。\n4. 要考虑答案和问题的相关性,不做对问题没有帮助的回答。\n5. 详尽回答问题,重点突出,不过多花哨词藻。\n
+ 6. 不说模糊的推测。\n7. 尽量多的使用数值类信息。\n\n背景信息是:\n{{background}}\n\n开始!\n需要回答的问题是:
+ {{input}}\n"
+ - name: id
+ type: string
+ value:
+ type: value
+ content: qwen_llm
+ - name: temperature
+ type: string
+ value:
+ type: value
+ content: 0.5
+ - name: model_name
+ type: string
+ value:
+ type: value
+ content: qwen-max
+ input_param:
+ - type: string
+ name: input
+ value:
+ type: reference
+ content:
+ - '1'
+ - input
+ - type: string
+ name: background
+ value:
+ type: reference
+ content:
+ - '3'
+ - output
+ outputs:
+ - type: string
+ name: output
+ - id: '6'
+ name: rag智能体
+ description:
+ type: agent
+ position:
+ x: 561.6832958205491
+ y: 336.28244369703157
+ data:
+ inputs:
+ agent_param:
+ - type: string
+ name: id
+ value: demo_rag_agent
+ - type: string
+ name: prompt
+ value:
+ type: value
+ content: '{{input}}'
+ input_param:
+ - type: string
+ name: input
+ value:
+ type: reference
+ content:
+ - '1'
+ - input
+ outputs:
+ - name: output
+ type: string
+ - id: '7'
+ name: 结束节点
+ description:
+ type: end
+ position:
+ x: 2338.342324226776
+ y: 22.21126722945681
+ data:
+ inputs:
+ input_param:
+ - type: string
+ name: input1
+ value:
+ type: reference
+ content:
+ - '4'
+ - output
+ - type: string
+ name: input2
+ value:
+ type: reference
+ content:
+ - '6'
+ - output
+ prompt:
+ type: string
+ name: input
+ value:
+ type: value
+ content: 答案是 {{input1}} 或者 {{input2}}
+ outputs:
+ - name: output
+ type: string
+ edges:
+ - id: 1-2
+ source_node_id: '1'
+ target_node_id: '2'
+ - id: 2-3
+ source_handler: branch-1
+ source_node_id: '2'
+ target_node_id: '3'
+ - id: 3-4
+ source_node_id: '3'
+ target_node_id: '4'
+ - id: 4-7
+ source_node_id: '4'
+ target_node_id: '7'
+ - id: 6-7
+ source_node_id: '6'
+ target_node_id: '7'
+ - id: 2-6
+ source_handler: branch-default
+ source_node_id: '2'
+ target_node_id: '6'
+metadata:
+ class: Workflow
+ module: agentuniverse.workflow.workflow
+ type: WORKFLOW
diff --git a/examples/sample_apps/sample_rag_app/poetry.toml b/examples/sample_apps/sample_rag_app/poetry.toml
new file mode 100644
index 00000000..ab1033bd
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/poetry.toml
@@ -0,0 +1,2 @@
+[virtualenvs]
+in-project = true
diff --git a/examples/sample_apps/sample_rag_app/pyproject.toml b/examples/sample_apps/sample_rag_app/pyproject.toml
new file mode 100644
index 00000000..3f3d0e7a
--- /dev/null
+++ b/examples/sample_apps/sample_rag_app/pyproject.toml
@@ -0,0 +1,105 @@
+[tool.poetry]
+name = "sample_standard_app"
+version = "0.0.1"
+description = "This is a sample project for agentuniverse."
+authors = ["AntGroup "]
+repository = "https://github.com/agentuniverse-ai/agentUniverse/tree/master/sample_standard_app"
+readme = "README.md"
+packages = [
+ { include = "sample_standard_app" }
+]
+
+[tool.poetry.dependencies]
+python = "^3.10"
+agentUniverse = "^0.0.15"
+
+[tool.poetry.group.dev.dependencies]
+pytest = "^7.2.0"
+pytest-cov = "^4.0.0"
+deptry = "^0.6.4"
+pre-commit = "^2.20.0"
+
+
+[[tool.poetry.source]]
+name = "china"
+url = "https://mirrors.aliyun.com/pypi/simple/"
+priority = "primary"
+
+[[tool.poetry.source]]
+name = "pipy"
+url = "https://pypi.org/simple/"
+priority = "supplemental"
+
+[build-system]
+requires = ["poetry-core>=1.0.0"]
+build-backend = "poetry.core.masonry.api"
+
+[tool.black]
+line-length = 120
+target-version = ['py310']
+preview = true
+
+[tool.mypy]
+files = ["agentuniverse"]
+disallow_untyped_defs = "True"
+disallow_any_unimported = "True"
+no_implicit_optional = "True"
+check_untyped_defs = "True"
+warn_return_any = "True"
+warn_unused_ignores = "True"
+show_error_codes = "True"
+
+[tool.ruff]
+target-version = "py37"
+line-length = 120
+fix = true
+select = [
+ # flake8-2020
+ "YTT",
+ # flake8-bandit
+ "S",
+ # flake8-bugbear
+ "B",
+ # flake8-builtins
+ "A",
+ # flake8-comprehensions
+ "C4",
+ # flake8-debugger
+ "T10",
+ # flake8-simplify
+ "SIM",
+ # isort
+ "I",
+ # mccabe
+ "C90",
+ # pycodestyle
+ "E", "W",
+ # pyflakes
+ "F",
+ # pygrep-hooks
+ "PGH",
+ # pyupgrade
+ "UP",
+ # ruff
+ "RUF",
+ # tryceratops
+ "TRY",
+]
+ignore = [
+ # LineTooLong
+ "E501",
+ # DoNotAssignLambda
+ "E731",
+]
+
+[tool.ruff.per-file-ignores]
+"tests/*" = ["S101"]
+
+[tool.coverage.report]
+skip_empty = true
+
+[tool.coverage.run]
+branch = true
+source = ["sample_standard_app"]
+
+