agentica 0.1.6__tar.gz → 0.1.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. {agentica-0.1.6 → agentica-0.1.8}/PKG-INFO +51 -38
  2. {agentica-0.1.6 → agentica-0.1.8}/README.md +50 -37
  3. {agentica-0.1.6 → agentica-0.1.8}/agentica/__init__.py +10 -3
  4. {agentica-0.1.6 → agentica-0.1.8}/agentica/emb/huggingface_emb.py +9 -0
  5. {agentica-0.1.6 → agentica-0.1.8}/agentica/llm/claude_llm.py +3 -8
  6. {agentica-0.1.6 → agentica-0.1.8}/agentica/tools/search_serper.py +5 -4
  7. {agentica-0.1.6 → agentica-0.1.8}/agentica/utils/file_parser.py +22 -1
  8. agentica-0.1.8/agentica/version.py +1 -0
  9. {agentica-0.1.6 → agentica-0.1.8}/agentica.egg-info/PKG-INFO +51 -38
  10. agentica-0.1.6/agentica/version.py +0 -1
  11. {agentica-0.1.6 → agentica-0.1.8}/LICENSE +0 -0
  12. {agentica-0.1.6 → agentica-0.1.8}/agentica/assistant.py +0 -0
  13. {agentica-0.1.6 → agentica-0.1.8}/agentica/config.py +0 -0
  14. {agentica-0.1.6 → agentica-0.1.8}/agentica/document.py +0 -0
  15. {agentica-0.1.6 → agentica-0.1.8}/agentica/emb/__init__.py +0 -0
  16. {agentica-0.1.6 → agentica-0.1.8}/agentica/emb/azure_openai_emb.py +0 -0
  17. {agentica-0.1.6 → agentica-0.1.8}/agentica/emb/base.py +0 -0
  18. {agentica-0.1.6 → agentica-0.1.8}/agentica/emb/fireworks_emb.py +0 -0
  19. {agentica-0.1.6 → agentica-0.1.8}/agentica/emb/genimi_emb.py +0 -0
  20. {agentica-0.1.6 → agentica-0.1.8}/agentica/emb/hash_emb.py +0 -0
  21. {agentica-0.1.6 → agentica-0.1.8}/agentica/emb/ollama_emb.py +0 -0
  22. {agentica-0.1.6 → agentica-0.1.8}/agentica/emb/openai_emb.py +0 -0
  23. {agentica-0.1.6 → agentica-0.1.8}/agentica/emb/sentence_transformer_emb.py +0 -0
  24. {agentica-0.1.6 → agentica-0.1.8}/agentica/emb/text2vec_emb.py +0 -0
  25. {agentica-0.1.6 → agentica-0.1.8}/agentica/emb/together_emb.py +0 -0
  26. {agentica-0.1.6 → agentica-0.1.8}/agentica/emb/word2vec_emb.py +0 -0
  27. {agentica-0.1.6 → agentica-0.1.8}/agentica/file/__init__.py +0 -0
  28. {agentica-0.1.6 → agentica-0.1.8}/agentica/file/base.py +0 -0
  29. {agentica-0.1.6 → agentica-0.1.8}/agentica/file/csv.py +0 -0
  30. {agentica-0.1.6 → agentica-0.1.8}/agentica/file/txt.py +0 -0
  31. {agentica-0.1.6 → agentica-0.1.8}/agentica/knowledge/__init__.py +0 -0
  32. {agentica-0.1.6 → agentica-0.1.8}/agentica/knowledge/knowledge_base.py +0 -0
  33. {agentica-0.1.6 → agentica-0.1.8}/agentica/knowledge/langchain.py +0 -0
  34. {agentica-0.1.6 → agentica-0.1.8}/agentica/knowledge/llamaindex.py +0 -0
  35. {agentica-0.1.6 → agentica-0.1.8}/agentica/llm/__init__.py +0 -0
  36. {agentica-0.1.6 → agentica-0.1.8}/agentica/llm/azure_openai_llm.py +0 -0
  37. {agentica-0.1.6 → agentica-0.1.8}/agentica/llm/base.py +0 -0
  38. {agentica-0.1.6 → agentica-0.1.8}/agentica/llm/deepseek_llm.py +0 -0
  39. {agentica-0.1.6 → agentica-0.1.8}/agentica/llm/moonshot_llm.py +0 -0
  40. {agentica-0.1.6 → agentica-0.1.8}/agentica/llm/ollama_llm.py +0 -0
  41. {agentica-0.1.6 → agentica-0.1.8}/agentica/llm/ollama_tools_llm.py +0 -0
  42. {agentica-0.1.6 → agentica-0.1.8}/agentica/llm/openai_llm.py +0 -0
  43. {agentica-0.1.6 → agentica-0.1.8}/agentica/llm/togetherllm.py +0 -0
  44. {agentica-0.1.6 → agentica-0.1.8}/agentica/memory.py +0 -0
  45. {agentica-0.1.6 → agentica-0.1.8}/agentica/message.py +0 -0
  46. {agentica-0.1.6 → agentica-0.1.8}/agentica/python_assistant.py +0 -0
  47. {agentica-0.1.6 → agentica-0.1.8}/agentica/references.py +0 -0
  48. {agentica-0.1.6 → agentica-0.1.8}/agentica/run_record.py +0 -0
  49. {agentica-0.1.6 → agentica-0.1.8}/agentica/storage/__init__.py +0 -0
  50. {agentica-0.1.6 → agentica-0.1.8}/agentica/storage/base.py +0 -0
  51. {agentica-0.1.6 → agentica-0.1.8}/agentica/storage/pg_storage.py +0 -0
  52. {agentica-0.1.6 → agentica-0.1.8}/agentica/storage/sqlite_storage.py +0 -0
  53. {agentica-0.1.6 → agentica-0.1.8}/agentica/task.py +0 -0
  54. {agentica-0.1.6 → agentica-0.1.8}/agentica/template.py +0 -0
  55. {agentica-0.1.6 → agentica-0.1.8}/agentica/tools/__init__.py +0 -0
  56. {agentica-0.1.6 → agentica-0.1.8}/agentica/tools/airflow.py +0 -0
  57. {agentica-0.1.6 → agentica-0.1.8}/agentica/tools/analyze_image.py +0 -0
  58. {agentica-0.1.6 → agentica-0.1.8}/agentica/tools/apify.py +0 -0
  59. {agentica-0.1.6 → agentica-0.1.8}/agentica/tools/arxiv.py +0 -0
  60. {agentica-0.1.6 → agentica-0.1.8}/agentica/tools/base.py +0 -0
  61. {agentica-0.1.6 → agentica-0.1.8}/agentica/tools/create_image.py +0 -0
  62. {agentica-0.1.6 → agentica-0.1.8}/agentica/tools/dblp.py +0 -0
  63. {agentica-0.1.6 → agentica-0.1.8}/agentica/tools/duckduckgo.py +0 -0
  64. {agentica-0.1.6 → agentica-0.1.8}/agentica/tools/file.py +0 -0
  65. {agentica-0.1.6 → agentica-0.1.8}/agentica/tools/hackernews.py +0 -0
  66. {agentica-0.1.6 → agentica-0.1.8}/agentica/tools/jina.py +0 -0
  67. {agentica-0.1.6 → agentica-0.1.8}/agentica/tools/ocr.py +0 -0
  68. {agentica-0.1.6 → agentica-0.1.8}/agentica/tools/run_nb_code.py +0 -0
  69. {agentica-0.1.6 → agentica-0.1.8}/agentica/tools/run_python_code.py +0 -0
  70. {agentica-0.1.6 → agentica-0.1.8}/agentica/tools/search_exa.py +0 -0
  71. {agentica-0.1.6 → agentica-0.1.8}/agentica/tools/shell.py +0 -0
  72. {agentica-0.1.6 → agentica-0.1.8}/agentica/tools/sql.py +0 -0
  73. {agentica-0.1.6 → agentica-0.1.8}/agentica/tools/url_crawler.py +0 -0
  74. {agentica-0.1.6 → agentica-0.1.8}/agentica/tools/wikipedia.py +0 -0
  75. {agentica-0.1.6 → agentica-0.1.8}/agentica/tools/yfinance.py +0 -0
  76. {agentica-0.1.6 → agentica-0.1.8}/agentica/utils/__init__.py +0 -0
  77. {agentica-0.1.6 → agentica-0.1.8}/agentica/utils/log.py +0 -0
  78. {agentica-0.1.6 → agentica-0.1.8}/agentica/utils/misc.py +0 -0
  79. {agentica-0.1.6 → agentica-0.1.8}/agentica/utils/shell.py +0 -0
  80. {agentica-0.1.6 → agentica-0.1.8}/agentica/utils/timer.py +0 -0
  81. {agentica-0.1.6 → agentica-0.1.8}/agentica/vectordb/__init__.py +0 -0
  82. {agentica-0.1.6 → agentica-0.1.8}/agentica/vectordb/base.py +0 -0
  83. {agentica-0.1.6 → agentica-0.1.8}/agentica/vectordb/chromadb.py +0 -0
  84. {agentica-0.1.6 → agentica-0.1.8}/agentica/vectordb/lancedb.py +0 -0
  85. {agentica-0.1.6 → agentica-0.1.8}/agentica/vectordb/memory_vectordb.py +0 -0
  86. {agentica-0.1.6 → agentica-0.1.8}/agentica/vectordb/pgvector.py +0 -0
  87. {agentica-0.1.6 → agentica-0.1.8}/agentica/vectordb/pineconedb.py +0 -0
  88. {agentica-0.1.6 → agentica-0.1.8}/agentica/vectordb/qdrant.py +0 -0
  89. {agentica-0.1.6 → agentica-0.1.8}/agentica/workflow.py +0 -0
  90. {agentica-0.1.6 → agentica-0.1.8}/agentica.egg-info/SOURCES.txt +0 -0
  91. {agentica-0.1.6 → agentica-0.1.8}/agentica.egg-info/dependency_links.txt +0 -0
  92. {agentica-0.1.6 → agentica-0.1.8}/agentica.egg-info/entry_points.txt +0 -0
  93. {agentica-0.1.6 → agentica-0.1.8}/agentica.egg-info/not-zip-safe +0 -0
  94. {agentica-0.1.6 → agentica-0.1.8}/agentica.egg-info/requires.txt +0 -0
  95. {agentica-0.1.6 → agentica-0.1.8}/agentica.egg-info/top_level.txt +0 -0
  96. {agentica-0.1.6 → agentica-0.1.8}/setup.cfg +0 -0
  97. {agentica-0.1.6 → agentica-0.1.8}/setup.py +0 -0
  98. {agentica-0.1.6 → agentica-0.1.8}/tests/__init__.py +0 -0
  99. {agentica-0.1.6 → agentica-0.1.8}/tests/test_create_image.py +0 -0
  100. {agentica-0.1.6 → agentica-0.1.8}/tests/test_jina_tool.py +0 -0
  101. {agentica-0.1.6 → agentica-0.1.8}/tests/test_llm.py +0 -0
  102. {agentica-0.1.6 → agentica-0.1.8}/tests/test_moonshot_llm.py +0 -0
  103. {agentica-0.1.6 → agentica-0.1.8}/tests/test_run_nb_code.py +0 -0
  104. {agentica-0.1.6 → agentica-0.1.8}/tests/test_sqlite_storage.py +0 -0
  105. {agentica-0.1.6 → agentica-0.1.8}/tests/test_url_crawler.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: agentica
3
- Version: 0.1.6
3
+ Version: 0.1.8
4
4
  Summary: LLM agents
5
5
  Home-page: https://github.com/shibing624/agentica
6
6
  Author: XuMing
@@ -49,26 +49,25 @@ Requires-Dist: rich
49
49
  [![Wechat Group](https://img.shields.io/badge/wechat-group-green.svg?logo=wechat)](#Contact)
50
50
 
51
51
 
52
- **Agentica**: A Human-Centric Framework for Large Language Model Agent Building.
53
-
54
- **Agentica**: 构建你自己的Agent
52
+ **Agentica**: A Human-Centric Framework for Large Language Model Agent Building. 快速打造你的专属Agent。
55
53
 
56
54
  ## Overview
57
55
 
58
56
  #### LLM Agent
59
- ![llm_agnet](https://github.com/shibing624/agentica/blob/main/docs/llm_agentv2.png)
57
+ <img src="https://github.com/shibing624/agentica/blob/main/docs/llm_agentv2.png" width="800" />
60
58
 
61
59
  - **规划(Planning)**:任务拆解、生成计划、反思
62
60
  - **记忆(Memory)**:短期记忆(prompt实现)、长期记忆(RAG实现)
63
61
  - **工具使用(Tool use)**:function call能力,调用外部API,以获取外部信息,包括当前日期、日历、代码执行能力、对专用信息源的访问等
64
62
 
65
- #### Agentica架构
66
- ![agentica_arch](https://github.com/shibing624/agentica/blob/main/docs/agent_arch.png)
63
+ #### Agentica Assistant Architecture
64
+ <img src="https://github.com/shibing624/agentica/blob/main/docs/agent_arch.png" width="800" />
67
65
 
68
66
  - **Planner**:负责让LLM生成一个多步计划来完成复杂任务,生成相互依赖的“链式计划”,定义每一步所依赖的上一步的输出
69
67
  - **Worker**:接受“链式计划”,循环遍历计划中的每个子任务,并调用工具完成任务,可以自动反思纠错以完成任务
70
68
  - **Solver**:求解器将所有这些输出整合为最终答案
71
69
 
70
+
72
71
  ## Features
73
72
  `Agentica`是一个Agent构建工具,功能:
74
73
 
@@ -116,30 +115,38 @@ python web_search_deepseek_demo.py
116
115
  自动调用google搜索工具,示例[examples/web_search_deepseek_demo.py](https://github.com/shibing624/agentica/blob/main/examples/web_search_deepseek_demo.py)
117
116
 
118
117
  ```python
119
- from agentica import Assistant, DeepseekLLM
120
- from agentica.tools.search_serper import SearchSerperTool
121
-
122
- m = Assistant(
123
- llm=DeepseekLLM(),
124
- description="You are a helpful ai assistant.",
125
- show_tool_calls=True,
126
- # Enable the assistant to search the knowledge base
127
- search_knowledge=False,
128
- tools=[SearchSerperTool()],
129
- # Enable the assistant to read the chat history
130
- read_chat_history=True,
131
- debug_mode=True,
132
- )
118
+ from agentica import Assistant, DeepseekLLM, SearchSerperTool
119
+
120
+ m = Assistant(llm=DeepseekLLM(), tools=[SearchSerperTool()])
133
121
 
134
122
  r = m.run("一句话介绍林黛玉")
135
123
  print(r, "".join(r))
136
- r = m.run("北京最近的新闻top3", stream=True, print_output=True)
124
+ r = m.run("北京最近的新闻top3", stream=True)
137
125
  print(r, "".join(r))
138
- r = m.run("总结前面的问答", stream=False, print_output=False)
126
+ r = m.run("总结前面的问答", stream=False)
139
127
  print(r)
140
128
  ```
141
129
 
142
130
 
131
+ ## Web UI
132
+
133
+ [shibing624/ChatPilot](https://github.com/shibing624/ChatPilot) 兼容`agentica`,可以通过Web UI进行交互。
134
+
135
+ Web Demo: https://chat.mulanai.com
136
+
137
+ <img src="https://github.com/shibing624/ChatPilot/blob/main/docs/shot.png" width="800" />
138
+
139
+ ```shell
140
+ git clone https://github.com/shibing624/ChatPilot.git
141
+ cd ChatPilot
142
+ pip install -r requirements.txt
143
+
144
+ cp .env.example .env
145
+
146
+ bash start.sh
147
+ ```
148
+
149
+
143
150
  ## Examples
144
151
 
145
152
  | 示例 | 描述 |
@@ -151,19 +158,20 @@ print(r)
151
158
  | [examples/team_news_article_demo.py](https://github.com/shibing624/agentica/blob/main/examples/team_news_article_demo.py) | 实现了写新闻稿的team协作,multi-role实现,委托不用角色完成各自任务:研究员检索分析文章,撰写员根据排版写文章,汇总多角色成果输出结果 |
152
159
  | [examples/workflow_news_article_demo.py](https://github.com/shibing624/agentica/blob/main/examples/workflow_news_article_demo.py) | 实现了写新闻稿的工作流,multi-agent的实现,定义了多个Assistant和Task,多次调用搜索工具,并生成高级排版的新闻文章 |
153
160
  | [examples/workflow_investment_demo.py](https://github.com/shibing624/agentica/blob/main/examples/workflow_investment_demo.py) | 实现了投资研究的工作流:股票信息收集 - 股票分析 - 撰写分析报告 - 复查报告等多个Task |
154
- | [examples/crawl_webpage_demo.py](https://github.com/shibing624/agentica/blob/main/examples/crawl_webpage_demo.py) | 实现了网页分析工作流:从Url爬取融资快讯 - 分析网页内容和格式 - 提取核心信息 - 汇总保存为md文件 |
161
+ | [examples/crawl_webpage_demo.py](https://github.com/shibing624/agentica/blob/main/examples/crawl_webpage_demo.py) | 实现了网页分析工作流:从Url爬取融资快讯 - 分析网页内容和格式 - 提取核心信息 - 汇总保存为md文件 |
155
162
  | [examples/find_paper_from_arxiv_demo.py](https://github.com/shibing624/agentica/blob/main/examples/find_paper_from_arxiv_demo.py) | 实现了论文推荐工作流:自动从arxiv搜索多组论文 - 相似论文去重 - 提取核心论文信息 - 保存为csv文件 |
156
163
  | [examples/remove_image_background_demo.py](https://github.com/shibing624/agentica/blob/main/examples/remove_image_background_demo.py) | 实现了自动去除图片背景功能,包括自动通过pip安装库,调用库实现去除图片背景 |
157
164
  | [examples/text_classification_demo.py](https://github.com/shibing624/agentica/blob/main/examples/text_classification_demo.py) | 实现了自动训练分类模型的工作流:读取训练集文件并理解格式 - 谷歌搜索pytextclassifier库 - 爬取github页面了解pytextclassifier的调用方法 - 写代码并执行fasttext模型训练 - check训练好的模型预测结果 |
158
165
  | [examples/llm_os_demo.py](https://github.com/shibing624/agentica/blob/main/examples/llm_os_demo.py) | 实现了LLM OS的初步设计,基于LLM设计操作系统,可以通过LLM调用RAG、代码执行器、Shell等工具,并协同代码解释器、研究助手、投资助手等来解决问题。 |
159
- | [examples/workflow_write_novel_demo.py](https://github.com/shibing624/agentica/blob/main/examples/workflow_write_novel_demo.py) | 实现了写小说的工作流:定小说提纲 - 搜索谷歌反思提纲 - 撰写小说内容 - 保存为md文件 |
160
- | [examples/workflow_write_tutorial_demo.py](https://github.com/shibing624/agentica/blob/main/examples/workflow_write_tutorial_demo.py) | 实现了写技术教程的工作流:定教程目录 - 反思目录内容 - 撰写教程内容 - 保存为md文件 |
166
+ | [examples/workflow_write_novel_demo.py](https://github.com/shibing624/agentica/blob/main/examples/workflow_write_novel_demo.py) | 实现了写小说的工作流:定小说提纲 - 搜索谷歌反思提纲 - 撰写小说内容 - 保存为md文件 |
167
+ | [examples/workflow_write_tutorial_demo.py](https://github.com/shibing624/agentica/blob/main/examples/workflow_write_tutorial_demo.py) | 实现了写技术教程的工作流:定教程目录 - 反思目录内容 - 撰写教程内容 - 保存为md文件 |
168
+ | [examples/self_evolving_agent_demo.py](https://github.com/shibing624/agentica/blob/main/examples/self_evolving_agent_demo.py) | 实现了基于长期记忆的自我进化智能体,可以基于历史问答信息自我调整决策 |
161
169
 
162
170
 
163
171
  ### LLM OS
164
172
  The LLM OS design:
165
173
 
166
- <img alt="LLM OS" src="https://github.com/shibing624/agentica/blob/main/docs/llmos.png" width="600" />
174
+ <img alt="LLM OS" src="https://github.com/shibing624/agentica/blob/main/docs/llmos.png" width="800" />
167
175
 
168
176
  #### Run the LLM OS App
169
177
 
@@ -172,26 +180,31 @@ cd examples
172
180
  streamlit run llm_os_demo.py
173
181
  ```
174
182
 
175
- ![llm_os](https://github.com/shibing624/agentica/blob/main/docs/llm_os_snap.png)
183
+ <img alt="LLM OS" src="https://github.com/shibing624/agentica/blob/main/docs/llm_os_snap.png" width="800" />
176
184
 
177
- ## Web UI
185
+ ### Self-evolving Agent
186
+ The self-evolving agent design:
178
187
 
179
- [shibing624/ChatPilot](https://github.com/shibing624/ChatPilot) 兼容`agentica`,可以通过Web UI进行交互。
188
+ <img alt="LLM OS" src="https://github.com/shibing624/agentica/blob/main/docs/sage_arch.png" width="800" />
180
189
 
181
- Web Demo: https://chat.mulanai.com
190
+ #### Feature
182
191
 
183
- ![](https://github.com/shibing624/ChatPilot/blob/main/docs/shot.png)
192
+ 具有反思和增强记忆能力的自我进化智能体(self-evolving Agents with Reflective and Memory-augmented Abilities, SAGE)
184
193
 
185
- ```shell
186
- git clone https://github.com/shibing624/ChatPilot.git
187
- cd ChatPilot
188
- pip install -r requirements.txt
194
+ 实现方法:
189
195
 
190
- cp .env.example .env
196
+ 1. 使用PythonAssistant作为SAGE智能体,使用AzureOpenAILLM作为LLM, 具备code-interpreter功能,可以执行Python代码,并自动纠错。
197
+ 2. 使用CsvMemoryDb作为SAGE智能体的记忆,用于存储用户的问题和答案,下次遇到相似的问题时,可以直接返回答案。
191
198
 
192
- bash start.sh
199
+ #### Run Self-evolving Agent App
200
+
201
+ ```shell
202
+ cd examples
203
+ streamlit run self_evolving_agent_demo.py
193
204
  ```
194
205
 
206
+ <img alt="sage_snap" src="https://github.com/shibing624/agentica/blob/main/docs/sage_snap.png" width="800" />
207
+
195
208
 
196
209
  ## Contact
197
210
 
@@ -18,26 +18,25 @@
18
18
  [![Wechat Group](https://img.shields.io/badge/wechat-group-green.svg?logo=wechat)](#Contact)
19
19
 
20
20
 
21
- **Agentica**: A Human-Centric Framework for Large Language Model Agent Building.
22
-
23
- **Agentica**: 构建你自己的Agent
21
+ **Agentica**: A Human-Centric Framework for Large Language Model Agent Building. 快速打造你的专属Agent。
24
22
 
25
23
  ## Overview
26
24
 
27
25
  #### LLM Agent
28
- ![llm_agnet](https://github.com/shibing624/agentica/blob/main/docs/llm_agentv2.png)
26
+ <img src="https://github.com/shibing624/agentica/blob/main/docs/llm_agentv2.png" width="800" />
29
27
 
30
28
  - **规划(Planning)**:任务拆解、生成计划、反思
31
29
  - **记忆(Memory)**:短期记忆(prompt实现)、长期记忆(RAG实现)
32
30
  - **工具使用(Tool use)**:function call能力,调用外部API,以获取外部信息,包括当前日期、日历、代码执行能力、对专用信息源的访问等
33
31
 
34
- #### Agentica架构
35
- ![agentica_arch](https://github.com/shibing624/agentica/blob/main/docs/agent_arch.png)
32
+ #### Agentica Assistant Architecture
33
+ <img src="https://github.com/shibing624/agentica/blob/main/docs/agent_arch.png" width="800" />
36
34
 
37
35
  - **Planner**:负责让LLM生成一个多步计划来完成复杂任务,生成相互依赖的“链式计划”,定义每一步所依赖的上一步的输出
38
36
  - **Worker**:接受“链式计划”,循环遍历计划中的每个子任务,并调用工具完成任务,可以自动反思纠错以完成任务
39
37
  - **Solver**:求解器将所有这些输出整合为最终答案
40
38
 
39
+
41
40
  ## Features
42
41
  `Agentica`是一个Agent构建工具,功能:
43
42
 
@@ -85,30 +84,38 @@ python web_search_deepseek_demo.py
85
84
  自动调用google搜索工具,示例[examples/web_search_deepseek_demo.py](https://github.com/shibing624/agentica/blob/main/examples/web_search_deepseek_demo.py)
86
85
 
87
86
  ```python
88
- from agentica import Assistant, DeepseekLLM
89
- from agentica.tools.search_serper import SearchSerperTool
90
-
91
- m = Assistant(
92
- llm=DeepseekLLM(),
93
- description="You are a helpful ai assistant.",
94
- show_tool_calls=True,
95
- # Enable the assistant to search the knowledge base
96
- search_knowledge=False,
97
- tools=[SearchSerperTool()],
98
- # Enable the assistant to read the chat history
99
- read_chat_history=True,
100
- debug_mode=True,
101
- )
87
+ from agentica import Assistant, DeepseekLLM, SearchSerperTool
88
+
89
+ m = Assistant(llm=DeepseekLLM(), tools=[SearchSerperTool()])
102
90
 
103
91
  r = m.run("一句话介绍林黛玉")
104
92
  print(r, "".join(r))
105
- r = m.run("北京最近的新闻top3", stream=True, print_output=True)
93
+ r = m.run("北京最近的新闻top3", stream=True)
106
94
  print(r, "".join(r))
107
- r = m.run("总结前面的问答", stream=False, print_output=False)
95
+ r = m.run("总结前面的问答", stream=False)
108
96
  print(r)
109
97
  ```
110
98
 
111
99
 
100
+ ## Web UI
101
+
102
+ [shibing624/ChatPilot](https://github.com/shibing624/ChatPilot) 兼容`agentica`,可以通过Web UI进行交互。
103
+
104
+ Web Demo: https://chat.mulanai.com
105
+
106
+ <img src="https://github.com/shibing624/ChatPilot/blob/main/docs/shot.png" width="800" />
107
+
108
+ ```shell
109
+ git clone https://github.com/shibing624/ChatPilot.git
110
+ cd ChatPilot
111
+ pip install -r requirements.txt
112
+
113
+ cp .env.example .env
114
+
115
+ bash start.sh
116
+ ```
117
+
118
+
112
119
  ## Examples
113
120
 
114
121
  | 示例 | 描述 |
@@ -120,19 +127,20 @@ print(r)
120
127
  | [examples/team_news_article_demo.py](https://github.com/shibing624/agentica/blob/main/examples/team_news_article_demo.py) | 实现了写新闻稿的team协作,multi-role实现,委托不用角色完成各自任务:研究员检索分析文章,撰写员根据排版写文章,汇总多角色成果输出结果 |
121
128
  | [examples/workflow_news_article_demo.py](https://github.com/shibing624/agentica/blob/main/examples/workflow_news_article_demo.py) | 实现了写新闻稿的工作流,multi-agent的实现,定义了多个Assistant和Task,多次调用搜索工具,并生成高级排版的新闻文章 |
122
129
  | [examples/workflow_investment_demo.py](https://github.com/shibing624/agentica/blob/main/examples/workflow_investment_demo.py) | 实现了投资研究的工作流:股票信息收集 - 股票分析 - 撰写分析报告 - 复查报告等多个Task |
123
- | [examples/crawl_webpage_demo.py](https://github.com/shibing624/agentica/blob/main/examples/crawl_webpage_demo.py) | 实现了网页分析工作流:从Url爬取融资快讯 - 分析网页内容和格式 - 提取核心信息 - 汇总保存为md文件 |
130
+ | [examples/crawl_webpage_demo.py](https://github.com/shibing624/agentica/blob/main/examples/crawl_webpage_demo.py) | 实现了网页分析工作流:从Url爬取融资快讯 - 分析网页内容和格式 - 提取核心信息 - 汇总保存为md文件 |
124
131
  | [examples/find_paper_from_arxiv_demo.py](https://github.com/shibing624/agentica/blob/main/examples/find_paper_from_arxiv_demo.py) | 实现了论文推荐工作流:自动从arxiv搜索多组论文 - 相似论文去重 - 提取核心论文信息 - 保存为csv文件 |
125
132
  | [examples/remove_image_background_demo.py](https://github.com/shibing624/agentica/blob/main/examples/remove_image_background_demo.py) | 实现了自动去除图片背景功能,包括自动通过pip安装库,调用库实现去除图片背景 |
126
133
  | [examples/text_classification_demo.py](https://github.com/shibing624/agentica/blob/main/examples/text_classification_demo.py) | 实现了自动训练分类模型的工作流:读取训练集文件并理解格式 - 谷歌搜索pytextclassifier库 - 爬取github页面了解pytextclassifier的调用方法 - 写代码并执行fasttext模型训练 - check训练好的模型预测结果 |
127
134
  | [examples/llm_os_demo.py](https://github.com/shibing624/agentica/blob/main/examples/llm_os_demo.py) | 实现了LLM OS的初步设计,基于LLM设计操作系统,可以通过LLM调用RAG、代码执行器、Shell等工具,并协同代码解释器、研究助手、投资助手等来解决问题。 |
128
- | [examples/workflow_write_novel_demo.py](https://github.com/shibing624/agentica/blob/main/examples/workflow_write_novel_demo.py) | 实现了写小说的工作流:定小说提纲 - 搜索谷歌反思提纲 - 撰写小说内容 - 保存为md文件 |
129
- | [examples/workflow_write_tutorial_demo.py](https://github.com/shibing624/agentica/blob/main/examples/workflow_write_tutorial_demo.py) | 实现了写技术教程的工作流:定教程目录 - 反思目录内容 - 撰写教程内容 - 保存为md文件 |
135
+ | [examples/workflow_write_novel_demo.py](https://github.com/shibing624/agentica/blob/main/examples/workflow_write_novel_demo.py) | 实现了写小说的工作流:定小说提纲 - 搜索谷歌反思提纲 - 撰写小说内容 - 保存为md文件 |
136
+ | [examples/workflow_write_tutorial_demo.py](https://github.com/shibing624/agentica/blob/main/examples/workflow_write_tutorial_demo.py) | 实现了写技术教程的工作流:定教程目录 - 反思目录内容 - 撰写教程内容 - 保存为md文件 |
137
+ | [examples/self_evolving_agent_demo.py](https://github.com/shibing624/agentica/blob/main/examples/self_evolving_agent_demo.py) | 实现了基于长期记忆的自我进化智能体,可以基于历史问答信息自我调整决策 |
130
138
 
131
139
 
132
140
  ### LLM OS
133
141
  The LLM OS design:
134
142
 
135
- <img alt="LLM OS" src="https://github.com/shibing624/agentica/blob/main/docs/llmos.png" width="600" />
143
+ <img alt="LLM OS" src="https://github.com/shibing624/agentica/blob/main/docs/llmos.png" width="800" />
136
144
 
137
145
  #### Run the LLM OS App
138
146
 
@@ -141,26 +149,31 @@ cd examples
141
149
  streamlit run llm_os_demo.py
142
150
  ```
143
151
 
144
- ![llm_os](https://github.com/shibing624/agentica/blob/main/docs/llm_os_snap.png)
152
+ <img alt="LLM OS" src="https://github.com/shibing624/agentica/blob/main/docs/llm_os_snap.png" width="800" />
145
153
 
146
- ## Web UI
154
+ ### Self-evolving Agent
155
+ The self-evolving agent design:
147
156
 
148
- [shibing624/ChatPilot](https://github.com/shibing624/ChatPilot) 兼容`agentica`,可以通过Web UI进行交互。
157
+ <img alt="LLM OS" src="https://github.com/shibing624/agentica/blob/main/docs/sage_arch.png" width="800" />
149
158
 
150
- Web Demo: https://chat.mulanai.com
159
+ #### Feature
151
160
 
152
- ![](https://github.com/shibing624/ChatPilot/blob/main/docs/shot.png)
161
+ 具有反思和增强记忆能力的自我进化智能体(self-evolving Agents with Reflective and Memory-augmented Abilities, SAGE)
153
162
 
154
- ```shell
155
- git clone https://github.com/shibing624/ChatPilot.git
156
- cd ChatPilot
157
- pip install -r requirements.txt
163
+ 实现方法:
158
164
 
159
- cp .env.example .env
165
+ 1. 使用PythonAssistant作为SAGE智能体,使用AzureOpenAILLM作为LLM, 具备code-interpreter功能,可以执行Python代码,并自动纠错。
166
+ 2. 使用CsvMemoryDb作为SAGE智能体的记忆,用于存储用户的问题和答案,下次遇到相似的问题时,可以直接返回答案。
160
167
 
161
- bash start.sh
168
+ #### Run Self-evolving Agent App
169
+
170
+ ```shell
171
+ cd examples
172
+ streamlit run self_evolving_agent_demo.py
162
173
  ```
163
174
 
175
+ <img alt="sage_snap" src="https://github.com/shibing624/agentica/blob/main/docs/sage_snap.png" width="800" />
176
+
164
177
 
165
178
  ## Contact
166
179
 
@@ -4,8 +4,15 @@
4
4
  @description:
5
5
  """
6
6
  from agentica.version import __version__ # noqa, isort: skip
7
- from agentica.config import AGENTICA_HOME, AGENTICA_DOTENV_PATH, SMART_LLM, FAST_LLM # noqa, isort: skip
8
-
7
+ from agentica.config import (
8
+ AGENTICA_HOME,
9
+ AGENTICA_DOTENV_PATH,
10
+ AGENTICA_LOG_LEVEL,
11
+ AGENTICA_LOG_FILE,
12
+ SMART_LLM,
13
+ FAST_LLM
14
+ ) # noqa, isort: skip
15
+ from agentica.utils.log import set_log_level_to_debug
9
16
  # llm
10
17
  from agentica.llm.openai_llm import OpenAILLM
11
18
  from agentica.llm.azure_openai_llm import AzureOpenAILLM
@@ -14,7 +21,6 @@ from agentica.llm.deepseek_llm import DeepseekLLM
14
21
  from agentica.llm.moonshot_llm import MoonshotLLM
15
22
  from agentica.llm.ollama_llm import OllamaLLM
16
23
  from agentica.llm.ollama_tools_llm import OllamaToolsLLM
17
- from agentica.llm.claude_llm import ClaudeLLM
18
24
 
19
25
  # memory
20
26
  from agentica.message import Message
@@ -60,6 +66,7 @@ from agentica.storage.pg_storage import PgAssistantStorage
60
66
  from agentica.storage.sqlite_storage import SqlAssistantStorage
61
67
  # tool
62
68
  from agentica.tools.base import Tool, Toolkit, Function, FunctionCall
69
+ from agentica.tools.search_serper import SearchSerperTool
63
70
  # assistant
64
71
  from agentica.assistant import Assistant
65
72
  from agentica.python_assistant import PythonAssistant
@@ -51,3 +51,12 @@ class HuggingfaceEmb(Emb):
51
51
 
52
52
  def get_embedding_and_usage(self, text: str) -> Tuple[List[float], Optional[Dict]]:
53
53
  return super().get_embedding_and_usage(text)
54
+
55
+
56
+ if __name__ == '__main__':
57
+ emb = HuggingfaceEmb(api_key="hf_xxx")
58
+ text = "I love you"
59
+ r = emb.get_embedding(text)
60
+ print(r)
61
+ r = emb.get_embedding_and_usage(text)
62
+ print(r)
@@ -15,7 +15,6 @@ from agentica.tools.base import (
15
15
  from agentica.utils.log import logger
16
16
  from agentica.utils.timer import Timer
17
17
 
18
- anthropic_installed = False
19
18
  try:
20
19
  from anthropic import Anthropic as AnthropicClient
21
20
  from anthropic.types import Message as AnthropicMessage, TextBlock, ToolUseBlock, Usage, TextDelta
@@ -24,10 +23,8 @@ try:
24
23
  RawContentBlockDeltaEvent,
25
24
  ContentBlockStopEvent,
26
25
  )
27
-
28
- anthropic_installed = True
29
26
  except ImportError:
30
- anthropic_installed = False
27
+ raise ImportError("Anthropic is not installed. Please install it using `pip install anthropic`.")
31
28
 
32
29
 
33
30
  class ClaudeLLM(LLM):
@@ -44,12 +41,10 @@ class ClaudeLLM(LLM):
44
41
  api_key: Optional[str] = None
45
42
  client_params: Optional[Dict[str, Any]] = None
46
43
  # -*- Provide the client manually
47
- anthropic_client: Optional[Any] = None
44
+ anthropic_client: Optional[AnthropicClient] = None
48
45
 
49
46
  @property
50
- def client(self) -> Any:
51
- if not anthropic_installed:
52
- raise ImportError("Anthropic is not installed. Please install it using `pip install anthropic`.")
47
+ def client(self) -> AnthropicClient:
53
48
  if self.anthropic_client:
54
49
  return self.anthropic_client
55
50
 
@@ -6,7 +6,7 @@
6
6
  import http.client
7
7
  import json
8
8
  import os
9
- import ssl
9
+
10
10
  from typing import Dict, Optional
11
11
 
12
12
  from pydantic import BaseModel, ConfigDict, Field, model_validator
@@ -14,9 +14,6 @@ from pydantic import BaseModel, ConfigDict, Field, model_validator
14
14
  from agentica.tools.base import Toolkit
15
15
  from agentica.utils.log import logger
16
16
 
17
- # Create a default context for HTTPS requests (not recommended for production)
18
- ssl._create_default_https_context = ssl._create_unverified_context
19
-
20
17
 
21
18
  class SerperWrapper(BaseModel):
22
19
  model_config = ConfigDict(arbitrary_types_allowed=True)
@@ -41,6 +38,10 @@ class SerperWrapper(BaseModel):
41
38
 
42
39
  def run(self, query: str, max_results: int = 8, as_string: bool = True):
43
40
  """Run query through Serper and parse result"""
41
+ import ssl
42
+ # Create a default context for HTTPS requests (not recommended for production)
43
+ ssl._create_default_https_context = ssl._create_unverified_context
44
+
44
45
  headers = self.get_headers()
45
46
 
46
47
  conn = http.client.HTTPSConnection("google.serper.dev")
@@ -97,7 +97,6 @@ def read_pdf_url(url: str) -> str:
97
97
 
98
98
 
99
99
  def read_docx_file(path: Path) -> str:
100
- logger.info(f"Reading: {path}")
101
100
  try:
102
101
  from docx import Document
103
102
  from docx.oxml.ns import qn
@@ -117,11 +116,33 @@ def read_docx_file(path: Path) -> str:
117
116
  _, ext = os.path.splitext(url)
118
117
  return ext.lower() in image_extensions
119
118
 
119
+ def get_numbering(paragraph):
120
+ """获取段落的编号信息."""
121
+ numbering = paragraph._element.xpath('.//w:numPr')
122
+ if (numbering and len(numbering) > 0 and
123
+ numbering[0].xpath('.//w:numId') and numbering[0].xpath('.//w:ilvl')):
124
+ num_id = numbering[0].xpath('.//w:numId')[0].get(qn('w:val'))
125
+ ilvl = numbering[0].xpath('.//w:ilvl')[0].get(qn('w:val'))
126
+ return num_id, ilvl
127
+ return None, None
128
+
120
129
  try:
121
130
  doc = Document(str(path))
122
131
  doc_content = ""
132
+ numbering_dict = {}
133
+
123
134
  for paragraph in doc.paragraphs:
124
135
  para_text = ""
136
+ num_id, ilvl = get_numbering(paragraph)
137
+ if num_id and ilvl:
138
+ if num_id not in numbering_dict:
139
+ numbering_dict[num_id] = {}
140
+ if ilvl not in numbering_dict[num_id]:
141
+ numbering_dict[num_id][ilvl] = 1
142
+ else:
143
+ numbering_dict[num_id][ilvl] += 1
144
+ para_text += f"- "
145
+
125
146
  for run in paragraph.runs:
126
147
  run_text = run.text
127
148
 
@@ -0,0 +1 @@
1
+ __version__ = "0.1.8"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: agentica
3
- Version: 0.1.6
3
+ Version: 0.1.8
4
4
  Summary: LLM agents
5
5
  Home-page: https://github.com/shibing624/agentica
6
6
  Author: XuMing
@@ -49,26 +49,25 @@ Requires-Dist: rich
49
49
  [![Wechat Group](https://img.shields.io/badge/wechat-group-green.svg?logo=wechat)](#Contact)
50
50
 
51
51
 
52
- **Agentica**: A Human-Centric Framework for Large Language Model Agent Building.
53
-
54
- **Agentica**: 构建你自己的Agent
52
+ **Agentica**: A Human-Centric Framework for Large Language Model Agent Building. 快速打造你的专属Agent。
55
53
 
56
54
  ## Overview
57
55
 
58
56
  #### LLM Agent
59
- ![llm_agnet](https://github.com/shibing624/agentica/blob/main/docs/llm_agentv2.png)
57
+ <img src="https://github.com/shibing624/agentica/blob/main/docs/llm_agentv2.png" width="800" />
60
58
 
61
59
  - **规划(Planning)**:任务拆解、生成计划、反思
62
60
  - **记忆(Memory)**:短期记忆(prompt实现)、长期记忆(RAG实现)
63
61
  - **工具使用(Tool use)**:function call能力,调用外部API,以获取外部信息,包括当前日期、日历、代码执行能力、对专用信息源的访问等
64
62
 
65
- #### Agentica架构
66
- ![agentica_arch](https://github.com/shibing624/agentica/blob/main/docs/agent_arch.png)
63
+ #### Agentica Assistant Architecture
64
+ <img src="https://github.com/shibing624/agentica/blob/main/docs/agent_arch.png" width="800" />
67
65
 
68
66
  - **Planner**:负责让LLM生成一个多步计划来完成复杂任务,生成相互依赖的“链式计划”,定义每一步所依赖的上一步的输出
69
67
  - **Worker**:接受“链式计划”,循环遍历计划中的每个子任务,并调用工具完成任务,可以自动反思纠错以完成任务
70
68
  - **Solver**:求解器将所有这些输出整合为最终答案
71
69
 
70
+
72
71
  ## Features
73
72
  `Agentica`是一个Agent构建工具,功能:
74
73
 
@@ -116,30 +115,38 @@ python web_search_deepseek_demo.py
116
115
  自动调用google搜索工具,示例[examples/web_search_deepseek_demo.py](https://github.com/shibing624/agentica/blob/main/examples/web_search_deepseek_demo.py)
117
116
 
118
117
  ```python
119
- from agentica import Assistant, DeepseekLLM
120
- from agentica.tools.search_serper import SearchSerperTool
121
-
122
- m = Assistant(
123
- llm=DeepseekLLM(),
124
- description="You are a helpful ai assistant.",
125
- show_tool_calls=True,
126
- # Enable the assistant to search the knowledge base
127
- search_knowledge=False,
128
- tools=[SearchSerperTool()],
129
- # Enable the assistant to read the chat history
130
- read_chat_history=True,
131
- debug_mode=True,
132
- )
118
+ from agentica import Assistant, DeepseekLLM, SearchSerperTool
119
+
120
+ m = Assistant(llm=DeepseekLLM(), tools=[SearchSerperTool()])
133
121
 
134
122
  r = m.run("一句话介绍林黛玉")
135
123
  print(r, "".join(r))
136
- r = m.run("北京最近的新闻top3", stream=True, print_output=True)
124
+ r = m.run("北京最近的新闻top3", stream=True)
137
125
  print(r, "".join(r))
138
- r = m.run("总结前面的问答", stream=False, print_output=False)
126
+ r = m.run("总结前面的问答", stream=False)
139
127
  print(r)
140
128
  ```
141
129
 
142
130
 
131
+ ## Web UI
132
+
133
+ [shibing624/ChatPilot](https://github.com/shibing624/ChatPilot) 兼容`agentica`,可以通过Web UI进行交互。
134
+
135
+ Web Demo: https://chat.mulanai.com
136
+
137
+ <img src="https://github.com/shibing624/ChatPilot/blob/main/docs/shot.png" width="800" />
138
+
139
+ ```shell
140
+ git clone https://github.com/shibing624/ChatPilot.git
141
+ cd ChatPilot
142
+ pip install -r requirements.txt
143
+
144
+ cp .env.example .env
145
+
146
+ bash start.sh
147
+ ```
148
+
149
+
143
150
  ## Examples
144
151
 
145
152
  | 示例 | 描述 |
@@ -151,19 +158,20 @@ print(r)
151
158
  | [examples/team_news_article_demo.py](https://github.com/shibing624/agentica/blob/main/examples/team_news_article_demo.py) | 实现了写新闻稿的team协作,multi-role实现,委托不用角色完成各自任务:研究员检索分析文章,撰写员根据排版写文章,汇总多角色成果输出结果 |
152
159
  | [examples/workflow_news_article_demo.py](https://github.com/shibing624/agentica/blob/main/examples/workflow_news_article_demo.py) | 实现了写新闻稿的工作流,multi-agent的实现,定义了多个Assistant和Task,多次调用搜索工具,并生成高级排版的新闻文章 |
153
160
  | [examples/workflow_investment_demo.py](https://github.com/shibing624/agentica/blob/main/examples/workflow_investment_demo.py) | 实现了投资研究的工作流:股票信息收集 - 股票分析 - 撰写分析报告 - 复查报告等多个Task |
154
- | [examples/crawl_webpage_demo.py](https://github.com/shibing624/agentica/blob/main/examples/crawl_webpage_demo.py) | 实现了网页分析工作流:从Url爬取融资快讯 - 分析网页内容和格式 - 提取核心信息 - 汇总保存为md文件 |
161
+ | [examples/crawl_webpage_demo.py](https://github.com/shibing624/agentica/blob/main/examples/crawl_webpage_demo.py) | 实现了网页分析工作流:从Url爬取融资快讯 - 分析网页内容和格式 - 提取核心信息 - 汇总保存为md文件 |
155
162
  | [examples/find_paper_from_arxiv_demo.py](https://github.com/shibing624/agentica/blob/main/examples/find_paper_from_arxiv_demo.py) | 实现了论文推荐工作流:自动从arxiv搜索多组论文 - 相似论文去重 - 提取核心论文信息 - 保存为csv文件 |
156
163
  | [examples/remove_image_background_demo.py](https://github.com/shibing624/agentica/blob/main/examples/remove_image_background_demo.py) | 实现了自动去除图片背景功能,包括自动通过pip安装库,调用库实现去除图片背景 |
157
164
  | [examples/text_classification_demo.py](https://github.com/shibing624/agentica/blob/main/examples/text_classification_demo.py) | 实现了自动训练分类模型的工作流:读取训练集文件并理解格式 - 谷歌搜索pytextclassifier库 - 爬取github页面了解pytextclassifier的调用方法 - 写代码并执行fasttext模型训练 - check训练好的模型预测结果 |
158
165
  | [examples/llm_os_demo.py](https://github.com/shibing624/agentica/blob/main/examples/llm_os_demo.py) | 实现了LLM OS的初步设计,基于LLM设计操作系统,可以通过LLM调用RAG、代码执行器、Shell等工具,并协同代码解释器、研究助手、投资助手等来解决问题。 |
159
- | [examples/workflow_write_novel_demo.py](https://github.com/shibing624/agentica/blob/main/examples/workflow_write_novel_demo.py) | 实现了写小说的工作流:定小说提纲 - 搜索谷歌反思提纲 - 撰写小说内容 - 保存为md文件 |
160
- | [examples/workflow_write_tutorial_demo.py](https://github.com/shibing624/agentica/blob/main/examples/workflow_write_tutorial_demo.py) | 实现了写技术教程的工作流:定教程目录 - 反思目录内容 - 撰写教程内容 - 保存为md文件 |
166
+ | [examples/workflow_write_novel_demo.py](https://github.com/shibing624/agentica/blob/main/examples/workflow_write_novel_demo.py) | 实现了写小说的工作流:定小说提纲 - 搜索谷歌反思提纲 - 撰写小说内容 - 保存为md文件 |
167
+ | [examples/workflow_write_tutorial_demo.py](https://github.com/shibing624/agentica/blob/main/examples/workflow_write_tutorial_demo.py) | 实现了写技术教程的工作流:定教程目录 - 反思目录内容 - 撰写教程内容 - 保存为md文件 |
168
+ | [examples/self_evolving_agent_demo.py](https://github.com/shibing624/agentica/blob/main/examples/self_evolving_agent_demo.py) | 实现了基于长期记忆的自我进化智能体,可以基于历史问答信息自我调整决策 |
161
169
 
162
170
 
163
171
  ### LLM OS
164
172
  The LLM OS design:
165
173
 
166
- <img alt="LLM OS" src="https://github.com/shibing624/agentica/blob/main/docs/llmos.png" width="600" />
174
+ <img alt="LLM OS" src="https://github.com/shibing624/agentica/blob/main/docs/llmos.png" width="800" />
167
175
 
168
176
  #### Run the LLM OS App
169
177
 
@@ -172,26 +180,31 @@ cd examples
172
180
  streamlit run llm_os_demo.py
173
181
  ```
174
182
 
175
- ![llm_os](https://github.com/shibing624/agentica/blob/main/docs/llm_os_snap.png)
183
+ <img alt="LLM OS" src="https://github.com/shibing624/agentica/blob/main/docs/llm_os_snap.png" width="800" />
176
184
 
177
- ## Web UI
185
+ ### Self-evolving Agent
186
+ The self-evolving agent design:
178
187
 
179
- [shibing624/ChatPilot](https://github.com/shibing624/ChatPilot) 兼容`agentica`,可以通过Web UI进行交互。
188
+ <img alt="LLM OS" src="https://github.com/shibing624/agentica/blob/main/docs/sage_arch.png" width="800" />
180
189
 
181
- Web Demo: https://chat.mulanai.com
190
+ #### Feature
182
191
 
183
- ![](https://github.com/shibing624/ChatPilot/blob/main/docs/shot.png)
192
+ 具有反思和增强记忆能力的自我进化智能体(self-evolving Agents with Reflective and Memory-augmented Abilities, SAGE)
184
193
 
185
- ```shell
186
- git clone https://github.com/shibing624/ChatPilot.git
187
- cd ChatPilot
188
- pip install -r requirements.txt
194
+ 实现方法:
189
195
 
190
- cp .env.example .env
196
+ 1. 使用PythonAssistant作为SAGE智能体,使用AzureOpenAILLM作为LLM, 具备code-interpreter功能,可以执行Python代码,并自动纠错。
197
+ 2. 使用CsvMemoryDb作为SAGE智能体的记忆,用于存储用户的问题和答案,下次遇到相似的问题时,可以直接返回答案。
191
198
 
192
- bash start.sh
199
+ #### Run Self-evolving Agent App
200
+
201
+ ```shell
202
+ cd examples
203
+ streamlit run self_evolving_agent_demo.py
193
204
  ```
194
205
 
206
+ <img alt="sage_snap" src="https://github.com/shibing624/agentica/blob/main/docs/sage_snap.png" width="800" />
207
+
195
208
 
196
209
  ## Contact
197
210
 
@@ -1 +0,0 @@
1
- __version__ = "0.1.6"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes