matrix-for-agents 0.1.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 (73) hide show
  1. matrix_for_agents-0.1.0/LICENSE +190 -0
  2. matrix_for_agents-0.1.0/MANIFEST.in +68 -0
  3. matrix_for_agents-0.1.0/PKG-INFO +262 -0
  4. matrix_for_agents-0.1.0/README.md +217 -0
  5. matrix_for_agents-0.1.0/pyproject.toml +67 -0
  6. matrix_for_agents-0.1.0/requirements.txt +17 -0
  7. matrix_for_agents-0.1.0/setup.cfg +4 -0
  8. matrix_for_agents-0.1.0/src/agentmatrix/__init__.py +20 -0
  9. matrix_for_agents-0.1.0/src/agentmatrix/agents/__init__.py +1 -0
  10. matrix_for_agents-0.1.0/src/agentmatrix/agents/base.py +572 -0
  11. matrix_for_agents-0.1.0/src/agentmatrix/agents/claude_coder.py +10 -0
  12. matrix_for_agents-0.1.0/src/agentmatrix/agents/data_crawler.py +14 -0
  13. matrix_for_agents-0.1.0/src/agentmatrix/agents/post_office.py +212 -0
  14. matrix_for_agents-0.1.0/src/agentmatrix/agents/report_writer.py +14 -0
  15. matrix_for_agents-0.1.0/src/agentmatrix/agents/secretary.py +10 -0
  16. matrix_for_agents-0.1.0/src/agentmatrix/agents/stateful.py +10 -0
  17. matrix_for_agents-0.1.0/src/agentmatrix/agents/user_proxy.py +82 -0
  18. matrix_for_agents-0.1.0/src/agentmatrix/agents/worker.py +30 -0
  19. matrix_for_agents-0.1.0/src/agentmatrix/backends/__init__.py +1 -0
  20. matrix_for_agents-0.1.0/src/agentmatrix/backends/llm_client.py +414 -0
  21. matrix_for_agents-0.1.0/src/agentmatrix/backends/mock_llm.py +35 -0
  22. matrix_for_agents-0.1.0/src/agentmatrix/cli_runner.py +94 -0
  23. matrix_for_agents-0.1.0/src/agentmatrix/core/__init__.py +0 -0
  24. matrix_for_agents-0.1.0/src/agentmatrix/core/action.py +50 -0
  25. matrix_for_agents-0.1.0/src/agentmatrix/core/browser/bing.py +208 -0
  26. matrix_for_agents-0.1.0/src/agentmatrix/core/browser/browser_adapter.py +298 -0
  27. matrix_for_agents-0.1.0/src/agentmatrix/core/browser/browser_common.py +85 -0
  28. matrix_for_agents-0.1.0/src/agentmatrix/core/browser/drission_page_adapter.py +1296 -0
  29. matrix_for_agents-0.1.0/src/agentmatrix/core/browser/google.py +230 -0
  30. matrix_for_agents-0.1.0/src/agentmatrix/core/cerebellum.py +121 -0
  31. matrix_for_agents-0.1.0/src/agentmatrix/core/events.py +22 -0
  32. matrix_for_agents-0.1.0/src/agentmatrix/core/loader.py +185 -0
  33. matrix_for_agents-0.1.0/src/agentmatrix/core/loader_v1.py +146 -0
  34. matrix_for_agents-0.1.0/src/agentmatrix/core/log_util.py +158 -0
  35. matrix_for_agents-0.1.0/src/agentmatrix/core/message.py +32 -0
  36. matrix_for_agents-0.1.0/src/agentmatrix/core/prompt_engine.py +30 -0
  37. matrix_for_agents-0.1.0/src/agentmatrix/core/runtime.py +211 -0
  38. matrix_for_agents-0.1.0/src/agentmatrix/core/session.py +20 -0
  39. matrix_for_agents-0.1.0/src/agentmatrix/db/__init__.py +1 -0
  40. matrix_for_agents-0.1.0/src/agentmatrix/db/database.py +79 -0
  41. matrix_for_agents-0.1.0/src/agentmatrix/db/vector_db.py +213 -0
  42. matrix_for_agents-0.1.0/src/agentmatrix/docs/Design.md +109 -0
  43. matrix_for_agents-0.1.0/src/agentmatrix/docs/Framework Capbilities.md +105 -0
  44. matrix_for_agents-0.1.0/src/agentmatrix/docs/Planner Design.md +148 -0
  45. matrix_for_agents-0.1.0/src/agentmatrix/docs/crawler_flow.md +110 -0
  46. matrix_for_agents-0.1.0/src/agentmatrix/docs/report_writer.md +83 -0
  47. matrix_for_agents-0.1.0/src/agentmatrix/docs/review.md +99 -0
  48. matrix_for_agents-0.1.0/src/agentmatrix/docs/skill_design.md +23 -0
  49. matrix_for_agents-0.1.0/src/agentmatrix/profiles/claude_coder.yml +40 -0
  50. matrix_for_agents-0.1.0/src/agentmatrix/profiles/mark.yml +26 -0
  51. matrix_for_agents-0.1.0/src/agentmatrix/profiles/planner.yml +21 -0
  52. matrix_for_agents-0.1.0/src/agentmatrix/profiles/prompts/base.txt +88 -0
  53. matrix_for_agents-0.1.0/src/agentmatrix/profiles/prompts/base_v1.txt +101 -0
  54. matrix_for_agents-0.1.0/src/agentmatrix/profiles/prompts/base_v2.txt +94 -0
  55. matrix_for_agents-0.1.0/src/agentmatrix/profiles/tom_the_data_crawler.yml +38 -0
  56. matrix_for_agents-0.1.0/src/agentmatrix/profiles/user_proxy.yml +17 -0
  57. matrix_for_agents-0.1.0/src/agentmatrix/skills/__init__.py +1 -0
  58. matrix_for_agents-0.1.0/src/agentmatrix/skills/crawler_helpers.py +315 -0
  59. matrix_for_agents-0.1.0/src/agentmatrix/skills/data_crawler.py +777 -0
  60. matrix_for_agents-0.1.0/src/agentmatrix/skills/filesystem.py +204 -0
  61. matrix_for_agents-0.1.0/src/agentmatrix/skills/notebook.py +158 -0
  62. matrix_for_agents-0.1.0/src/agentmatrix/skills/project_management.py +114 -0
  63. matrix_for_agents-0.1.0/src/agentmatrix/skills/report_writer.py +194 -0
  64. matrix_for_agents-0.1.0/src/agentmatrix/skills/report_writer_utils.py +379 -0
  65. matrix_for_agents-0.1.0/src/agentmatrix/skills/search_tool.py +383 -0
  66. matrix_for_agents-0.1.0/src/agentmatrix/skills/terminal_ctrl.py +122 -0
  67. matrix_for_agents-0.1.0/src/agentmatrix/skills/utils.py +33 -0
  68. matrix_for_agents-0.1.0/src/agentmatrix/skills/web_searcher.py +1107 -0
  69. matrix_for_agents-0.1.0/src/matrix_for_agents.egg-info/PKG-INFO +262 -0
  70. matrix_for_agents-0.1.0/src/matrix_for_agents.egg-info/SOURCES.txt +71 -0
  71. matrix_for_agents-0.1.0/src/matrix_for_agents.egg-info/dependency_links.txt +1 -0
  72. matrix_for_agents-0.1.0/src/matrix_for_agents.egg-info/requires.txt +23 -0
  73. matrix_for_agents-0.1.0/src/matrix_for_agents.egg-info/top_level.txt +1 -0
@@ -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 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 those 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 2025 Agent-Matrix Contributors
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,68 @@
1
+ # Include essential files
2
+ include README.md
3
+ include LICENSE
4
+ include requirements.txt
5
+ include pyproject.toml
6
+
7
+ # Include example scripts
8
+ include src/agentmatrix/cli_runner.py
9
+
10
+ # Include Python source files from src
11
+ recursive-include src/agentmatrix/agents *.py
12
+ recursive-include src/agentmatrix/core *.py
13
+ recursive-include src/agentmatrix/skills *.py
14
+ recursive-include src/agentmatrix/backends *.py
15
+ recursive-include src/agentmatrix/db *.py
16
+
17
+ # Include configuration and documentation files
18
+ recursive-include src/agentmatrix/profiles *.yaml *.yml
19
+ exclude src/agentmatrix/profiles/.env
20
+ recursive-include src/agentmatrix/docs *.md *.txt
21
+
22
+ # Exclude test files and directories
23
+ exclude test/*
24
+ exclude Tests/*
25
+ recursive-exclude test *
26
+ recursive-exclude Tests *
27
+
28
+ # Exclude sample and workspace directories
29
+ exclude Samples/*
30
+ exclude TestWorkspace/*
31
+
32
+ # Exclude database files
33
+ exclude *.db
34
+ exclude agents.db
35
+
36
+ # Exclude environment and configuration files
37
+ exclude .env
38
+ exclude .env.local
39
+ exclude .env.*.local
40
+
41
+ # Exclude log and download directories
42
+ exclude logs/*
43
+ exclude downloads/*
44
+
45
+ # Exclude Python cache
46
+ exclude __pycache__
47
+ recursive-exclude __pycache__ *
48
+ exclude *.pyc
49
+ exclude *.pyo
50
+ exclude *.pyd
51
+
52
+ # Exclude development tools and IDE files
53
+ exclude .vscode/*
54
+ exclude .idea/*
55
+ exclude *.swp
56
+ exclude *.swo
57
+
58
+ # Exclude version control
59
+ exclude .git/*
60
+ exclude .gitignore
61
+
62
+ # Exclude project entry scripts (keep cli_runner.py as example)
63
+ exclude main.py
64
+ exclude server.py
65
+
66
+ # Exclude OS files
67
+ exclude .DS_Store
68
+ exclude Thumbs.db
@@ -0,0 +1,262 @@
1
+ Metadata-Version: 2.4
2
+ Name: matrix-for-agents
3
+ Version: 0.1.0
4
+ Summary: An intelligent agent framework with pluggable skills and LLM integrations
5
+ Author: Agent-Matrix Contributors
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/webdkt/agentmatrix
8
+ Project-URL: Documentation, https://github.com/webdkt/agentmatrix/docs
9
+ Project-URL: Repository, https://github.com/webdkt/agentmatrix
10
+ Project-URL: Issues, https://github.com/webdkt/agentmatrix/issues
11
+ Keywords: agents,ai,llm,framework,multi-agent
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
15
+ Classifier: License :: OSI Approved :: Apache Software License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Requires-Python: >=3.12
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: fastapi>=0.100.0
23
+ Requires-Dist: uvicorn>=0.23.0
24
+ Requires-Dist: websockets>=11.0
25
+ Requires-Dist: pyyaml>=6.0
26
+ Requires-Dist: python-dotenv>=1.0.0
27
+ Requires-Dist: requests>=2.31.0
28
+ Requires-Dist: aioconsole>=0.6.0
29
+ Requires-Dist: aiohttp>=3.8.0
30
+ Requires-Dist: Jinja2>=3.1.0
31
+ Requires-Dist: chromadb>=0.4.0
32
+ Requires-Dist: sentence-transformers>=2.2.0
33
+ Requires-Dist: trafilatura>=1.6.0
34
+ Requires-Dist: DrissionPage>=4.0.0
35
+ Requires-Dist: beautifulsoup4>=4.12.0
36
+ Requires-Dist: marker-pdf==1.8.0
37
+ Requires-Dist: PyMuPDF>=1.23.0
38
+ Requires-Dist: libtmux>=0.52.0
39
+ Provides-Extra: dev
40
+ Requires-Dist: pytest>=7.0; extra == "dev"
41
+ Requires-Dist: black>=23.0; extra == "dev"
42
+ Requires-Dist: flake8>=6.0; extra == "dev"
43
+ Requires-Dist: mypy>=1.0; extra == "dev"
44
+ Dynamic: license-file
45
+
46
+ # Agent-Matrix
47
+
48
+ A cognition-centric autonomous agent framework with pluggable skills and multi-backend LLM integrations.
49
+
50
+ ## Overview
51
+
52
+ Agent-Matrix is a multi-agent framework where agents act as independent "digital employees" that collaborate through asynchronous messaging (similar to email) rather than rigid API calls.
53
+
54
+ Designed for building robust, intelligent systems that can reason, negotiate, and handle ambiguity like humans do.
55
+
56
+ ## Core Philosophy
57
+
58
+ The core philosophy is simple: Many agent frameworks force powerful LLMs to "think" in rigid formats like JSON, which is error-prone and limits their reasoning capabilities.
59
+
60
+ **Agent-Matrix's approach**: Let LLMs communicate, think, and output in natural language. The brain should focus on reasoning, not JSON conversion.
61
+
62
+ Agent-Matrix solves this with a **Brain + Cerebellum + Body** architecture:
63
+
64
+ - ๐Ÿง  **Brain (The LLM):** Strategic thinker. Uses natural language for high-level reasoning and intent formation. Like a pilot in a cockpit deciding "where to go" without worrying about switch details.
65
+ - ๐Ÿง  **Cerebellum (The SLM):** Precise interface manager. Translates natural language intent into machine-executable commands (JSON). Understands intent and fills in JSON.
66
+ - ๐Ÿ’ช **Body**: The Python program that executes functions based on JSON and provides feedback.
67
+
68
+ When the brain's intent is unclear (e.g., "send email" without specifying recipient), the cerebellum doesn't error or blindly execute. Instead, it **initiates "negotiation"** by sending an internal query back to the brain for clarification. This internal dialogue makes agents exceptionally robust and intelligent.
69
+
70
+ ## Core Concepts
71
+
72
+ - **Agent**: A digital employee with a specific persona and capability list
73
+ - **PostOffice**: Central communication hub for all inter-agent messages
74
+ - **Runtime (the Matrix)**: Execution environment including memory structures and directory layout
75
+ - **Signal**: Information unit in the system - new emails, tool results, or cerebellum queries
76
+ - **Email**: How agents communicate. Email reply chains automatically maintain conversation context
77
+
78
+ ## How It Works: Turn-Based Loop
79
+
80
+ An agent's lifecycle is like a turn-based game:
81
+
82
+ 1. **Awake**: A `Signal` arrives, waking the agent from sleep
83
+ 2. **Reasoning**: Brain analyzes signal and history, reasoning in the `THOUGHT` section (internal monologue)
84
+ 3. **Decision**: Brain makes a decision and outputs a clear `ACTION SIGNAL`, e.g., "Send Coder an email with code review request"
85
+ 4. **Negotiation**: Cerebellum intercepts the instruction
86
+ - **If clear**: Translate to JSON and let it through
87
+ - **If unclear**: Pause execution, generate an `[INTERNAL QUERY]` signal back to brain, starting a "sub-turn" for clarification
88
+ 5. **Execution**: Agent's "body" executes the cerebellum-validated instruction
89
+ 6. **Feedback & Rest**: Action results immediately return as `[BODY FEEDBACK]` signal, triggering next turn. This continues until brain explicitly decides `rest_n_wait` action
90
+
91
+ See `docs/Design.md` for detailed architecture.
92
+
93
+ ## Key Features & Advantages
94
+
95
+ - โœ… **Exceptional Robustness**: "Negotiation mechanism" fundamentally eliminates execution failures from format errors or unclear intent
96
+ - ๐Ÿง  **Stronger Intelligence**: Decouples "thinking" from "actioning", letting the brain (LLM) do complex reasoning unencumbered by formats
97
+ - ๐ŸŒ **True Asynchronous Collaboration**: Message passing through "post office" naturally supports complex, parallel social agent workflows
98
+ - ๐Ÿง˜ **Explicit Will-Driven**: Agents have "free will". Must actively decide when to rest (`rest_n_wait`), making multi-step tasks simple and natural
99
+
100
+ **The biggest advantage**: Makes workflow design remarkably simple
101
+
102
+ ## Trade-offs
103
+
104
+ Everything has trade-offs. This architecture has two potential drawbacks:
105
+
106
+ 1. When brain and cerebellum negotiate clarification, multiple rounds of dialogue may consume more tokens
107
+ 2. Fully asynchronous mechanism with email communication means each agent processes emails serially. While beneficial, tasks may sit in queue longer before processing
108
+
109
+ However, these aren't major issues. What matters most for agents is intelligence and robustness - autonomously completing work correctly. Taking one hour vs two hours doesn't matter much. And token costs will only decrease long-term. Spending tokens to do things right is worth it.
110
+
111
+ ## Installation
112
+
113
+ ```bash
114
+ pip install agent-matrix
115
+ ```
116
+
117
+ ## Quick Start
118
+
119
+ ### Basic Usage
120
+
121
+ ```python
122
+ from agent_matrix import AgentMatrix
123
+
124
+ # Initialize the framework
125
+ matrix = AgentMatrix(
126
+ agent_profile_path="profiles",
127
+ matrix_path="./my_workspace"
128
+ )
129
+
130
+ # Start the runtime (this will load all agents from profiles)
131
+ await matrix.run()
132
+ ```
133
+
134
+ ### Using the CLI Runner (Recommended for First-Time Users)
135
+
136
+ The package includes `cli_runner.py` as a practical example for interacting with agents:
137
+
138
+ ```python
139
+ # Run the CLI runner
140
+ python cli_runner.py
141
+ ```
142
+
143
+ The CLI runner provides:
144
+ - ๐Ÿ“ฅ Interactive command-line interface
145
+ - ๐Ÿ’ฌ Real-time agent communication
146
+ - ๐Ÿ”„ Multi-session support
147
+ - ๐Ÿ“ Message reply tracking
148
+
149
+ **Usage Example:**
150
+ ```bash
151
+ # Start the CLI
152
+ $ python cli_runner.py
153
+ >>> ็ณป็ปŸๅฏๅŠจใ€‚ๅฏไปฅๅœจไธ‹้ข่พ“ๅ…ฅๆŒ‡ไปคใ€‚
154
+ >>> ไพ‹ๅฆ‚: Planner: ๅธฎๆˆ‘ๅˆ†ๆžๆ•ฐๆฎ
155
+
156
+ # Send a message to an agent
157
+ >> Planner: ่ฏทๅธฎๆˆ‘็ˆฌๅ–็ฝ‘้กตๆ•ฐๆฎ
158
+
159
+ # Start a new session
160
+ >> new session
161
+ โœ… ๆ–ฐไผš่ฏๅผ€ๅง‹ ID: a1b2c3d4-...
162
+
163
+ # Reply to a specific message
164
+ >> reply: msg-123: ่ฐข่ฐขไฝ ็š„ๅˆ†ๆž
165
+
166
+ # Exit and save
167
+ >> exit
168
+ ```
169
+
170
+ The CLI runner demonstrates:
171
+ - How to initialize the AgentMatrix framework
172
+ - How to set up event callbacks
173
+ - How to communicate with agents through the User proxy
174
+ - How to handle multi-session conversations
175
+
176
+ For full source code, see `cli_runner.py` in the package installation directory.
177
+
178
+ ## Project Structure
179
+
180
+ ```
181
+ agent-matrix/
182
+ โ”œโ”€โ”€ agents/ # Agent implementations
183
+ โ”‚ โ”œโ”€โ”€ base.py # Base agent class
184
+ โ”‚ โ””โ”€โ”€ post_office.py # Message routing system
185
+ โ”œโ”€โ”€ core/ # Core framework
186
+ โ”‚ โ”œโ”€โ”€ runtime.py # Main runtime
187
+ โ”‚ โ”œโ”€โ”€ message.py # Email/Signal definitions
188
+ โ”‚ โ””โ”€โ”€ browser/ # Browser automation
189
+ โ”œโ”€โ”€ skills/ # Built-in skills
190
+ โ”‚ โ”œโ”€โ”€ data_crawler.py # Web scraping
191
+ โ”‚ โ”œโ”€โ”€ web_searcher.py # Web search
192
+ โ”‚ โ””โ”€โ”€ filesystem.py # File operations
193
+ โ”œโ”€โ”€ backends/ # LLM integrations
194
+ โ”œโ”€โ”€ db/ # Database layer
195
+ โ”œโ”€โ”€ profiles/ # Agent configurations (YAML)
196
+ โ””โ”€โ”€ docs/ # Documentation
197
+ ```
198
+
199
+ ## Usage Examples
200
+
201
+ ### Agent Communication
202
+
203
+ ```python
204
+ from agent_matrix import Email
205
+
206
+ email = Email(
207
+ sender="researcher",
208
+ recipient="analyst",
209
+ subject="Data Analysis Request",
210
+ body="Please analyze the crawled data...",
211
+ user_session_id="session_123"
212
+ )
213
+
214
+ # Send through post office
215
+ await matrix.post_office.dispatch(email)
216
+ ```
217
+
218
+ ### Built-in Skills
219
+
220
+ Agents automatically load skills based on their profiles:
221
+
222
+ ```yaml
223
+ # profiles/analyst.yaml
224
+ name: "analyst"
225
+ description: "Data analysis specialist"
226
+ skills:
227
+ - filesystem
228
+ - web_searcher
229
+ ```
230
+
231
+ ## Requirements
232
+
233
+ - Python 3.8 or higher
234
+ - See `requirements.txt` for full dependency list
235
+
236
+ ## License
237
+
238
+ Apache License 2.0 - see [LICENSE](LICENSE) file for details
239
+
240
+ ## Contributing
241
+
242
+ Contributions welcome! Please feel free to submit a Pull Request.
243
+
244
+ ## Roadmap
245
+
246
+ - [ ] Enhanced multi-agent collaboration patterns
247
+ - [ ] More built-in skills
248
+ - [ ] Improved documentation and tutorials
249
+ - [ ] Performance optimizations
250
+ - [ ] Additional backend integrations
251
+
252
+ ## Acknowledgments
253
+
254
+ - Built with [FastAPI](https://fastapi.tiangolo.com/)
255
+ - Browser automation powered by [DrissionPage](https://drissionpage.cn/)
256
+ - Vector search with [ChromaDB](https://www.trychroma.com/)
257
+
258
+ ---
259
+
260
+ **Note**: Agent-Matrix is currently in alpha release (v0.1.0). APIs and features may evolve as we develop the framework.
261
+
262
+ For Chinese documentation, see [readme_zh.md](readme_zh.md)