agent-roundtable 0.2.0__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 (62) hide show
  1. agent_roundtable-0.2.0/CHANGELOG.md +15 -0
  2. agent_roundtable-0.2.0/LICENSE +190 -0
  3. agent_roundtable-0.2.0/MANIFEST.in +25 -0
  4. agent_roundtable-0.2.0/PKG-INFO +260 -0
  5. agent_roundtable-0.2.0/README.md +224 -0
  6. agent_roundtable-0.2.0/README_EN.md +213 -0
  7. agent_roundtable-0.2.0/SECURITY.md +30 -0
  8. agent_roundtable-0.2.0/docs/ADAPTER.md +189 -0
  9. agent_roundtable-0.2.0/docs/API.md +93 -0
  10. agent_roundtable-0.2.0/docs/INTEGRATION.md +62 -0
  11. agent_roundtable-0.2.0/docs/SKILL_SYNC.md +89 -0
  12. agent_roundtable-0.2.0/docs/architecture.md +130 -0
  13. agent_roundtable-0.2.0/docs/design/COLOR-PALETTE.md +237 -0
  14. agent_roundtable-0.2.0/docs/design/DESIGN-SPEC.md +168 -0
  15. agent_roundtable-0.2.0/docs/design/DESIGN-sprint1.md +826 -0
  16. agent_roundtable-0.2.0/docs/design/DESIGN-sprint2.md +1102 -0
  17. agent_roundtable-0.2.0/docs/design/DESIGN-sprint3.md +78 -0
  18. agent_roundtable-0.2.0/docs/design/pypi-readme-structure.md +38 -0
  19. agent_roundtable-0.2.0/docs/design/static-intro-page-design.md +252 -0
  20. agent_roundtable-0.2.0/docs/design/web-viewer/WEB-VIEWER-SPEC.md +199 -0
  21. agent_roundtable-0.2.0/docs/design/web-viewer/animation-spec.md +226 -0
  22. agent_roundtable-0.2.0/docs/design/web-viewer/component-spec.md +169 -0
  23. agent_roundtable-0.2.0/docs/design/web-viewer/mobile-spec.md +145 -0
  24. agent_roundtable-0.2.0/docs/design/web-viewer/share-interaction-spec.md +205 -0
  25. agent_roundtable-0.2.0/docs/discussions/rt_91f05a5c_roundtable-release-plan.md +113 -0
  26. agent_roundtable-0.2.0/docs/discussions/web-viewer-discussion.md +121 -0
  27. agent_roundtable-0.2.0/docs/tech-designs/roundtable-web-viewer-tech-design.md +339 -0
  28. agent_roundtable-0.2.0/pyproject.toml +116 -0
  29. agent_roundtable-0.2.0/setup.cfg +4 -0
  30. agent_roundtable-0.2.0/src/agent_roundtable.egg-info/PKG-INFO +260 -0
  31. agent_roundtable-0.2.0/src/agent_roundtable.egg-info/SOURCES.txt +60 -0
  32. agent_roundtable-0.2.0/src/agent_roundtable.egg-info/dependency_links.txt +1 -0
  33. agent_roundtable-0.2.0/src/agent_roundtable.egg-info/requires.txt +11 -0
  34. agent_roundtable-0.2.0/src/agent_roundtable.egg-info/top_level.txt +2 -0
  35. agent_roundtable-0.2.0/src/roundtable/__init__.py +109 -0
  36. agent_roundtable-0.2.0/src/roundtable/adapters/__init__.py +15 -0
  37. agent_roundtable-0.2.0/src/roundtable/adapters/base.py +107 -0
  38. agent_roundtable-0.2.0/src/roundtable/adapters/generic.py +247 -0
  39. agent_roundtable-0.2.0/src/roundtable/adapters/hermes.py +479 -0
  40. agent_roundtable-0.2.0/src/roundtable/adapters/simple.py +93 -0
  41. agent_roundtable-0.2.0/src/roundtable/core.py +1112 -0
  42. agent_roundtable-0.2.0/src/roundtable/db.py +615 -0
  43. agent_roundtable-0.2.0/src/roundtable/demo.py +321 -0
  44. agent_roundtable-0.2.0/src/roundtable/exceptions.py +33 -0
  45. agent_roundtable-0.2.0/src/roundtable/formatter.py +97 -0
  46. agent_roundtable-0.2.0/src/roundtable/models.py +69 -0
  47. agent_roundtable-0.2.0/src/roundtable/notify.py +206 -0
  48. agent_roundtable-0.2.0/src/roundtable/py.typed +0 -0
  49. agent_roundtable-0.2.0/src/roundtable/schema.py +94 -0
  50. agent_roundtable-0.2.0/src/roundtable/web/ecosystem.config.cjs +26 -0
  51. agent_roundtable-0.2.0/src/roundtable/web/index.html +207 -0
  52. agent_roundtable-0.2.0/src/roundtable/web/server.mjs +821 -0
  53. agent_roundtable-0.2.0/src/roundtable/web/theme.css +171 -0
  54. agent_roundtable-0.2.0/src/roundtable/web/viewer.css +1658 -0
  55. agent_roundtable-0.2.0/src/roundtable/web_helpers.py +36 -0
  56. agent_roundtable-0.2.0/src/roundtable/web_publisher.py +536 -0
  57. agent_roundtable-0.2.0/tests/test_core.py +731 -0
  58. agent_roundtable-0.2.0/tests/test_core_coverage.py +431 -0
  59. agent_roundtable-0.2.0/tests/test_core_web_integration.py +236 -0
  60. agent_roundtable-0.2.0/tests/test_db.py +355 -0
  61. agent_roundtable-0.2.0/tests/test_notify.py +311 -0
  62. agent_roundtable-0.2.0/tests/test_web_publisher.py +615 -0
@@ -0,0 +1,15 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6
+
7
+ ## [0.1.0] - 2026-05-25
8
+
9
+ ### Added
10
+
11
+ - 圆桌讨论核心功能 — 多角色 AI Agent 协作讨论框架
12
+ - 多角色 Agent 协作 — 支持自定义角色组合与讨论策略
13
+ - WebViewer 实时查看 — 浏览器实时查看讨论过程与结果
14
+ - 飞书通知集成 — 讨论完成自动推送飞书消息
15
+ - Hermes Skill Hub 分发 — 作为 Hermes Skill 安装使用
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to the Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by the Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding any notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2026 ParsifalC
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
@@ -0,0 +1,25 @@
1
+ # Source distribution hygiene
2
+ include README.md
3
+ include README_EN.md
4
+ include LICENSE
5
+ include CHANGELOG.md
6
+ include SECURITY.md
7
+ include pyproject.toml
8
+
9
+ recursive-include src/roundtable/web *.html *.css *.mjs *.cjs
10
+ recursive-include docs *.md
11
+
12
+ prune docs/internal
13
+ prune docs/product
14
+ prune .github
15
+ prune .hermes
16
+ prune .venv
17
+ prune node_modules
18
+ prune dist
19
+ prune build
20
+
21
+ global-exclude __pycache__/*
22
+ global-exclude *.py[cod]
23
+ global-exclude .DS_Store
24
+ global-exclude .env*
25
+ global-exclude *.db
@@ -0,0 +1,260 @@
1
+ Metadata-Version: 2.4
2
+ Name: agent-roundtable
3
+ Version: 0.2.0
4
+ Summary: Multi-Agent Roundtable Discussion Engine / 多 Agent 圆桌讨论引擎
5
+ Author-email: Roundtable Contributors <zmw@izmw.me>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/MoyuFamily/agent-roundtable
8
+ Project-URL: Repository, https://github.com/MoyuFamily/agent-roundtable
9
+ Project-URL: Issues, https://github.com/MoyuFamily/agent-roundtable/issues
10
+ Project-URL: Documentation, https://github.com/MoyuFamily/agent-roundtable#readme
11
+ Project-URL: Changelog, https://github.com/MoyuFamily/agent-roundtable/blob/main/CHANGELOG.md
12
+ Keywords: ai-agents,multi-agent,roundtable,discussion,collaboration,consensus
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
+ Classifier: Typing :: Typed
24
+ Requires-Python: >=3.10
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Provides-Extra: hermes
28
+ Provides-Extra: web
29
+ Requires-Dist: nanoid>=2.0; extra == "web"
30
+ Provides-Extra: dev
31
+ Requires-Dist: pytest>=7.0; extra == "dev"
32
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
33
+ Requires-Dist: ruff>=0.4.0; extra == "dev"
34
+ Requires-Dist: mypy>=1.10; extra == "dev"
35
+ Dynamic: license-file
36
+
37
+ <p align="center">
38
+ <img src="https://raw.githubusercontent.com/MoyuFamily/agent-roundtable/main/docs/design/assets/svg/roundtable-logo.svg" alt="Roundtable" width="128" height="128">
39
+ </p>
40
+
41
+ <h1 align="center">Roundtable</h1>
42
+
43
+ <p align="center">
44
+ <strong>agent-roundtable 是面向 AI Agent 团队的多智能体圆桌讨论引擎:让多个 Agent 围绕同一问题顺序发言、追踪共识分歧,并自动生成结构化会议记录与结论。</strong>
45
+ </p>
46
+
47
+ <p align="center">
48
+ <a href="#development"><img src="https://img.shields.io/badge/tests-passing-brightgreen.svg" alt="Tests"></a>
49
+ <a href="LICENSE"><img src="https://img.shields.io/badge/License-Apache--2.0-blue.svg" alt="License: Apache-2.0"></a>
50
+ <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.10+-blue.svg" alt="Python 3.10+"></a>
51
+ <a href="#-核心特性"><img src="https://img.shields.io/badge/core-zero_dependencies-brightgreen.svg" alt="Zero Dependencies"></a>
52
+ </p>
53
+
54
+ <p align="center">
55
+ <strong><a href="README.md">中文</a> · <a href="README_EN.md">English</a></strong>
56
+ </p>
57
+
58
+ <p align="center">
59
+ <img src="https://raw.githubusercontent.com/MoyuFamily/agent-roundtable/main/docs/design/assets/demo.gif" alt="Roundtable Demo" width="600">
60
+ </p>
61
+
62
+ ---
63
+
64
+ ## ⚡ 10 秒速览
65
+
66
+ ```bash
67
+ pip install agent-roundtable
68
+ ```
69
+
70
+ `agent-roundtable` 是一个可嵌入任意 AI Agent 系统的 Python 包。你只管选人、定话题,它负责管理多 Agent 圆桌讨论、顺序发言、共识/分歧追踪,并沉淀结构化会议记录与结论。
71
+
72
+ | 你想快速确认的事 | Roundtable 的答案 |
73
+ |---|---|
74
+ | 它解决什么问题? | 让多个 Agent 像开会一样围绕同一议题发言、记录和收敛 |
75
+ | 包名和导入名是什么? | 安装 `agent-roundtable`,代码里 `import roundtable` |
76
+ | 能不能独立使用? | 可以,核心库只依赖 Python 标准库和 SQLite |
77
+ | 能不能接 Agent 框架? | 可以,通过 adapter 接入 Hermes Agent 或任意 Agent 系统 |
78
+ | 输出是什么? | 讨论状态、convergence score、共识/分歧、结构化 summary 与结论 |
79
+
80
+ ## 🧭 什么时候用它?
81
+
82
+ 当你已经有多个 Agent / 角色,但缺少一个“会议协议层”时,就适合引入 Roundtable:
83
+
84
+ 1. **创建会议**:定义 topic、participants 和 max_rounds。
85
+ 2. **顺序发言**:记录每个 Agent 在每一轮的观点。
86
+ 3. **观察收敛**:查看状态、共识度、共识点和分歧点。
87
+ 4. **沉淀结论**:生成 summary,结束讨论并留下可追溯决策。
88
+
89
+ ## 🧩 适合场景
90
+
91
+ - **技术方案评审**:让架构师、后端、运维、安全角色分别发言,沉淀决策依据
92
+ - **产品决策讨论**:让产品、设计、开发、增长角色讨论 MVP 边界和优先级
93
+ - **代码 Review 辩论**:让不同 Agent 从质量、安全、性能角度审查实现方案
94
+ - **需求澄清**:让多个专家角色围绕模糊需求追问、反驳和收敛
95
+ - **多 Agent 工作流**:作为 coordinator 的讨论协议层,记录过程和结论
96
+
97
+ ## 🚀 快速开始
98
+
99
+ ### 安装
100
+
101
+ PyPI 发布后,请使用正式包名安装:
102
+
103
+ ```bash
104
+ pip install agent-roundtable
105
+ ```
106
+
107
+ 发布前或需要验证当前分支时,可从源码安装:
108
+
109
+ ```bash
110
+ git clone https://github.com/MoyuFamily/agent-roundtable.git
111
+ cd agent-roundtable
112
+ pip install -e .
113
+ ```
114
+
115
+ > 说明:本项目的 PyPI 包名是 `agent-roundtable`。PyPI 上的 `roundtable` / `roundtable-ai` 不是本项目,请勿使用 `pip install roundtable` 或 `pip install roundtable-ai` 安装本项目。
116
+
117
+ ### 基本用法
118
+
119
+ 例如:让后端架构师、运维工程师、产品经理三个 Agent 讨论数据库选型,Roundtable 负责管理轮次、记录观点、追踪收敛并生成结论。
120
+
121
+ ```python
122
+ from roundtable import RoundtableCore
123
+
124
+ core = RoundtableCore()
125
+
126
+ # 1. 创建讨论
127
+ result = core.create_discussion(
128
+ topic="选择数据库:PostgreSQL vs MySQL vs TiDB",
129
+ participants=[
130
+ {"profile": "backend_architect", "role": "后端架构师", "display_name": "Backend Architect"},
131
+ {"profile": "ops_engineer", "role": "运维工程师", "display_name": "Ops Engineer"},
132
+ {"profile": "product_manager", "role": "产品经理", "display_name": "Product Manager"},
133
+ ],
134
+ max_rounds=3,
135
+ )
136
+ disc_id = result["discussion_id"]
137
+
138
+ # 2. 参与者发言
139
+ core.speak(disc_id, "backend_architect", "PostgreSQL 的 JSON 和事务能力更适合复杂业务建模。")
140
+ core.speak(disc_id, "ops_engineer", "MySQL 运维经验和工具链更成熟,团队上手成本低。")
141
+ core.speak(disc_id, "product_manager", "从迭代速度看,我们需要优先保证未来功能扩展能力。")
142
+
143
+ # 3. 查看讨论状态(含收敛度)
144
+ status = core.status(disc_id)
145
+ print(f"Convergence: {status['convergence_score']}")
146
+
147
+ # 4. 生成结构化总结
148
+ summary = core.summarize(disc_id, compact=True)
149
+ print(summary["structured_summary"])
150
+
151
+ # 5. 结束讨论
152
+ core.end_discussion(disc_id, conclusion="选择 PostgreSQL,优先支持复杂数据结构和长期扩展。")
153
+ ```
154
+
155
+ ### 错误安全模式(推荐用于生产环境)
156
+
157
+ ```python
158
+ from roundtable.adapters.generic import Roundtable
159
+
160
+ rt = Roundtable(db_path="/tmp/discussions.db")
161
+ result = rt.init(topic="...", participants=[...])
162
+ # 所有方法返回 dict — 错误以 {"error": "msg"} 返回,永不抛异常
163
+ ```
164
+
165
+ ### 实时通知
166
+
167
+ ```python
168
+ def my_send(platform, chat_id, message):
169
+ print(f"[{platform}:{chat_id}] {message}")
170
+
171
+ rt = Roundtable(send_fn=my_send)
172
+ result = rt.init(
173
+ topic="架构评审",
174
+ participants=[...],
175
+ notifications={
176
+ "enabled": True,
177
+ "channels": [
178
+ {"platform": "feishu", "chat_id": "oc_xxx"},
179
+ {"platform": "slack", "chat_id": "#engineering"},
180
+ ],
181
+ "events": ["round_end", "concluded"],
182
+ },
183
+ )
184
+ ```
185
+
186
+ ## ✨ 核心特性
187
+
188
+ | 特性 | 说明 |
189
+ |------|------|
190
+ | 🧑‍⚖️ **圆桌讨论模型** | 用 topic、participants、rounds 管理多 Agent 讨论流程 |
191
+ | 📊 **收敛追踪** | 自动计算每轮共识度(convergence score),量化讨论进展 |
192
+ | 🧾 **结构化总结** | 输出共识、分歧、决策建议和结论,适合沉淀会议记录与决策文档 |
193
+ | 🔌 **框架无关** | 独立运行,或通过 adapter 接入任何 Agent 框架 |
194
+ | 🔔 **实时通知** | 讨论事件推送到飞书、Slack 或任意消息平台 |
195
+ | 🛡️ **错误安全** | Generic adapter 所有方法返回 dict,永不抛异常 |
196
+ | 🗂️ **SQLite 持久化** | 讨论记录持久存储,随时回溯 |
197
+ | 🪶 **零依赖核心** | 核心库只用 Python 标准库(sqlite3 + dataclasses) |
198
+
199
+ ## 🔌 为 Hermes Agent 集成而生
200
+
201
+ Roundtable 可以独立作为 Python 库使用,也可以作为 Hermes Agent 的 toolset 使用,让多个 Agent 通过工具调用参与同一场结构化讨论。
202
+
203
+ ```yaml
204
+ # Hermes 配置
205
+ toolsets:
206
+ - roundtable
207
+ ```
208
+
209
+ 安装 Hermes Agent 后,Roundtable 可注册讨论相关工具,AI Agent 能够创建、参与、读取、总结和结束讨论。
210
+
211
+ ## 📐 架构
212
+
213
+ ```text
214
+ src/roundtable/
215
+ ├── __init__.py # 公共 API
216
+ ├── core.py # 业务逻辑层
217
+ ├── db.py # SQLite 存储层
218
+ ├── models.py # 数据模型(dataclass)
219
+ ├── notify.py # 通知分发
220
+ ├── exceptions.py # 异常定义
221
+ └── adapters/
222
+ ├── hermes.py # Hermes Agent 适配器
223
+ └── generic.py # 通用 Python API(错误安全)
224
+ ```
225
+
226
+ ## 🛣️ 后续计划
227
+
228
+ - 发布 `agent-roundtable` 到 PyPI
229
+ - 补充 CLI 示例和端到端 Demo
230
+ - 增强结构化总结模板
231
+ - 补充更多 Agent 框架 adapter
232
+ - 增加讨论结果导出能力
233
+
234
+ ## 🤝 贡献
235
+
236
+ 1. Fork 本仓库
237
+ 2. 创建特性分支:`git checkout -b feature/amazing-feature`
238
+ 3. 编写测试并确保通过:`pytest tests/ -v`
239
+ 4. 提交代码:`git commit -m 'feat: add amazing feature'`
240
+ 5. 推送并创建 PR
241
+
242
+ ### 代码规范
243
+
244
+ - Python 3.10+,使用 type hints
245
+ - 核心库零外部依赖(stdlib only)
246
+ - 所有异常继承 `RoundtableError`
247
+ - 所有公共方法返回 JSON-serializable dict
248
+
249
+ ## 👥 团队
250
+
251
+ | 成员 | 角色 | 说明 |
252
+ |------|------|------|
253
+ | <img src="https://avatars.githubusercontent.com/u/286716759?v=4" width="24" height="24" style="border-radius:50%"> 饼哥 | 产品总监 | 十年产品老兵,擅长把模糊需求变成可落地的 MVP,信奉「用户要的不是钻头,是墙上的洞」 |
254
+ | <img src="https://avatars.githubusercontent.com/u/286719582?v=4" width="24" height="24" style="border-radius:50%"> 像素姐 | 设计总监 | UI/UX 与品牌视觉体系设计,专注交互细节与用户体验优化,信奉「细节决定品质感」 |
255
+ | <img src="https://avatars.githubusercontent.com/u/286715358?v=4" width="24" height="24" style="border-radius:50%"> 码飞 | 技术总监 | 全栈开发与系统架构设计,主导技术选型、性能优化和 AI/ML 工程化落地 |
256
+ | <img src="https://avatars.githubusercontent.com/u/286714101?v=4" width="24" height="24" style="border-radius:50%"> 小赫 | 协调者 | 团队任务统筹与进度管理,确保产品→设计→开发流程高效运转 |
257
+
258
+ ## 📄 许可证
259
+
260
+ [Apache-2.0](LICENSE)