altk-evolve-core 1.7.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 (143) hide show
  1. altk_evolve_core-1.7.0/LICENSE +201 -0
  2. altk_evolve_core-1.7.0/MANIFEST.in +3 -0
  3. altk_evolve_core-1.7.0/PKG-INFO +419 -0
  4. altk_evolve_core-1.7.0/README.md +343 -0
  5. altk_evolve_core-1.7.0/altk_evolve/__init__.py +1 -0
  6. altk_evolve_core-1.7.0/altk_evolve/auto/__init__.py +243 -0
  7. altk_evolve_core-1.7.0/altk_evolve/backend/__init__.py +0 -0
  8. altk_evolve_core-1.7.0/altk_evolve/backend/base.py +587 -0
  9. altk_evolve_core-1.7.0/altk_evolve/backend/filesystem.py +454 -0
  10. altk_evolve_core-1.7.0/altk_evolve/backend/milvus.py +503 -0
  11. altk_evolve_core-1.7.0/altk_evolve/backend/postgres.py +511 -0
  12. altk_evolve_core-1.7.0/altk_evolve/backend/reconciliation.py +141 -0
  13. altk_evolve_core-1.7.0/altk_evolve/backend/writes.py +55 -0
  14. altk_evolve_core-1.7.0/altk_evolve/cli/__init__.py +1 -0
  15. altk_evolve_core-1.7.0/altk_evolve/cli/cli.py +725 -0
  16. altk_evolve_core-1.7.0/altk_evolve/cli/processing.py +66 -0
  17. altk_evolve_core-1.7.0/altk_evolve/cli/retention.py +371 -0
  18. altk_evolve_core-1.7.0/altk_evolve/cli/templates/__init__.py +1 -0
  19. altk_evolve_core-1.7.0/altk_evolve/cli/templates/hooks.yaml +121 -0
  20. altk_evolve_core-1.7.0/altk_evolve/config/__init__.py +0 -0
  21. altk_evolve_core-1.7.0/altk_evolve/config/evolve.py +75 -0
  22. altk_evolve_core-1.7.0/altk_evolve/config/filesystem.py +10 -0
  23. altk_evolve_core-1.7.0/altk_evolve/config/guideline_runtime.py +47 -0
  24. altk_evolve_core-1.7.0/altk_evolve/config/guidelines.py +87 -0
  25. altk_evolve_core-1.7.0/altk_evolve/config/hooks.py +131 -0
  26. altk_evolve_core-1.7.0/altk_evolve/config/llm.py +47 -0
  27. altk_evolve_core-1.7.0/altk_evolve/config/milvus.py +24 -0
  28. altk_evolve_core-1.7.0/altk_evolve/config/phoenix.py +11 -0
  29. altk_evolve_core-1.7.0/altk_evolve/config/postgres.py +18 -0
  30. altk_evolve_core-1.7.0/altk_evolve/db/__init__.py +0 -0
  31. altk_evolve_core-1.7.0/altk_evolve/db/sqlite_manager.py +151 -0
  32. altk_evolve_core-1.7.0/altk_evolve/embedding_assets.py +51 -0
  33. altk_evolve_core-1.7.0/altk_evolve/embeddings.py +129 -0
  34. altk_evolve_core-1.7.0/altk_evolve/export_embeddings.py +163 -0
  35. altk_evolve_core-1.7.0/altk_evolve/frontend/__init__.py +0 -0
  36. altk_evolve_core-1.7.0/altk_evolve/frontend/api/__init__.py +0 -0
  37. altk_evolve_core-1.7.0/altk_evolve/frontend/api/memory.py +446 -0
  38. altk_evolve_core-1.7.0/altk_evolve/frontend/api/processing.py +89 -0
  39. altk_evolve_core-1.7.0/altk_evolve/frontend/api/routes.py +250 -0
  40. altk_evolve_core-1.7.0/altk_evolve/frontend/client/__init__.py +0 -0
  41. altk_evolve_core-1.7.0/altk_evolve/frontend/client/evolve_client.py +550 -0
  42. altk_evolve_core-1.7.0/altk_evolve/frontend/mcp/__init__.py +0 -0
  43. altk_evolve_core-1.7.0/altk_evolve/frontend/mcp/__main__.py +101 -0
  44. altk_evolve_core-1.7.0/altk_evolve/frontend/mcp/http_transport.py +181 -0
  45. altk_evolve_core-1.7.0/altk_evolve/frontend/mcp/mcp_server.py +1742 -0
  46. altk_evolve_core-1.7.0/altk_evolve/frontend/services/__init__.py +1 -0
  47. altk_evolve_core-1.7.0/altk_evolve/frontend/services/context.py +28 -0
  48. altk_evolve_core-1.7.0/altk_evolve/frontend/ui/dist/assets/index-BmK3Cy_1.css +1 -0
  49. altk_evolve_core-1.7.0/altk_evolve/frontend/ui/dist/assets/index-DtUa2Guw.js +43 -0
  50. altk_evolve_core-1.7.0/altk_evolve/frontend/ui/dist/index.html +14 -0
  51. altk_evolve_core-1.7.0/altk_evolve/frontend/ui/node_modules/flatted/python/flatted.py +149 -0
  52. altk_evolve_core-1.7.0/altk_evolve/hooks/__init__.py +71 -0
  53. altk_evolve_core-1.7.0/altk_evolve/hooks/backend.py +109 -0
  54. altk_evolve_core-1.7.0/altk_evolve/hooks/manager.py +746 -0
  55. altk_evolve_core-1.7.0/altk_evolve/hooks/plugin.py +132 -0
  56. altk_evolve_core-1.7.0/altk_evolve/hooks/plugins/__init__.py +63 -0
  57. altk_evolve_core-1.7.0/altk_evolve/hooks/plugins/access_stamp.py +77 -0
  58. altk_evolve_core-1.7.0/altk_evolve/hooks/plugins/identity.py +58 -0
  59. altk_evolve_core-1.7.0/altk_evolve/hooks/plugins/legal_hold.py +19 -0
  60. altk_evolve_core-1.7.0/altk_evolve/hooks/plugins/normalizer.py +78 -0
  61. altk_evolve_core-1.7.0/altk_evolve/hooks/plugins/pii.py +135 -0
  62. altk_evolve_core-1.7.0/altk_evolve/hooks/plugins/readi.py +445 -0
  63. altk_evolve_core-1.7.0/altk_evolve/hooks/plugins/secrets.py +187 -0
  64. altk_evolve_core-1.7.0/altk_evolve/hooks/types.py +251 -0
  65. altk_evolve_core-1.7.0/altk_evolve/llm/__init__.py +3 -0
  66. altk_evolve_core-1.7.0/altk_evolve/llm/conflict_resolution/__init__.py +0 -0
  67. altk_evolve_core-1.7.0/altk_evolve/llm/conflict_resolution/conflict_resolution.py +220 -0
  68. altk_evolve_core-1.7.0/altk_evolve/llm/conflict_resolution/prompts/conflict_resolution.jinja2 +40 -0
  69. altk_evolve_core-1.7.0/altk_evolve/llm/conflict_resolution/prompts/default_conflict_resolution.jinja2 +275 -0
  70. altk_evolve_core-1.7.0/altk_evolve/llm/fact_extraction/__init__.py +6 -0
  71. altk_evolve_core-1.7.0/altk_evolve/llm/fact_extraction/categorization.py +59 -0
  72. altk_evolve_core-1.7.0/altk_evolve/llm/fact_extraction/fact_extraction.py +110 -0
  73. altk_evolve_core-1.7.0/altk_evolve/llm/fact_extraction/prompts/fact_extraction.jinja2 +47 -0
  74. altk_evolve_core-1.7.0/altk_evolve/llm/fact_extraction/prompts/fact_extraction_predefined.jinja2 +81 -0
  75. altk_evolve_core-1.7.0/altk_evolve/llm/guidelines/__init__.py +0 -0
  76. altk_evolve_core-1.7.0/altk_evolve/llm/guidelines/clustering.py +352 -0
  77. altk_evolve_core-1.7.0/altk_evolve/llm/guidelines/consistency_analyzer/__init__.py +23 -0
  78. altk_evolve_core-1.7.0/altk_evolve/llm/guidelines/consistency_analyzer/agent_config.yaml +28 -0
  79. altk_evolve_core-1.7.0/altk_evolve/llm/guidelines/consistency_analyzer/consistency_aggregator.py +166 -0
  80. altk_evolve_core-1.7.0/altk_evolve/llm/guidelines/consistency_analyzer/consistency_analysis.py +88 -0
  81. altk_evolve_core-1.7.0/altk_evolve/llm/guidelines/consistency_analyzer/consistency_metric.py +596 -0
  82. altk_evolve_core-1.7.0/altk_evolve/llm/guidelines/consistency_analyzer/inference_utils.py +395 -0
  83. altk_evolve_core-1.7.0/altk_evolve/llm/guidelines/consistency_analyzer/resampling.py +168 -0
  84. altk_evolve_core-1.7.0/altk_evolve/llm/guidelines/consistency_analyzer/sample_preprocessing.py +674 -0
  85. altk_evolve_core-1.7.0/altk_evolve/llm/guidelines/consistency_analyzer/single_step_consistency.py +243 -0
  86. altk_evolve_core-1.7.0/altk_evolve/llm/guidelines/consistency_analyzer/utils.py +309 -0
  87. altk_evolve_core-1.7.0/altk_evolve/llm/guidelines/consistency_guidelines.py +995 -0
  88. altk_evolve_core-1.7.0/altk_evolve/llm/guidelines/context.py +21 -0
  89. altk_evolve_core-1.7.0/altk_evolve/llm/guidelines/guidelines.py +571 -0
  90. altk_evolve_core-1.7.0/altk_evolve/llm/guidelines/prompts/combine_guidelines.jinja2 +54 -0
  91. altk_evolve_core-1.7.0/altk_evolve/llm/guidelines/prompts/generate_consistency_guidelines.jinja2 +56 -0
  92. altk_evolve_core-1.7.0/altk_evolve/llm/guidelines/prompts/generate_consistency_guidelines_fast.jinja2 +57 -0
  93. altk_evolve_core-1.7.0/altk_evolve/llm/guidelines/prompts/generate_guidelines.jinja2 +88 -0
  94. altk_evolve_core-1.7.0/altk_evolve/llm/guidelines/prompts/segment_trajectory.jinja2 +45 -0
  95. altk_evolve_core-1.7.0/altk_evolve/llm/guidelines/retrieval.py +152 -0
  96. altk_evolve_core-1.7.0/altk_evolve/llm/guidelines/segmentation.py +103 -0
  97. altk_evolve_core-1.7.0/altk_evolve/processing/__init__.py +47 -0
  98. altk_evolve_core-1.7.0/altk_evolve/processing/builtin.py +143 -0
  99. altk_evolve_core-1.7.0/altk_evolve/processing/manager.py +378 -0
  100. altk_evolve_core-1.7.0/altk_evolve/processing/models.py +197 -0
  101. altk_evolve_core-1.7.0/altk_evolve/processing/registry.py +92 -0
  102. altk_evolve_core-1.7.0/altk_evolve/processing/repository.py +135 -0
  103. altk_evolve_core-1.7.0/altk_evolve/retention/__init__.py +28 -0
  104. altk_evolve_core-1.7.0/altk_evolve/retention/collection.py +482 -0
  105. altk_evolve_core-1.7.0/altk_evolve/retention/engine.py +421 -0
  106. altk_evolve_core-1.7.0/altk_evolve/retention/execution.py +163 -0
  107. altk_evolve_core-1.7.0/altk_evolve/retention/policy.py +112 -0
  108. altk_evolve_core-1.7.0/altk_evolve/retention/reports.py +77 -0
  109. altk_evolve_core-1.7.0/altk_evolve/retention/schedule.py +119 -0
  110. altk_evolve_core-1.7.0/altk_evolve/retention/schedule_store.py +443 -0
  111. altk_evolve_core-1.7.0/altk_evolve/retention/scheduler.py +150 -0
  112. altk_evolve_core-1.7.0/altk_evolve/retention/service.py +473 -0
  113. altk_evolve_core-1.7.0/altk_evolve/retention/store.py +384 -0
  114. altk_evolve_core-1.7.0/altk_evolve/schema/__init__.py +0 -0
  115. altk_evolve_core-1.7.0/altk_evolve/schema/conflict_resolution.py +31 -0
  116. altk_evolve_core-1.7.0/altk_evolve/schema/core.py +37 -0
  117. altk_evolve_core-1.7.0/altk_evolve/schema/exceptions.py +21 -0
  118. altk_evolve_core-1.7.0/altk_evolve/schema/guidelines.py +180 -0
  119. altk_evolve_core-1.7.0/altk_evolve/schema/policy.py +38 -0
  120. altk_evolve_core-1.7.0/altk_evolve/schema/provenance.py +145 -0
  121. altk_evolve_core-1.7.0/altk_evolve/sync/__init__.py +3 -0
  122. altk_evolve_core-1.7.0/altk_evolve/sync/phoenix_sync.py +1120 -0
  123. altk_evolve_core-1.7.0/altk_evolve/telemetry.py +234 -0
  124. altk_evolve_core-1.7.0/altk_evolve/utils/__init__.py +0 -0
  125. altk_evolve_core-1.7.0/altk_evolve/utils/cancellation.py +16 -0
  126. altk_evolve_core-1.7.0/altk_evolve/utils/utils.py +96 -0
  127. altk_evolve_core-1.7.0/altk_evolve/viz/__init__.py +1 -0
  128. altk_evolve_core-1.7.0/altk_evolve/viz/data.py +147 -0
  129. altk_evolve_core-1.7.0/altk_evolve/viz/server.py +591 -0
  130. altk_evolve_core-1.7.0/altk_evolve_core.egg-info/PKG-INFO +419 -0
  131. altk_evolve_core-1.7.0/altk_evolve_core.egg-info/SOURCES.txt +141 -0
  132. altk_evolve_core-1.7.0/altk_evolve_core.egg-info/dependency_links.txt +1 -0
  133. altk_evolve_core-1.7.0/altk_evolve_core.egg-info/entry_points.txt +3 -0
  134. altk_evolve_core-1.7.0/altk_evolve_core.egg-info/requires.txt +89 -0
  135. altk_evolve_core-1.7.0/altk_evolve_core.egg-info/top_level.txt +1 -0
  136. altk_evolve_core-1.7.0/pyproject.toml +338 -0
  137. altk_evolve_core-1.7.0/setup.cfg +4 -0
  138. altk_evolve_core-1.7.0/tests/test_coderank_export.py +34 -0
  139. altk_evolve_core-1.7.0/tests/test_distribution_metadata.py +51 -0
  140. altk_evolve_core-1.7.0/tests/test_embedding_runtime_parity.py +20 -0
  141. altk_evolve_core-1.7.0/tests/test_fastembed_offline.py +30 -0
  142. altk_evolve_core-1.7.0/tests/test_processing_storage_contract.py +445 -0
  143. altk_evolve_core-1.7.0/tests/test_release_artifacts.py +75 -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,3 @@
1
+ recursive-include altk_evolve *.jinja2
2
+ recursive-include altk_evolve *.yaml
3
+ recursive-include altk_evolve/frontend/ui/dist *
@@ -0,0 +1,419 @@
1
+ Metadata-Version: 2.4
2
+ Name: altk-evolve-core
3
+ Version: 1.7.0
4
+ Summary: Composable agent memory and self-improvement
5
+ Requires-Python: >=3.12
6
+ Description-Content-Type: text/markdown
7
+ License-File: LICENSE
8
+ Requires-Dist: anyio<5,>=4.1
9
+ Requires-Dist: opentelemetry-api<2,>=1.30
10
+ Requires-Dist: croniter<7,>=6.2.4
11
+ Requires-Dist: jinja2
12
+ Requires-Dist: litellm>=1.84.0
13
+ Requires-Dist: numpy
14
+ Requires-Dist: pydantic
15
+ Requires-Dist: pydantic-settings
16
+ Requires-Dist: pyyaml
17
+ Requires-Dist: tzdata>=2025.3
18
+ Provides-Extra: telemetry
19
+ Requires-Dist: opentelemetry-sdk<2,>=1.41.1; extra == "telemetry"
20
+ Requires-Dist: opentelemetry-exporter-otlp-proto-http<2,>=1.41.1; extra == "telemetry"
21
+ Provides-Extra: server
22
+ Requires-Dist: fastapi>=0.135.2; extra == "server"
23
+ Requires-Dist: fastmcp<4,>=3.1; extra == "server"
24
+ Requires-Dist: uvicorn; extra == "server"
25
+ Requires-Dist: altk-evolve-core[telemetry]; extra == "server"
26
+ Provides-Extra: cli
27
+ Requires-Dist: typer>=0.9.0; extra == "cli"
28
+ Provides-Extra: fastembed
29
+ Requires-Dist: fastembed<1,>=0.7; extra == "fastembed"
30
+ Provides-Extra: sentence-transformers
31
+ Requires-Dist: sentence-transformers; extra == "sentence-transformers"
32
+ Provides-Extra: fastembed-export
33
+ Requires-Dist: altk-evolve-core[fastembed,sentence-transformers]; extra == "fastembed-export"
34
+ Requires-Dist: onnx<2,>=1.17; extra == "fastembed-export"
35
+ Provides-Extra: phoenix
36
+ Requires-Dist: arize-phoenix>=12.30.0; extra == "phoenix"
37
+ Provides-Extra: build
38
+ Requires-Dist: uv; extra == "build"
39
+ Provides-Extra: tracing
40
+ Requires-Dist: altk-evolve-core[telemetry]; extra == "tracing"
41
+ Requires-Dist: arize-phoenix-otel<1,>=0.15; extra == "tracing"
42
+ Requires-Dist: openinference-instrumentation-openai; extra == "tracing"
43
+ Requires-Dist: openinference-instrumentation-litellm; extra == "tracing"
44
+ Requires-Dist: openinference-instrumentation-smolagents; extra == "tracing"
45
+ Requires-Dist: openinference-instrumentation-openai-agents; extra == "tracing"
46
+ Provides-Extra: milvus
47
+ Requires-Dist: pymilvus[milvus-lite]>=2.6.2; platform_machine != "aarch64" and extra == "milvus"
48
+ Requires-Dist: pymilvus>=2.6.2; platform_machine == "aarch64" and extra == "milvus"
49
+ Requires-Dist: milvus-lite>=2.5.1; platform_machine != "aarch64" and extra == "milvus"
50
+ Provides-Extra: pgvector
51
+ Requires-Dist: psycopg[binary]>=3.1; extra == "pgvector"
52
+ Requires-Dist: pgvector>=0.3; extra == "pgvector"
53
+ Provides-Extra: hooks
54
+ Requires-Dist: cpex<0.2,>=0.1.0; extra == "hooks"
55
+ Provides-Extra: pii-regex
56
+ Requires-Dist: altk-evolve-core[hooks]; extra == "pii-regex"
57
+ Requires-Dist: cpex-pii-filter<0.4,>=0.3; extra == "pii-regex"
58
+ Provides-Extra: pii
59
+ Requires-Dist: altk-evolve-core[pii-regex]; extra == "pii"
60
+ Provides-Extra: pii-semantic
61
+ Requires-Dist: altk-evolve-core[hooks]; extra == "pii-semantic"
62
+ Requires-Dist: readi-privacy<0.2,>=0.1.6; extra == "pii-semantic"
63
+ Requires-Dist: spacy-curated-transformers<3,>=0.2; extra == "pii-semantic"
64
+ Requires-Dist: curated-tokenizers>=0.0.10; extra == "pii-semantic"
65
+ Provides-Extra: secrets
66
+ Requires-Dist: altk-evolve-core[hooks]; extra == "secrets"
67
+ Requires-Dist: cpex-secrets-detection<0.2,>=0.1; extra == "secrets"
68
+ Provides-Extra: bench
69
+ Requires-Dist: datasets>=2.14; extra == "bench"
70
+ Provides-Extra: examples
71
+ Requires-Dist: altk-evolve-core[phoenix,tracing]; extra == "examples"
72
+ Requires-Dist: smolagents; extra == "examples"
73
+ Requires-Dist: openai-agents; extra == "examples"
74
+ Requires-Dist: openai; extra == "examples"
75
+ Dynamic: license-file
76
+
77
+ <div align="center">
78
+
79
+ # Evolve: On‑the‑job learning for AI agents
80
+
81
+ [![Python](https://img.shields.io/badge/python-3.12%2B-blue)](https://www.python.org/)
82
+ ![Status](https://img.shields.io/badge/status-active-brightgreen)
83
+ [![Documentation](https://shields.io/badge/Official%20Webpage-Documentation-blue)](https://agenttoolkit.github.io/altk-evolve)
84
+ [![arXiv](https://img.shields.io/badge/arXiv-2603.10600-b31b1b)](https://arxiv.org/pdf/2603.10600)
85
+ [![arXiv](https://img.shields.io/badge/arXiv-2609.32091-b31b1b)](https://arxiv.org/abs/2609.32091)
86
+ [![License](https://img.shields.io/github/license/AgentToolkit/altk-evolve)](https://www.apache.org/licenses/LICENSE-2.0)
87
+ ![Stars](https://img.shields.io/github/stars/AgentToolkit/altk-evolve?style=social)
88
+
89
+ </div>
90
+
91
+ Coding agents repeat the same mistakes because they start fresh every session. Evolve gives agents memory — they learn from what worked and what didn't, so each session is better than the last.
92
+
93
+ Evolve is a system designed to help agents improve over time by learning from their trajectories. The Lite version is designed to effortlessly slot into existing agent assistants like Claude Code and Codex. 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.
94
+
95
+ On the AppWorld benchmark, Evolve improved agent reliability by +8.9 points overall, with a 74% relative increase on hard multi-step tasks. 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.
96
+
97
+ > [!IMPORTANT]
98
+ > ⭐ **Star the repo**: it helps others discover it.
99
+
100
+ ## Latest from Evolve
101
+
102
+ Research, releases, and practical findings from the Evolve team.
103
+
104
+ <!-- BEGIN LATEST-UPDATES (generated; edit includes/latest-updates.md then run scripts/sync_latest_updates.py) -->
105
+ - **2026-09-25** · Paper — **[Memory as Middleware for Self-Improving AI Agents](https://arxiv.org/abs/2609.32091)**
106
+ The case for agent memory as a pluggable middleware layer, with Evolve as the reference implementation (to appear at [Middleware 2026](https://middleware-conf.github.io/2026)).
107
+ - **2026-09-15** · Article — **[Your Agent Aced the Task. Will It Do It Again?](https://huggingface.co/blog/ibm-research/altk-evolve-consistency)**
108
+ Diagnosing where an agent's decisions wobble and stabilizing them so success repeats.
109
+ - **2026-09-08** · Paper — **[Closing the Consistency Gap: Self-Evolving Agents That Learn to Stay on Course](https://arxiv.org/abs/2609.08832)**
110
+ Turning unstable trajectory steps into episodic memory to keep agents consistent across repeated runs.
111
+ - **2026-08-18** · Article — **[How Much Memory Does Your Agent Actually Need?](https://huggingface.co/blog/ibm-research/altk-evolve-hmm)**
112
+ Why agent memory should be calibrated to the model instead of simply increased.
113
+ - **2026-08-11** · Article — **[Thinking of ACE? We Can Do It with Fewer Tokens](https://huggingface.co/blog/ibm-research/altk-evolve-sldd)**
114
+ Comparing Evolve's targeted guideline retrieval with ACE's playbook approach and token usage.
115
+ - **2026-04-08** · Article — **[ALTK‑Evolve: On‑the‑Job Learning for AI Agents](https://huggingface.co/blog/ibm-research/altk-evolve)**
116
+ An introduction to learning reusable guidance from agent trajectories.
117
+ - **2026-04-07** · Announcement — **[IBM introduces ALTK Evolve](https://www.ibm.com/new/announcements/altk-evolve-on-the-job-learning-for-ai-agents)**
118
+ Evolve is opened to builders creating agents that learn from experience.
119
+ - **2026-03-11** · Paper — **[Trajectory-Informed Memory Generation for Self-Improving Agent Systems](https://arxiv.org/abs/2603.10600)**
120
+ The research framework and evaluation underlying Evolve.
121
+ <!-- END LATEST-UPDATES -->
122
+
123
+
124
+ ## Quick Start (Lite)
125
+ [IBM Bob →](https://agenttoolkit.github.io/altk-evolve/examples/hello_world/bob/)
126
+
127
+ [Claude Code →](https://agenttoolkit.github.io/altk-evolve/examples/hello_world/claude)
128
+
129
+ [Codex →](https://agenttoolkit.github.io/altk-evolve/examples/hello_world/codex/)
130
+
131
+ [Hermes →](https://agenttoolkit.github.io/altk-evolve/integrations/hermes/)
132
+
133
+ ## Quick Start (Evolve MCP Server)
134
+ ### Installation
135
+ Prerequisites:
136
+ - Python 3.12 or higher
137
+ - `uv` (recommended) or `pip`
138
+
139
+ From Source
140
+ ```bash
141
+ # Clone the repository and install dependencies
142
+ git clone https://github.com/agenttoolkit/altk-evolve.git
143
+ cd altk-evolve
144
+ uv venv --python=3.12 && source .venv/bin/activate
145
+ uv sync --package altk-evolve
146
+ # Build the UI
147
+ cd frontend/ui
148
+ npm ci && npm run build
149
+ cd ../..
150
+ ```
151
+ From PyPI
152
+ ```bash
153
+ pip install altk-evolve
154
+ ```
155
+
156
+ **Choose your installation:**
157
+
158
+ - `altk-evolve` bundles `altk-evolve-core[server,cli,fastembed,tracing]` at the same version.
159
+ - `altk-evolve-core` contains the Python implementation without server/CLI dependencies,
160
+ an embedding runtime, or a Phoenix server. Libraries should depend on core and select the extras they need.
161
+ - Add `[server]` for the HTTP/MCP server and its telemetry exporters, or `[cli]`
162
+ for the command-line interface. `[telemetry]` provides the SDK and OTLP exporter
163
+ independently; both `[server]` and `[tracing]` include it. Core retains the OpenTelemetry API so host applications
164
+ can supply their own telemetry providers.
165
+ - All extras belong to core. Existing `altk-evolve[pgvector]`, `[pii-semantic]`, and
166
+ other extras forward to core while retaining the convenience defaults.
167
+ - Install `altk-evolve-core[phoenix]` (or `altk-evolve[phoenix]`) only to run the
168
+ local Phoenix server. Remote tracing uses the separate `arize-phoenix-otel` package.
169
+
170
+ Both packages use the same `altk_evolve` imports and `evolve` / `evolve-mcp` commands;
171
+ only core owns those files. Core-only filesystem storage works without an embedding
172
+ runtime. Features that embed text require `[fastembed]` or `[sentence-transformers]`.
173
+
174
+ **Embedding migration:** FastEmbed is now the default provider. To retain the
175
+ previous runtime, install `altk-evolve-core[sentence-transformers]` and set
176
+ `EVOLVE_EMBEDDING_PROVIDER=sentence_transformers`. Validate retrieval quality before
177
+ switching an existing vector store to another runtime; changing models requires
178
+ re-embedding stored vectors. The specialized `sbert_large` CodeRank metric requires
179
+ an exported CodeRank ONNX artifact with FastEmbed, or the Sentence Transformers
180
+ provider. `[fastembed-export]` includes both runtimes for that export.
181
+
182
+ **Source development and releases:** The root project is core. Use
183
+ `uv sync --package altk-evolve` for the convenience bundle, or select root extras
184
+ explicitly. After changing the version or extras, run
185
+ `uv run --no-project python scripts/sync_convenience.py` and `uv lock`.
186
+ `uv build --all-packages` builds both distributions. Releases publish core first,
187
+ then the exactly matching convenience package through the same trusted publisher.
188
+
189
+ **Optional Backend Dependencies:**
190
+
191
+ The default filesystem backend uses simple text matching and requires no additional dependencies. For semantic vector similarity search, install one of these backends:
192
+
193
+ For PostgreSQL with pgvector support (recommended for production):
194
+ ```bash
195
+ uv sync --extra pgvector
196
+ ```
197
+
198
+ For Milvus support (optimized for large-scale vector search):
199
+ ```bash
200
+ uv sync --extra milvus
201
+ ```
202
+
203
+ See the [Backend Configuration Guide](https://github.com/AgentToolkit/altk-evolve/blob/v1.7.0/docs/guides/backend-configuration.md) for detailed comparison and setup instructions.
204
+
205
+ ### Configuration
206
+
207
+ For direct OpenAI usage:
208
+ ```bash
209
+ export OPENAI_API_KEY=sk-...
210
+ ```
211
+
212
+ 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.7.0/docs/guides/configuration.md).
213
+
214
+ ### Running Services
215
+ Start the Web UI and MCP server
216
+ ```bash
217
+ uv run evolve-mcp
218
+ ```
219
+ The Web UI can be accessed from: `http://127.0.0.1:8000/ui/`
220
+
221
+ ### Starting the Web UI and MCP Server
222
+ 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`:
223
+ ```bash
224
+ uv run uvicorn altk_evolve.frontend.mcp.mcp_server:app --host 127.0.0.1 --port 8000
225
+ ```
226
+ Then navigate to `http://127.0.0.1:8000/ui/`.
227
+
228
+ ### Starting only the MCP Server
229
+ If you're attaching Evolve to an MCP client that requires a direct command (like Claude Desktop):
230
+ ```bash
231
+ uv run evolve-mcp
232
+ ```
233
+ Or for SSE transport:
234
+ ```bash
235
+ uv run evolve-mcp --transport sse --port 8201
236
+ ```
237
+
238
+ Verify it's running:
239
+ ```bash
240
+ npx @modelcontextprotocol/inspector@latest http://127.0.0.1:8201/sse --cli --method tools/list
241
+ ```
242
+
243
+ **Available tools:**
244
+ - `get_entities(task: str, entity_type: str = "guideline", include_public: bool = False)`: Get relevant entities for a specific task. Set `include_public=True` to merge in public entities from all other namespaces; those results are annotated with `[public: {owner_id}]`.
245
+ - `get_guidelines(task: str)`: Get relevant guidelines for a specific task (backward compatibility alias for `get_entities`).
246
+ - `get_guidelines_with_attribution(task: str)`: Return formatted guidelines with the entity IDs used to build the prompt.
247
+ - `get_relevant_guidelines(task: str, top_k: int | None, core_support: int | None)`: Retrieve the always-on guideline core plus a task-relevant dosage.
248
+ - `list_entities(...)`: Return structured, filtered, cursor-paginated entity inventory for user and administrative UIs.
249
+ - `get_entity(entity_id: str, user_id: str | None, record_access: bool = True)`: Return one structured entity, enforcing ownership when a caller ID is supplied.
250
+ - `patch_entity_metadata(entity_id: str, metadata_patch: str, user_id: str | None)`: Merge JSON metadata through the memory hook seam.
251
+ - `record_access(entity_ids: list[str], accessed_at: str | None)`: Explicitly stamp the retention engine's `last_accessed` signal.
252
+ - `validate_retention_policy(policy: str)`: Validate and normalize a JSON retention policy without scanning data.
253
+ - `put_retention_policy(policy_id: str, name: str, policy: str, ...)`: Create or replace an Evolve-owned retention policy.
254
+ - `get_retention_policy(policy_id: str)` / `list_retention_policies()`: Read the namespace's policy catalog for operators and management UIs.
255
+ - `run_retention(policy_id: str, dry_run: bool = True, ...)`: Dry-run or apply a stored policy and persist a structured, entity-linked report.
256
+ - `list_retention_runs(...)`: Read namespace-scoped retention run history, optionally filtered by agent or policy.
257
+ - `get_compliance_status()`: Report backend health, retention availability, hook coverage, and configured plugin health.
258
+ - `save_trajectory(trajectory_data: str, task_id: str | None, owner_id: str | None)`: Save a conversation trajectory and generate new guidelines.
259
+ - `create_entity(content: str, entity_type: str, metadata: str | None, enable_conflict_resolution: bool, owner_id: str | None, visibility: str = "private")`: Create a single entity. Pass `visibility="public"` and `owner_id` to make it immediately discoverable by other namespaces.
260
+ - `publish_entity(entity_id: str, user_id: str | None)`: Make an entity publicly visible to all namespaces. Records the caller as owner and stamps `published_at`.
261
+ - `unpublish_entity(entity_id: str, user_id: str | None = None)`: Revert an entity to private visibility. Ownership is enforced server-side: if the entity has an `owner_id`, `user_id` must match it.
262
+ - `delete_entity(entity_id: str)`: Delete a specific entity by its ID.
263
+
264
+ ### Filter Migration Note
265
+ Entity search filters reserve bare keys for top-level schema columns only: `id`, `type`, `content`, and `created_at`.
266
+
267
+ If you need to filter on JSON metadata, use the `metadata.<key>` form. For example, use `filters={"type": "trajectory", "metadata.task_id": "123"}` instead of `filters={"type": "trajectory", "task_id": "123"}`.
268
+
269
+ Existing integrations that stored custom fields in entity metadata should update filter writers to add the `metadata.` prefix for those keys.
270
+
271
+ ## Features
272
+ - **Proactive**: Learns how to recognize problems and their solutions, and generates guidelines that get automatically applied to new tasks.
273
+ - **Conflict Resolution**: Update existing guidelines when new information contradicts them.
274
+ - **On Command**: An array of tools to manage guidelines whether in the agent or through a CLI
275
+ - **Sharing**: Publish individual entities so other agents can discover and retrieve them across namespaces.
276
+
277
+ ## Architecture
278
+ Evolve is built on a modular architecture which forms a feedback loop, taking conversation traces (trajectories) from an agent, extracting key insights into a database, feeding it back into the agent.
279
+
280
+ _Lite Mode omits the Interaction layer. All activity is performed in-agent_
281
+ <picture>
282
+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/architecture-wide-dark.svg">
283
+ <img src="https://raw.githubusercontent.com/AgentToolkit/altk-evolve/v1.7.0/docs/assets/architecture-wide-light.svg" alt="Architecture" width="480">
284
+ </picture>
285
+
286
+ ## Entity Sharing
287
+
288
+ Evolve supports sharing entities across namespaces using a simple public/private visibility model.
289
+
290
+ **Visibility** is stored in each entity's metadata and is private by default. Existing entities without a `visibility` field are unaffected.
291
+
292
+ | Metadata field | Description |
293
+ |---|---|
294
+ | `owner_id` | User ID who created or last published the entity |
295
+ | `visibility` | `"private"` (default) or `"public"` |
296
+ | `published_at` | ISO-8601 timestamp of the most recent publish |
297
+
298
+ ### MCP Tools
299
+
300
+ **Personal facts on a shared Evolve service:**
301
+ ```python
302
+ store_user_facts(namespace_id="service-instance-1", user_id="alice", message="I prefer concise answers")
303
+ retrieve_user_facts(namespace_id="service-instance-1", user_id="alice", query="answer preferences")
304
+ ```
305
+ Pass the service instance ID as `namespace_id` and the individual user's ID as
306
+ `user_id` on both calls. Explicitly scoped retrieval filters by that exact pair,
307
+ including query fallback, and never falls back to another user's facts. Empty
308
+ explicit namespaces or user IDs are rejected. Calls omitting `namespace_id`
309
+ retain the configured default namespace and legacy default-user fallback.
310
+ Integrating clients must supply the scope; upgrading Evolve alone cannot infer
311
+ which service instance an unscoped request belongs to.
312
+
313
+
314
+ **Publishing an entity:**
315
+ ```python
316
+ publish_entity(entity_id="42", user_id="alice")
317
+ ```
318
+ Sets `visibility=public` and records the owner and publish timestamp.
319
+
320
+ **Unpublishing:**
321
+ ```python
322
+ unpublish_entity(entity_id="42", user_id="alice")
323
+ ```
324
+ Reverts the entity to private. The entity stays in its namespace — only its visibility changes.
325
+
326
+ **Retrieving public entities from all namespaces:**
327
+ ```python
328
+ get_entities(task="write safer code", include_public=True)
329
+ ```
330
+ Merges results from the caller's namespace with public entities from all other namespaces. Public results are annotated with `[public: {owner_id}]`.
331
+
332
+ **Creating an entity with visibility:**
333
+ ```python
334
+ create_entity(content="...", entity_type="guideline", visibility="public", owner_id="alice")
335
+ ```
336
+
337
+ ### What's deferred (Phase 1C)
338
+ REST API endpoints (`GET /api/entities/public`, publish/unpublish routes) and UI controls are not yet implemented.
339
+
340
+ ## Guideline Provenance
341
+ Evolve automatically tracks the origin of every guideline it generates or stores. Every guideline entity contains `metadata` identifying its source:
342
+ - `creation_mode`: Identifies how the guideline was created (`auto-phoenix` via trace observability, `auto-mcp` via trajectory saving tools, or `manual`).
343
+ - `source_task_id`: The ID of the original trace or task that inspired the guideline, providing full auditability.
344
+
345
+ See the [Low-Code Tracing Guide](https://github.com/AgentToolkit/altk-evolve/blob/v1.7.0/docs/guides/low-code-tracing.md#6-understanding-guideline-provenance-metadata) for more details.
346
+
347
+
348
+ ## Contributing, Community, and Feedback
349
+ Evolve is an active project, and real‑world usage helps guide its direction.
350
+
351
+ 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.
352
+
353
+ See the [Contributing Guide](https://github.com/AgentToolkit/altk-evolve/blob/v1.7.0/CONTRIBUTING.md) to understand our development process, or how to submit changes, report bugs, or propose features.
354
+
355
+ ### Embedded memory API and scheduling
356
+
357
+ Hosts can mount the [scoped REST router](https://github.com/AgentToolkit/altk-evolve/blob/v1.7.0/docs/guides/embedded-memory-api.md) with their own client and authentication dependencies. Evolve owns [retention schedules and worker execution](https://github.com/AgentToolkit/altk-evolve/blob/v1.7.0/docs/guides/retention-scheduling.md), using Kubernetes-compatible cron, timezone, concurrency, deadline, and suspension fields. Use `evolve retention schedules` to manage schedules and `start`/`stop` to enable or suspend them. The Evolve service owns background execution.
358
+
359
+ The [public retention service](https://github.com/AgentToolkit/altk-evolve/blob/v1.7.0/docs/guides/retention-api.md) is available as `client.retention(namespace_id, agent_id=...)`; CLI, REST, MCP, and scheduling share its operations and scope checks.
360
+
361
+ ### OpenTelemetry service instrumentation
362
+
363
+ Evolve's Python operations use the OpenTelemetry API and inherit the host's
364
+ provider. Constructing `EvolveClient` never installs or replaces a provider.
365
+ Standalone MCP services export telemetry by default. Compatible SDK and exporter
366
+ versions are included in the `[server]` and `[tracing]` extras (both included by
367
+ the convenience package). To configure a destination:
368
+
369
+ ```bash
370
+ uv pip install altk-evolve
371
+ export OTEL_SERVICE_NAME=evolve
372
+ export OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318
373
+ export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
374
+ python -m altk_evolve.frontend.mcp --transport sse
375
+ ```
376
+
377
+ Without an endpoint setting, the OTLP exporter uses localhost:4318. Export runs
378
+ in the background with bounded queues; an absent collector does not block memory
379
+ operations. Unsent telemetry may be dropped. Requests default to a one-second
380
+ export timeout, overridable through standard OTEL timeout settings. Set
381
+ `EVOLVE_OTEL_ENABLED=false` to disable Evolve-owned export. If exporter packages
382
+ cannot be imported, Evolve logs a warning and continues without an exporter.
383
+ Invalid exporter configuration also logs a warning and leaves service startup
384
+ unaffected; correct the settings and retry initialization to enable export.
385
+
386
+ Use an actual reachable collector address. OpenLIT and other OTLP backends are
387
+ supported without their SDKs. This exporter uses HTTP/protobuf; the signal-specific
388
+ `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` and `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT`
389
+ include `/v1/traces` and `/v1/metrics`, respectively. Standard resource, sampling,
390
+ batch-size, export-timeout and metric-interval environment settings apply.
391
+ `OTEL_TRACES_EXPORTER=none` and `OTEL_METRICS_EXPORTER=none` disable each exporter;
392
+ `OTEL_SDK_DISABLED=true` prevents Evolve's service initialization. An existing
393
+ host tracer provider is left untouched, including ownership of its shutdown.
394
+ Custom service hosts can explicitly call `configure_service_telemetry()` from
395
+ `altk_evolve.telemetry` at startup. The SDK installs process-exit shutdown hooks;
396
+ the MCP lifespan does not synchronously flush or wait for a collector.
397
+
398
+ Spans cover memory search, query embeddings and PostgreSQL retrieval, write
399
+ preparation/commit, fact extraction and conflict resolution, model calls,
400
+ processing stages/processors, active hooks, and retention marking/sweeping/jobs.
401
+ FastMCP propagates MCP trace metadata; the scoped REST router accepts W3C trace
402
+ headers. Independent scheduled attempts start separate traces with job references.
403
+ Duration histograms and outcome counters have bounded operation/result labels,
404
+ never namespace, user, conversation or entity IDs. Namespace attribution belongs
405
+ on spans. Evolve's instrumentation excludes contents, prompts, SQL values and
406
+ exception messages. Evolve-owned export forwards Evolve's instrumentation and
407
+ sanitized FastMCP transport spans that retain timing, IDs, kind and status code
408
+ to preserve the trace tree. Transport names are fixed; attributes, exception
409
+ events, links and status descriptions are omitted. Metrics only forward the
410
+ `altk_evolve` scope. A host-owned provider controls
411
+ its own exporters and third-party capture settings.
412
+ Traces are diagnostic and may be sampled; durable retention receipts remain the
413
+ authoritative audit record.
414
+
415
+ MCP clients must send `notifications/cancelled` to cancel server work; stopping a
416
+ local wait alone does not cancel the request. Evolve checks cooperative
417
+ cancellation around model calls and before committing prepared memory writes.
418
+ An in-flight provider call may still finish, and earlier committed writes remain.
419
+ These checkpoints do not provide rollback or interrupt arbitrary synchronous work.