altk-evolve 1.0.6__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 (67) hide show
  1. altk_evolve-1.0.6/LICENSE +201 -0
  2. altk_evolve-1.0.6/MANIFEST.in +2 -0
  3. altk_evolve-1.0.6/PKG-INFO +196 -0
  4. altk_evolve-1.0.6/README.md +161 -0
  5. altk_evolve-1.0.6/altk_evolve/__init__.py +1 -0
  6. altk_evolve-1.0.6/altk_evolve/auto/__init__.py +243 -0
  7. altk_evolve-1.0.6/altk_evolve/backend/__init__.py +0 -0
  8. altk_evolve-1.0.6/altk_evolve/backend/base.py +159 -0
  9. altk_evolve-1.0.6/altk_evolve/backend/filesystem.py +267 -0
  10. altk_evolve-1.0.6/altk_evolve/backend/milvus.py +403 -0
  11. altk_evolve-1.0.6/altk_evolve/backend/postgres.py +261 -0
  12. altk_evolve-1.0.6/altk_evolve/cli/__init__.py +1 -0
  13. altk_evolve-1.0.6/altk_evolve/cli/cli.py +548 -0
  14. altk_evolve-1.0.6/altk_evolve/config/__init__.py +0 -0
  15. altk_evolve-1.0.6/altk_evolve/config/evolve.py +14 -0
  16. altk_evolve-1.0.6/altk_evolve/config/filesystem.py +10 -0
  17. altk_evolve-1.0.6/altk_evolve/config/llm.py +35 -0
  18. altk_evolve-1.0.6/altk_evolve/config/milvus.py +24 -0
  19. altk_evolve-1.0.6/altk_evolve/config/phoenix.py +11 -0
  20. altk_evolve-1.0.6/altk_evolve/config/postgres.py +16 -0
  21. altk_evolve-1.0.6/altk_evolve/db/__init__.py +0 -0
  22. altk_evolve-1.0.6/altk_evolve/db/sqlite_manager.py +151 -0
  23. altk_evolve-1.0.6/altk_evolve/frontend/__init__.py +0 -0
  24. altk_evolve-1.0.6/altk_evolve/frontend/api/__init__.py +0 -0
  25. altk_evolve-1.0.6/altk_evolve/frontend/api/routes.py +244 -0
  26. altk_evolve-1.0.6/altk_evolve/frontend/client/__init__.py +0 -0
  27. altk_evolve-1.0.6/altk_evolve/frontend/client/evolve_client.py +298 -0
  28. altk_evolve-1.0.6/altk_evolve/frontend/mcp/__init__.py +0 -0
  29. altk_evolve-1.0.6/altk_evolve/frontend/mcp/__main__.py +37 -0
  30. altk_evolve-1.0.6/altk_evolve/frontend/mcp/mcp_server.py +309 -0
  31. altk_evolve-1.0.6/altk_evolve/frontend/ui/dist/assets/index-BmK3Cy_1.css +1 -0
  32. altk_evolve-1.0.6/altk_evolve/frontend/ui/dist/assets/index-CiC-bwTt.js +43 -0
  33. altk_evolve-1.0.6/altk_evolve/frontend/ui/dist/index.html +14 -0
  34. altk_evolve-1.0.6/altk_evolve/frontend/ui/node_modules/flatted/python/flatted.py +149 -0
  35. altk_evolve-1.0.6/altk_evolve/llm/__init__.py +3 -0
  36. altk_evolve-1.0.6/altk_evolve/llm/conflict_resolution/__init__.py +0 -0
  37. altk_evolve-1.0.6/altk_evolve/llm/conflict_resolution/conflict_resolution.py +62 -0
  38. altk_evolve-1.0.6/altk_evolve/llm/conflict_resolution/prompts/conflict_resolution.jinja2 +40 -0
  39. altk_evolve-1.0.6/altk_evolve/llm/conflict_resolution/prompts/default_conflict_resolution.jinja2 +275 -0
  40. altk_evolve-1.0.6/altk_evolve/llm/fact_extraction/__init__.py +6 -0
  41. altk_evolve-1.0.6/altk_evolve/llm/fact_extraction/categorization.py +59 -0
  42. altk_evolve-1.0.6/altk_evolve/llm/fact_extraction/fact_extraction.py +79 -0
  43. altk_evolve-1.0.6/altk_evolve/llm/fact_extraction/prompts/fact_extraction.jinja2 +47 -0
  44. altk_evolve-1.0.6/altk_evolve/llm/fact_extraction/prompts/fact_extraction_predefined.jinja2 +81 -0
  45. altk_evolve-1.0.6/altk_evolve/llm/tips/__init__.py +0 -0
  46. altk_evolve-1.0.6/altk_evolve/llm/tips/clustering.py +225 -0
  47. altk_evolve-1.0.6/altk_evolve/llm/tips/prompts/combine_tips.jinja2 +47 -0
  48. altk_evolve-1.0.6/altk_evolve/llm/tips/prompts/generate_tips.jinja2 +52 -0
  49. altk_evolve-1.0.6/altk_evolve/llm/tips/tips.py +162 -0
  50. altk_evolve-1.0.6/altk_evolve/schema/__init__.py +0 -0
  51. altk_evolve-1.0.6/altk_evolve/schema/conflict_resolution.py +26 -0
  52. altk_evolve-1.0.6/altk_evolve/schema/core.py +31 -0
  53. altk_evolve-1.0.6/altk_evolve/schema/exceptions.py +21 -0
  54. altk_evolve-1.0.6/altk_evolve/schema/policy.py +38 -0
  55. altk_evolve-1.0.6/altk_evolve/schema/tips.py +34 -0
  56. altk_evolve-1.0.6/altk_evolve/sync/__init__.py +3 -0
  57. altk_evolve-1.0.6/altk_evolve/sync/phoenix_sync.py +578 -0
  58. altk_evolve-1.0.6/altk_evolve/utils/__init__.py +0 -0
  59. altk_evolve-1.0.6/altk_evolve/utils/utils.py +31 -0
  60. altk_evolve-1.0.6/altk_evolve.egg-info/PKG-INFO +196 -0
  61. altk_evolve-1.0.6/altk_evolve.egg-info/SOURCES.txt +65 -0
  62. altk_evolve-1.0.6/altk_evolve.egg-info/dependency_links.txt +1 -0
  63. altk_evolve-1.0.6/altk_evolve.egg-info/entry_points.txt +2 -0
  64. altk_evolve-1.0.6/altk_evolve.egg-info/requires.txt +34 -0
  65. altk_evolve-1.0.6/altk_evolve.egg-info/top_level.txt +1 -0
  66. altk_evolve-1.0.6/pyproject.toml +174 -0
  67. altk_evolve-1.0.6/setup.cfg +4 -0
@@ -0,0 +1,201 @@
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 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
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,2 @@
1
+ recursive-include altk_evolve *.jinja2
2
+ recursive-include altk_evolve/frontend/ui/dist *
@@ -0,0 +1,196 @@
1
+ Metadata-Version: 2.4
2
+ Name: altk-evolve
3
+ Version: 1.0.6
4
+ Summary: Add your description here
5
+ Requires-Python: >=3.12
6
+ Description-Content-Type: text/markdown
7
+ License-File: LICENSE
8
+ Requires-Dist: arize-phoenix>=12.30.0
9
+ Requires-Dist: fastmcp
10
+ Requires-Dist: jinja2
11
+ Requires-Dist: litellm
12
+ Requires-Dist: pydantic
13
+ Requires-Dist: pymilvus[milvus-lite]>=2.6.2; platform_machine != "aarch64"
14
+ Requires-Dist: pymilvus>=2.6.2; platform_machine == "aarch64"
15
+ Requires-Dist: milvus-lite>=2.5.1; platform_machine != "aarch64"
16
+ Requires-Dist: sentence-transformers
17
+ Requires-Dist: typer>=0.9.0
18
+ Requires-Dist: uvicorn
19
+ Provides-Extra: build
20
+ Requires-Dist: uv; extra == "build"
21
+ Provides-Extra: tracing
22
+ Requires-Dist: openinference-instrumentation-openai; extra == "tracing"
23
+ Requires-Dist: openinference-instrumentation-litellm; extra == "tracing"
24
+ Requires-Dist: openinference-instrumentation-smolagents; extra == "tracing"
25
+ Requires-Dist: openinference-instrumentation-openai-agents; extra == "tracing"
26
+ Provides-Extra: pgvector
27
+ Requires-Dist: psycopg[binary]>=3.1; extra == "pgvector"
28
+ Requires-Dist: pgvector>=0.3; extra == "pgvector"
29
+ Provides-Extra: examples
30
+ Requires-Dist: altk-evolve[tracing]; extra == "examples"
31
+ Requires-Dist: smolagents; extra == "examples"
32
+ Requires-Dist: openai-agents; extra == "examples"
33
+ Requires-Dist: openai; extra == "examples"
34
+ Dynamic: license-file
35
+
36
+ <div align="center">
37
+
38
+ # Evolve: On‑the‑job learning for AI agents
39
+
40
+ ![Python](https://img.shields.io/badge/python-3.12%2B-blue)
41
+ ![Status](https://img.shields.io/badge/status-active-brightgreen)
42
+ ![arXiv](https://img.shields.io/badge/arXiv-2603.10600-b31b1b)
43
+ ![License](https://img.shields.io/github/license/AgentToolkit/altk-evolve)
44
+ ![Stars](https://img.shields.io/github/stars/AgentToolkit/altk-evolve?style=social)
45
+ </div>
46
+
47
+ Evolve is a system designed to help agents improve over time by learning from their trajectories. It uses a combination of an MCP server for tool integration, vector storage for memory, and LLM-based conflict resolution to refine its knowledge base.
48
+
49
+ ## Features
50
+
51
+ - **MCP Server**: Exposes tools to get guidelines and save trajectories.
52
+ - **Conflict Resolution**: Intelligently merges new insights with existing guidelines using LLMs.
53
+ - **Trajectory Analysis**: Automatically analyzes agent trajectories to generate guidelines and best practices.
54
+ - **Milvus Integration**: Uses Milvus (or Milvus Lite) for efficient vector storage and retrieval.
55
+
56
+ ## Architecture
57
+
58
+ <img src="https://raw.githubusercontent.com/AgentToolkit/altk-evolve/v1.0.6/docs/assets/architecture.png" alt="Architecture" width="480">
59
+
60
+ ## Quick Start
61
+
62
+ ### Installation
63
+
64
+ Prerequisites:
65
+ - Python 3.12 or higher
66
+ - `uv` (recommended) or `pip`
67
+
68
+ ```bash
69
+ git clone <repository_url>
70
+ cd altk-evolve
71
+ uv venv --python=3.12 && source .venv/bin/activate
72
+ uv sync
73
+ ```
74
+
75
+ ### Configuration
76
+
77
+ For direct OpenAI usage:
78
+ ```bash
79
+ export OPENAI_API_KEY=sk-...
80
+ ```
81
+
82
+ For LiteLLM proxy usage and model selection (including global fallback via `EVOLVE_MODEL_NAME`), see [the configuration guide](https://github.com/AgentToolkit/altk-evolve/blob/v1.0.6/docs/guides/configuration.md).
83
+
84
+ ### Running the MCP Server & UI
85
+
86
+ Evolve provides both a standard MCP server and a full Web UI (Dashboard & Entity Explorer).
87
+
88
+ > [!IMPORTANT]
89
+ > **Building from Source:** If you cloned this repository (rather than installing a pre-built package), you must build the UI before it can be served.
90
+ > ```bash
91
+ > cd altk_evolve/frontend/ui
92
+ > npm ci && npm run build
93
+ > cd ../../../
94
+ > ```
95
+ > See `altk_evolve/frontend/ui/README.md` for more frontend development details.
96
+
97
+ #### Starting Both Automatically
98
+ The easiest way to start both the MCP Server (on standard input/output) and the HTTP UI backend is to run the module directly:
99
+ ```bash
100
+ uv run python -m evolve.frontend.mcp
101
+ ```
102
+ This will start the UI server in the background on port `8000` and the MCP server in the foreground. You can then access the UI locally by opening your browser to:
103
+ `http://127.0.0.1:8000/ui/`
104
+
105
+ #### Starting the UI Standalone
106
+ If you only want to access the Web UI and API (without the MCP server stdio blocking the terminal), you can run the FastAPI application directly using `uvicorn`:
107
+ ```bash
108
+ uv run uvicorn evolve.frontend.mcp.mcp_server:app --host 127.0.0.1 --port 8000
109
+ ```
110
+ Then navigate to `http://127.0.0.1:8000/ui/`.
111
+
112
+ #### Starting only the MCP Server
113
+ If you're attaching Evolve to an MCP client that requires a direct command (like Claude Desktop):
114
+ ```bash
115
+ uv run fastmcp run altk_evolve/frontend/mcp/mcp_server.py --transport stdio
116
+ ```
117
+ Or for SSE transport:
118
+ ```bash
119
+ uv run fastmcp run altk_evolve/frontend/mcp/mcp_server.py --transport sse --port 8201
120
+ ```
121
+
122
+ Verify it's running:
123
+ ```bash
124
+ npx @modelcontextprotocol/inspector@latest http://127.0.0.1:8201/sse --cli --method tools/list
125
+ ```
126
+
127
+ **Available tools:**
128
+ - `get_entities(task: str, entity_type: str)`: Get relevant entities for a specific task, filtered by type (e.g., 'guideline', 'policy').
129
+ - `get_guidelines(task: str)`: Get relevant guidelines for a specific task (backward compatibility alias).
130
+ - `save_trajectory(trajectory_data: str, task_id: str | None)`: Save a conversation trajectory and generate new guidelines.
131
+ - `create_entity(content: str, entity_type: str, metadata: str | None, enable_conflict_resolution: bool)`: Create a single entity in the namespace.
132
+ - `delete_entity(entity_id: str)`: Delete a specific entity by its ID.
133
+
134
+ ## Tip Provenance
135
+
136
+ Evolve automatically tracks the origin of every guideline it generates or stores. Every tip entity contains `metadata` identifying its source:
137
+ - `creation_mode`: Identifies how the tip was created (`auto-phoenix` via trace observability, `auto-mcp` via trajectory saving tools, or `manual`).
138
+ - `source_task_id`: The ID of the original trace or task that inspired the tip, providing full audibility.
139
+
140
+ See the [Low-Code Tracing Guide](https://github.com/AgentToolkit/altk-evolve/blob/v1.0.6/docs/guides/low-code-tracing.md#6-understanding-tip-provenance-metadata) for more details.
141
+
142
+
143
+ ## Community & Feedback
144
+
145
+ Evolve is an active project, and real‑world usage helps guide its direction.
146
+
147
+ If Evolve is useful or aligned with your work, consider giving the repo a ⭐ — it helps others discover it.
148
+ If you’re experimenting with Evolve or exploring on‑the‑job learning for agents, feel free to open an issue or discussion to share use cases, ideas, or feedback.
149
+
150
+
151
+ ## Documentation
152
+
153
+ - [Documentation Home](https://github.com/AgentToolkit/altk-evolve/blob/v1.0.6/docs/index.md) - Overview of guides, reference docs, and tutorials
154
+ - [Installation](https://github.com/AgentToolkit/altk-evolve/blob/v1.0.6/docs/installation/index.md) - Setup instructions for supported platforms
155
+ - [Configuration](https://github.com/AgentToolkit/altk-evolve/blob/v1.0.6/docs/guides/configuration.md) - Environment variables and backend options
156
+ - [CLI Reference](https://github.com/AgentToolkit/altk-evolve/blob/v1.0.6/docs/reference/cli.md) - Command-line interface documentation
157
+ - [Evolve Lite](https://github.com/AgentToolkit/altk-evolve/blob/v1.0.6/docs/integrations/evolve-lite.md) - Lightweight Claude Code plugin mode
158
+ - [Claude Code Demo](https://github.com/AgentToolkit/altk-evolve/blob/v1.0.6/docs/tutorials/claude-code-demo.md) - End-to-end demo walkthrough
159
+ - [Policies](https://github.com/AgentToolkit/altk-evolve/blob/v1.0.6/docs/reference/policies.md) - Policy support and schema
160
+
161
+ ## Development
162
+
163
+ ### Running Tests
164
+
165
+ The test suite is organized into 4 cleanly isolated tiers depending on infrastructure requirements:
166
+
167
+ 1. **Default Local Suite**
168
+ Runs both fast logic tests (`unit`) and filesystem script verifications (`platform_integrations`).
169
+ ```bash
170
+ uv run pytest
171
+ ```
172
+
173
+ 2. **Unit Tests (Only)**
174
+ Fast, fully-mocked tests verifying core logic and offline pipeline schemas.
175
+ ```bash
176
+ uv run pytest -m unit
177
+ ```
178
+
179
+ 3. **Platform Integration Tests**
180
+ Fast filesystem-level integration tests verifying local tool installation and idempotency.
181
+ ```bash
182
+ uv run pytest -m platform_integrations
183
+ ```
184
+
185
+ 4. **End-to-End Infrastructure Tests**
186
+ Heavy tests that autonomously spin up a background Phoenix server and simulate full agent workflows.
187
+ ```bash
188
+ uv run pytest -m e2e --run-e2e
189
+ ```
190
+ *(See [the Low-Code Tracing Guide](https://github.com/AgentToolkit/altk-evolve/blob/v1.0.6/docs/guides/low-code-tracing.md#end-to-end-verification) for more details).*
191
+
192
+ 5. **LLM Evaluation Tests**
193
+ Tests needing active LLM inference to test resolution pipelines (requires LLM API keys).
194
+ ```bash
195
+ uv run pytest -m llm
196
+ ```
@@ -0,0 +1,161 @@
1
+ <div align="center">
2
+
3
+ # Evolve: On‑the‑job learning for AI agents
4
+
5
+ ![Python](https://img.shields.io/badge/python-3.12%2B-blue)
6
+ ![Status](https://img.shields.io/badge/status-active-brightgreen)
7
+ ![arXiv](https://img.shields.io/badge/arXiv-2603.10600-b31b1b)
8
+ ![License](https://img.shields.io/github/license/AgentToolkit/altk-evolve)
9
+ ![Stars](https://img.shields.io/github/stars/AgentToolkit/altk-evolve?style=social)
10
+ </div>
11
+
12
+ Evolve is a system designed to help agents improve over time by learning from their trajectories. It uses a combination of an MCP server for tool integration, vector storage for memory, and LLM-based conflict resolution to refine its knowledge base.
13
+
14
+ ## Features
15
+
16
+ - **MCP Server**: Exposes tools to get guidelines and save trajectories.
17
+ - **Conflict Resolution**: Intelligently merges new insights with existing guidelines using LLMs.
18
+ - **Trajectory Analysis**: Automatically analyzes agent trajectories to generate guidelines and best practices.
19
+ - **Milvus Integration**: Uses Milvus (or Milvus Lite) for efficient vector storage and retrieval.
20
+
21
+ ## Architecture
22
+
23
+ <img src="https://raw.githubusercontent.com/AgentToolkit/altk-evolve/v1.0.6/docs/assets/architecture.png" alt="Architecture" width="480">
24
+
25
+ ## Quick Start
26
+
27
+ ### Installation
28
+
29
+ Prerequisites:
30
+ - Python 3.12 or higher
31
+ - `uv` (recommended) or `pip`
32
+
33
+ ```bash
34
+ git clone <repository_url>
35
+ cd altk-evolve
36
+ uv venv --python=3.12 && source .venv/bin/activate
37
+ uv sync
38
+ ```
39
+
40
+ ### Configuration
41
+
42
+ For direct OpenAI usage:
43
+ ```bash
44
+ export OPENAI_API_KEY=sk-...
45
+ ```
46
+
47
+ For LiteLLM proxy usage and model selection (including global fallback via `EVOLVE_MODEL_NAME`), see [the configuration guide](https://github.com/AgentToolkit/altk-evolve/blob/v1.0.6/docs/guides/configuration.md).
48
+
49
+ ### Running the MCP Server & UI
50
+
51
+ Evolve provides both a standard MCP server and a full Web UI (Dashboard & Entity Explorer).
52
+
53
+ > [!IMPORTANT]
54
+ > **Building from Source:** If you cloned this repository (rather than installing a pre-built package), you must build the UI before it can be served.
55
+ > ```bash
56
+ > cd altk_evolve/frontend/ui
57
+ > npm ci && npm run build
58
+ > cd ../../../
59
+ > ```
60
+ > See `altk_evolve/frontend/ui/README.md` for more frontend development details.
61
+
62
+ #### Starting Both Automatically
63
+ The easiest way to start both the MCP Server (on standard input/output) and the HTTP UI backend is to run the module directly:
64
+ ```bash
65
+ uv run python -m evolve.frontend.mcp
66
+ ```
67
+ This will start the UI server in the background on port `8000` and the MCP server in the foreground. You can then access the UI locally by opening your browser to:
68
+ `http://127.0.0.1:8000/ui/`
69
+
70
+ #### Starting the UI Standalone
71
+ If you only want to access the Web UI and API (without the MCP server stdio blocking the terminal), you can run the FastAPI application directly using `uvicorn`:
72
+ ```bash
73
+ uv run uvicorn evolve.frontend.mcp.mcp_server:app --host 127.0.0.1 --port 8000
74
+ ```
75
+ Then navigate to `http://127.0.0.1:8000/ui/`.
76
+
77
+ #### Starting only the MCP Server
78
+ If you're attaching Evolve to an MCP client that requires a direct command (like Claude Desktop):
79
+ ```bash
80
+ uv run fastmcp run altk_evolve/frontend/mcp/mcp_server.py --transport stdio
81
+ ```
82
+ Or for SSE transport:
83
+ ```bash
84
+ uv run fastmcp run altk_evolve/frontend/mcp/mcp_server.py --transport sse --port 8201
85
+ ```
86
+
87
+ Verify it's running:
88
+ ```bash
89
+ npx @modelcontextprotocol/inspector@latest http://127.0.0.1:8201/sse --cli --method tools/list
90
+ ```
91
+
92
+ **Available tools:**
93
+ - `get_entities(task: str, entity_type: str)`: Get relevant entities for a specific task, filtered by type (e.g., 'guideline', 'policy').
94
+ - `get_guidelines(task: str)`: Get relevant guidelines for a specific task (backward compatibility alias).
95
+ - `save_trajectory(trajectory_data: str, task_id: str | None)`: Save a conversation trajectory and generate new guidelines.
96
+ - `create_entity(content: str, entity_type: str, metadata: str | None, enable_conflict_resolution: bool)`: Create a single entity in the namespace.
97
+ - `delete_entity(entity_id: str)`: Delete a specific entity by its ID.
98
+
99
+ ## Tip Provenance
100
+
101
+ Evolve automatically tracks the origin of every guideline it generates or stores. Every tip entity contains `metadata` identifying its source:
102
+ - `creation_mode`: Identifies how the tip was created (`auto-phoenix` via trace observability, `auto-mcp` via trajectory saving tools, or `manual`).
103
+ - `source_task_id`: The ID of the original trace or task that inspired the tip, providing full audibility.
104
+
105
+ See the [Low-Code Tracing Guide](https://github.com/AgentToolkit/altk-evolve/blob/v1.0.6/docs/guides/low-code-tracing.md#6-understanding-tip-provenance-metadata) for more details.
106
+
107
+
108
+ ## Community & Feedback
109
+
110
+ Evolve is an active project, and real‑world usage helps guide its direction.
111
+
112
+ If Evolve is useful or aligned with your work, consider giving the repo a ⭐ — it helps others discover it.
113
+ If you’re experimenting with Evolve or exploring on‑the‑job learning for agents, feel free to open an issue or discussion to share use cases, ideas, or feedback.
114
+
115
+
116
+ ## Documentation
117
+
118
+ - [Documentation Home](https://github.com/AgentToolkit/altk-evolve/blob/v1.0.6/docs/index.md) - Overview of guides, reference docs, and tutorials
119
+ - [Installation](https://github.com/AgentToolkit/altk-evolve/blob/v1.0.6/docs/installation/index.md) - Setup instructions for supported platforms
120
+ - [Configuration](https://github.com/AgentToolkit/altk-evolve/blob/v1.0.6/docs/guides/configuration.md) - Environment variables and backend options
121
+ - [CLI Reference](https://github.com/AgentToolkit/altk-evolve/blob/v1.0.6/docs/reference/cli.md) - Command-line interface documentation
122
+ - [Evolve Lite](https://github.com/AgentToolkit/altk-evolve/blob/v1.0.6/docs/integrations/evolve-lite.md) - Lightweight Claude Code plugin mode
123
+ - [Claude Code Demo](https://github.com/AgentToolkit/altk-evolve/blob/v1.0.6/docs/tutorials/claude-code-demo.md) - End-to-end demo walkthrough
124
+ - [Policies](https://github.com/AgentToolkit/altk-evolve/blob/v1.0.6/docs/reference/policies.md) - Policy support and schema
125
+
126
+ ## Development
127
+
128
+ ### Running Tests
129
+
130
+ The test suite is organized into 4 cleanly isolated tiers depending on infrastructure requirements:
131
+
132
+ 1. **Default Local Suite**
133
+ Runs both fast logic tests (`unit`) and filesystem script verifications (`platform_integrations`).
134
+ ```bash
135
+ uv run pytest
136
+ ```
137
+
138
+ 2. **Unit Tests (Only)**
139
+ Fast, fully-mocked tests verifying core logic and offline pipeline schemas.
140
+ ```bash
141
+ uv run pytest -m unit
142
+ ```
143
+
144
+ 3. **Platform Integration Tests**
145
+ Fast filesystem-level integration tests verifying local tool installation and idempotency.
146
+ ```bash
147
+ uv run pytest -m platform_integrations
148
+ ```
149
+
150
+ 4. **End-to-End Infrastructure Tests**
151
+ Heavy tests that autonomously spin up a background Phoenix server and simulate full agent workflows.
152
+ ```bash
153
+ uv run pytest -m e2e --run-e2e
154
+ ```
155
+ *(See [the Low-Code Tracing Guide](https://github.com/AgentToolkit/altk-evolve/blob/v1.0.6/docs/guides/low-code-tracing.md#end-to-end-verification) for more details).*
156
+
157
+ 5. **LLM Evaluation Tests**
158
+ Tests needing active LLM inference to test resolution pipelines (requires LLM API keys).
159
+ ```bash
160
+ uv run pytest -m llm
161
+ ```
@@ -0,0 +1 @@
1
+ __version__ = "1.0.6"