agentmatrix-core 0.7.0.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 (46) hide show
  1. agentmatrix_core-0.7.0.0/LICENSE +190 -0
  2. agentmatrix_core-0.7.0.0/MANIFEST.in +68 -0
  3. agentmatrix_core-0.7.0.0/PKG-INFO +309 -0
  4. agentmatrix_core-0.7.0.0/pyproject.toml +60 -0
  5. agentmatrix_core-0.7.0.0/readme.md +275 -0
  6. agentmatrix_core-0.7.0.0/requirements.txt +23 -0
  7. agentmatrix_core-0.7.0.0/setup.cfg +4 -0
  8. agentmatrix_core-0.7.0.0/src/agentmatrix/core/__init__.py +0 -0
  9. agentmatrix_core-0.7.0.0/src/agentmatrix/core/action.py +62 -0
  10. agentmatrix_core-0.7.0.0/src/agentmatrix/core/agent_shell.py +99 -0
  11. agentmatrix_core-0.7.0.0/src/agentmatrix/core/backends/__init__.py +1 -0
  12. agentmatrix_core-0.7.0.0/src/agentmatrix/core/backends/llm_client.py +1320 -0
  13. agentmatrix_core-0.7.0.0/src/agentmatrix/core/backends/mock_llm.py +35 -0
  14. agentmatrix_core-0.7.0.0/src/agentmatrix/core/cerebellum.py +184 -0
  15. agentmatrix_core-0.7.0.0/src/agentmatrix/core/events.py +27 -0
  16. agentmatrix_core-0.7.0.0/src/agentmatrix/core/exceptions.py +113 -0
  17. agentmatrix_core-0.7.0.0/src/agentmatrix/core/id_generator.py +213 -0
  18. agentmatrix_core-0.7.0.0/src/agentmatrix/core/interfaces.py +46 -0
  19. agentmatrix_core-0.7.0.0/src/agentmatrix/core/log_config.py +71 -0
  20. agentmatrix_core-0.7.0.0/src/agentmatrix/core/log_util.py +212 -0
  21. agentmatrix_core-0.7.0.0/src/agentmatrix/core/message.py +61 -0
  22. agentmatrix_core-0.7.0.0/src/agentmatrix/core/micro_agent.py +1538 -0
  23. agentmatrix_core-0.7.0.0/src/agentmatrix/core/prompt_templates.py +61 -0
  24. agentmatrix_core-0.7.0.0/src/agentmatrix/core/readable_id_generator.py +80 -0
  25. agentmatrix_core-0.7.0.0/src/agentmatrix/core/session_store.py +27 -0
  26. agentmatrix_core-0.7.0.0/src/agentmatrix/core/signals.py +135 -0
  27. agentmatrix_core-0.7.0.0/src/agentmatrix/core/skills/__init__.py +5 -0
  28. agentmatrix_core-0.7.0.0/src/agentmatrix/core/skills/base.py +40 -0
  29. agentmatrix_core-0.7.0.0/src/agentmatrix/core/skills/registry.py +629 -0
  30. agentmatrix_core-0.7.0.0/src/agentmatrix/core/state_manager.py +96 -0
  31. agentmatrix_core-0.7.0.0/src/agentmatrix/core/utils/__init__.py +17 -0
  32. agentmatrix_core-0.7.0.0/src/agentmatrix/core/utils/micro_agent_utils.py +573 -0
  33. agentmatrix_core-0.7.0.0/src/agentmatrix/core/utils/parser_utils.py +67 -0
  34. agentmatrix_core-0.7.0.0/src/agentmatrix/core/utils/skill_parser_utils.py +330 -0
  35. agentmatrix_core-0.7.0.0/src/agentmatrix/core/utils/token_utils.py +91 -0
  36. agentmatrix_core-0.7.0.0/src/agentmatrix/profiles/deep_researcher.yml +45 -0
  37. agentmatrix_core-0.7.0.0/src/agentmatrix/profiles/mark.yml +51 -0
  38. agentmatrix_core-0.7.0.0/src/agentmatrix/profiles/planner.yml +38 -0
  39. agentmatrix_core-0.7.0.0/src/agentmatrix/profiles/researcher.yml +24 -0
  40. agentmatrix_core-0.7.0.0/src/agentmatrix/profiles/system_admin.yml +187 -0
  41. agentmatrix_core-0.7.0.0/src/agentmatrix/profiles/user_proxy.yml +14 -0
  42. agentmatrix_core-0.7.0.0/src/agentmatrix_core.egg-info/PKG-INFO +309 -0
  43. agentmatrix_core-0.7.0.0/src/agentmatrix_core.egg-info/SOURCES.txt +44 -0
  44. agentmatrix_core-0.7.0.0/src/agentmatrix_core.egg-info/dependency_links.txt +1 -0
  45. agentmatrix_core-0.7.0.0/src/agentmatrix_core.egg-info/requires.txt +12 -0
  46. agentmatrix_core-0.7.0.0/src/agentmatrix_core.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,309 @@
1
+ Metadata-Version: 2.4
2
+ Name: agentmatrix-core
3
+ Version: 0.7.0.0
4
+ Summary: Core execution engine for building AI agent applications — MicroAgent, AgentShell protocol, Cerebellum, and skill system
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/core
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: pyyaml>=6.0
23
+ Requires-Dist: python-dotenv>=1.0.0
24
+ Requires-Dist: requests>=2.31.0
25
+ Requires-Dist: aiohttp>=3.8.0
26
+ Requires-Dist: Jinja2>=3.1.0
27
+ Requires-Dist: pydantic>=2.0.0
28
+ Provides-Extra: dev
29
+ Requires-Dist: pytest>=7.0; extra == "dev"
30
+ Requires-Dist: black>=23.0; extra == "dev"
31
+ Requires-Dist: flake8>=6.0; extra == "dev"
32
+ Requires-Dist: mypy>=1.0; extra == "dev"
33
+ Dynamic: license-file
34
+
35
+ # AgentMatrix
36
+
37
+ [English](readme.md) | [中文](readme_zh.md)
38
+
39
+ **Let LLMs think. Don't make them write JSON.**
40
+
41
+ Why does getting a powerful language model to do anything require first teaching it JSON syntax? You ask GPT to research a topic. It has to understand your intent, *and* carefully output perfectly formatted JSON. Two completely different skills—reasoning and formatting—forced into one output channel. Like solving calculus while writing calligraphy. Both tasks suffer.
42
+
43
+ AgentMatrix separates these two concerns. The large model thinks. The small model handles the format. That's it.
44
+
45
+ ---
46
+
47
+ ## Architecture
48
+
49
+ After the latest refactoring, AgentMatrix follows a clean three-layer architecture:
50
+
51
+ ```
52
+ ┌─────────────────────────────────────────────┐
53
+ │ App Layer Desktop App / CLI / Server │
54
+ ├─────────────────────────────────────────────┤
55
+ │ Shell Layer AgentShell Protocol │
56
+ │ (interface between layers) │
57
+ ├─────────────────────────────────────────────┤
58
+ │ Core Layer MicroAgent Engine │
59
+ │ (pure execution, no I/O) │
60
+ └─────────────────────────────────────────────┘
61
+ ```
62
+
63
+ - **Core Layer** — `MicroAgent` is the execution engine. It knows nothing about desktop apps, CLI, or file systems. Pure reasoning loop: think → detect actions → execute → repeat.
64
+ - **Shell Layer** — `AgentShell` is the protocol that connects Core to the outside world. Each app form (Desktop, CLI, Server) implements this interface, providing LLM clients, prompt templates, checkpoint logic, compression strategy, and session storage.
65
+ - **App Layer** — Specific applications that wire everything together: the Desktop App, CLI tools, or a FastAPI server.
66
+
67
+ This separation means the same core agent behavior runs everywhere—desktop, terminal, or cloud—without changing a line of Core code.
68
+
69
+ ---
70
+
71
+ ## What Agents Can Do
72
+
73
+ ### Think Freely
74
+
75
+ The agent's "Brain" (large model) reasons entirely in natural language. No JSON output required, no format constraints. A separate "Cerebellum" (smaller model) translates intent into executable parameters. If the intent is ambiguous, the Cerebellum asks the Brain for clarification. Two models, each doing what they're best at.
76
+
77
+ ### Collaborate Like Email
78
+
79
+ Agents don't call each other's APIs. They send emails. Natural language emails.
80
+
81
+ You can read what agents are saying to each other, trace conversation threads, and understand *why* an agent did something. It doesn't just return a status code—it explains its reasoning. Debugging multi-agent systems feels natural for the first time.
82
+
83
+ ### Pause, Resume, Stop — Anytime
84
+
85
+ Any running agent can be paused, resumed, or stopped. When paused, it halts at a safe checkpoint, saves its state, and can be resumed later. Stopping the current task doesn't affect the agent's ability to receive new emails.
86
+
87
+ ### Run Extremely Long Jobs Without Blowing Up Context
88
+
89
+ When conversation history grows too large, the system automatically compresses it into "Working Notes"—a dynamic state snapshot generated by the LLM. This isn't a fixed template; the LLM analyzes the conversation type (research, knowledge, creative writing) and generates the optimal structure for that context. Tasks can run for hours or days; the context window never overflows.
90
+
91
+ ### Ask You Questions Mid-Execution
92
+
93
+ Agents can pause mid-task and ask you a question, then wait for your answer before continuing. The desktop app shows a dialog. You can also reply by email. Dual notification channels—desktop popup plus email—so you never miss it.
94
+
95
+ ### Isolated Workspaces Per Task
96
+
97
+ Every task gets its own private working directory. Files created in Task A don't interfere with Task B. Workspaces switch automatically when the agent moves between tasks.
98
+
99
+ ### Run in Isolated Containers
100
+
101
+ Each agent runs in its own Docker container. File operations execute inside the container. Agents can't interfere with each other. Containers wake and hibernate on demand—dormant when idle, automatically activated when new mail arrives.
102
+
103
+ ### Survive Restarts
104
+
105
+ Conversation history is automatically persisted via `SessionStore`. After a shutdown and restart, agents resume from where they left off. Tasks in progress are not lost.
106
+
107
+ ### Recover from LLM Outages
108
+
109
+ If the LLM service goes down during execution, the agent enters a wait mode, periodically checking for recovery. When the service comes back, execution continues automatically. No progress is lost.
110
+
111
+ ---
112
+
113
+ ## System Management: In Natural Language
114
+
115
+ Because LLMs naturally read YAML/JSON, system configuration can be managed entirely through natural language.
116
+
117
+ ### SystemAdmin Agent
118
+
119
+ No need to edit config files manually. Just tell SystemAdmin what you want:
120
+
121
+ - "Add a new LLM model using GPT-4o"
122
+ - "Turn off the email proxy"
123
+ - "Show me the current system configuration"
124
+
125
+ SystemAdmin reads the config, validates the format, tests connections, backs up the old version, and writes the new one. Natural language feedback at every step.
126
+
127
+ ### AgentAdmin Agent
128
+
129
+ Manage other agents' lifecycles in natural language:
130
+
131
+ - "Create an agent called Researcher with web_search and memory skills"
132
+ - "Clone Writer as Editor"
133
+ - "Stop Researcher's current task"
134
+ - "Delete Editor"
135
+
136
+ Creation validates that skills exist and models are reachable. Edits are auto-backed up. Rollback is supported—view and restore any historical config version.
137
+
138
+ ---
139
+
140
+ ## Skill System
141
+
142
+ ### Built-in Skills
143
+
144
+ | Skill | Capability |
145
+ |-------|------------|
146
+ | base | Date/time utilities |
147
+ | file | File read/write, search, command execution |
148
+ | shell | Shell command execution |
149
+ | browser | Browser automation |
150
+ | web_search | Web search |
151
+ | email | Send emails to other agents (with attachments) |
152
+ | memory | Knowledge and memory management |
153
+ | vision | Image analysis |
154
+ | markdown | Markdown processing |
155
+ | scheduler | Scheduled tasks (with recurring support) |
156
+ | system_admin | System configuration management |
157
+ | agent_admin | Agent lifecycle management |
158
+
159
+ ### Extend with Code
160
+
161
+ Write custom Python skills for domain-specific capabilities. Skills can declare dependencies on each other—resolved automatically.
162
+
163
+ ### Extend with Markdown (Recommended)
164
+
165
+ No code required. Place a `skill.md` file in the workspace's `SKILLS/` directory, describing procedures and workflows in Markdown. The agent reads it as procedural knowledge. Define SOPs, workflows, domain expertise—plain text is enough.
166
+
167
+ ---
168
+
169
+ ## Components
170
+
171
+ ### 1. Core Framework (`src/agentmatrix/`)
172
+
173
+ The Python package `agentmatrix-core`. Install it and build your own agent application.
174
+
175
+ ```bash
176
+ pip install agentmatrix-core
177
+ ```
178
+
179
+ Key modules:
180
+ - `core/micro_agent.py` — The execution engine
181
+ - `core/agent_shell.py` — Shell protocol (implement this for your app)
182
+ - `core/cerebellum.py` — Intent-to-action parameter negotiation
183
+ - `core/action.py` — Action registry and execution
184
+ - `core/session_store.py` — Session persistence interface
185
+ - `core/signals.py` — Event-driven communication
186
+ - `skills/` — Built-in skills (Python mixins)
187
+
188
+ ### 2. Desktop App (`agentmatrix-desktop/`)
189
+
190
+ Native desktop application built on Tauri (Rust) + Vue 3.
191
+
192
+ - **Matrix-themed init wizard** — Full-screen character rain animation, typewriter reveal, step-by-step configuration
193
+ - **Real-time status** — Agent status pushed via WebSocket. No refresh, no polling
194
+ - **Email-style interaction** — Write to agents like writing to a colleague. Drag-and-drop attachments
195
+ - **Prompt preview** — View any agent's complete System Prompt
196
+ - **Settings GUI** — Manage LLM config and email proxy without touching config files
197
+ - **Bilingual** — Full Chinese and English interface
198
+
199
+ ### 3. CLI Tutorial (`tutorial/cli-agent/`)
200
+
201
+ A minimal working example that shows how to build a terminal agent using the Core framework. ~200 lines of code, implements `AgentShell`, and wires up `MicroAgent` with three basic skills.
202
+
203
+ Start here if you want to understand the architecture or build your own app.
204
+
205
+ ---
206
+
207
+ ## Quick Start
208
+
209
+ ### Try the CLI Tutorial
210
+
211
+ ```bash
212
+ cd tutorial/cli-agent
213
+
214
+ # Set your API key
215
+ export OPENAI_API_KEY=sk-xxx
216
+
217
+ # Run with a model
218
+ python main.py -m openai:gpt-4o
219
+ ```
220
+
221
+ This gives you a fully functional terminal agent with file, shell, and base skills. Supports Textual TUI (if installed) or falls back to simple mode.
222
+
223
+ ### Desktop App
224
+
225
+ ```bash
226
+ cd agentmatrix-desktop
227
+ npm install
228
+ npm run tauri:dev
229
+ ```
230
+
231
+ The init wizard launches on first run.
232
+
233
+ ### Use Core as a Library
234
+
235
+ ```bash
236
+ pip install agentmatrix-core
237
+ ```
238
+
239
+ Then implement `AgentShell` and create your own agent application. See `tutorial/cli-agent/` for a complete working example.
240
+
241
+ ---
242
+
243
+ ## Email Proxy: Talk to Agents via Real Email
244
+
245
+ Configure the email proxy and interact with agents using Gmail, Outlook, QQ Mail, or any email client:
246
+
247
+ - Send an email with `@AgentName` in the subject → the agent receives and processes it
248
+ - Agent replies are forwarded to your inbox, maintaining the email thread
249
+ - When an agent asks you a question, just reply to the email
250
+ - Attachments transfer automatically in both directions
251
+
252
+ ---
253
+
254
+ ## Project Structure
255
+
256
+ ```
257
+ agentmatrix/
258
+ ├── src/agentmatrix/ # Core framework (pip install agentmatrix-core)
259
+ │ ├── core/ # MicroAgent, AgentShell, Cerebellum, Actions
260
+ │ ├── skills/ # Built-in skills (Python mixins)
261
+ │ ├── agents/ # BaseAgent
262
+ │ ├── backends/ # LLM backend integrations
263
+ │ ├── profiles/ # Agent profiles and configurations
264
+ │ └── services/ # ConfigService, etc.
265
+ ├── agentmatrix-desktop/ # Desktop app (Tauri + Vue 3)
266
+ │ ├── src/ # Vue 3 frontend
267
+ │ └── src-tauri/ # Rust backend
268
+ ├── tutorial/cli-agent/ # CLI tutorial and demo
269
+ │ ├── main.py # Entry point + TUI
270
+ │ ├── cli_shell.py # AgentShell implementation
271
+ │ ├── cli_config.py # Configuration
272
+ │ └── skills/ # Basic skills (file, shell, base)
273
+ ├── docs/ # Documentation
274
+ ├── examples/ # Examples
275
+ └── server.py # FastAPI server
276
+ ```
277
+
278
+ ---
279
+
280
+ ## Documentation
281
+
282
+ **Core Framework** (`docs/core/`)
283
+ - [Brain, Cerebellum & Actions](docs/core/01-大脑小脑与动作.md)
284
+ - [Event-Driven Execution Loop](docs/core/02-事件驱动的执行循环.md)
285
+ - [System Prompt Structure](docs/core/03-System-Prompt的构成.md)
286
+ - [Session Auto-Compression](docs/core/04-会话自动压缩机制.md)
287
+ - [Python Skill System](docs/core/05-Python-Skill机制.md)
288
+ - [Nested MicroAgent Pattern](docs/core/06-无限嵌套的MicroAgent模式.md)
289
+
290
+ **Desktop App** (`docs/desktop/`)
291
+ - [Architecture Overview](docs/desktop/architecture/01-整体架构概览.md)
292
+ - [Runtime & PostOffice](docs/desktop/architecture/02-运行时与邮局.md)
293
+ - [Config Service & Admin Skills](docs/desktop/services/Config-Service与管理技能.md)
294
+ - [Collab Mode](docs/desktop/architecture/07-Collab模式.md)
295
+
296
+ **Tutorial**
297
+ - [CLI Agent Tutorial](tutorial/cli-agent/README.md)
298
+
299
+ **Full index**: [docs/README.md](docs/README.md)
300
+
301
+ ---
302
+
303
+ ## License
304
+
305
+ Apache License 2.0 — see [LICENSE](LICENSE)
306
+
307
+ ---
308
+
309
+ **Repository**: https://github.com/webdkt/agentmatrix
@@ -0,0 +1,60 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "agentmatrix-core"
7
+ version = "0.7.0.0"
8
+ description = "Core execution engine for building AI agent applications — MicroAgent, AgentShell protocol, Cerebellum, and skill system"
9
+ readme = "readme.md"
10
+ requires-python = ">=3.12"
11
+ license = {text = "Apache-2.0"}
12
+ authors = [
13
+ {name = "Agent-Matrix Contributors"}
14
+ ]
15
+ keywords = ["agents", "ai", "llm", "framework", "multi-agent"]
16
+ classifiers = [
17
+ "Development Status :: 3 - Alpha",
18
+ "Intended Audience :: Developers",
19
+ "Topic :: Software Development :: Libraries :: Application Frameworks",
20
+ "License :: OSI Approved :: Apache Software License",
21
+ "Programming Language :: Python :: 3",
22
+ "Programming Language :: Python :: 3.12",
23
+ "Programming Language :: Python :: 3.13",
24
+ ]
25
+
26
+ dependencies = [
27
+ "pyyaml>=6.0",
28
+ "python-dotenv>=1.0.0",
29
+ "requests>=2.31.0",
30
+ "aiohttp>=3.8.0",
31
+ "Jinja2>=3.1.0",
32
+ "pydantic>=2.0.0",
33
+ ]
34
+
35
+ [project.optional-dependencies]
36
+ dev = [
37
+ "pytest>=7.0",
38
+ "black>=23.0",
39
+ "flake8>=6.0",
40
+ "mypy>=1.0",
41
+ ]
42
+
43
+ [project.urls]
44
+ Homepage = "https://github.com/webdkt/agentmatrix"
45
+ Documentation = "https://github.com/webdkt/agentmatrix/docs/core"
46
+ Repository = "https://github.com/webdkt/agentmatrix"
47
+ Issues = "https://github.com/webdkt/agentmatrix/issues"
48
+
49
+ [tool.setuptools]
50
+ package-dir = {"" = "src"}
51
+
52
+ # agentmatrix.core — includes core.backends, core.skills, core.utils as sub-packages
53
+ [tool.setuptools.packages]
54
+ find = {where = ["src"], include = ["agentmatrix.core*"]}
55
+
56
+ [tool.setuptools.package-data]
57
+ "agentmatrix.core" = ["*.yaml", "*.yml", "*.md", "*.txt"]
58
+
59
+ [tool.setuptools.exclude-package-data]
60
+ "*" = ["*.db", ".env", "*.log"]