evolution-sdk 0.8.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.
- evolution_sdk-0.8.0/LICENSE +21 -0
- evolution_sdk-0.8.0/PKG-INFO +240 -0
- evolution_sdk-0.8.0/README.md +214 -0
- evolution_sdk-0.8.0/evolution/__init__.py +102 -0
- evolution_sdk-0.8.0/evolution/adapters/__init__.py +28 -0
- evolution_sdk-0.8.0/evolution/adapters/base.py +21 -0
- evolution_sdk-0.8.0/evolution/adapters/crewai.py +86 -0
- evolution_sdk-0.8.0/evolution/adapters/direct.py +120 -0
- evolution_sdk-0.8.0/evolution/adapters/langchain.py +112 -0
- evolution_sdk-0.8.0/evolution/adapters/llamaindex.py +96 -0
- evolution_sdk-0.8.0/evolution/capture/__init__.py +22 -0
- evolution_sdk-0.8.0/evolution/capture/introspect.py +164 -0
- evolution_sdk-0.8.0/evolution/capture/recorder.py +109 -0
- evolution_sdk-0.8.0/evolution/capture/tracker.py +194 -0
- evolution_sdk-0.8.0/evolution/evaluators.py +268 -0
- evolution_sdk-0.8.0/evolution/exceptions.py +52 -0
- evolution_sdk-0.8.0/evolution/models/__init__.py +40 -0
- evolution_sdk-0.8.0/evolution/models/artifacts.py +248 -0
- evolution_sdk-0.8.0/evolution/models/evaluation.py +77 -0
- evolution_sdk-0.8.0/evolution/models/execution.py +77 -0
- evolution_sdk-0.8.0/evolution/models/manifest.py +210 -0
- evolution_sdk-0.8.0/evolution/repository.py +360 -0
- evolution_sdk-0.8.0/evolution/validator.py +55 -0
- evolution_sdk-0.8.0/evolution_sdk.egg-info/PKG-INFO +240 -0
- evolution_sdk-0.8.0/evolution_sdk.egg-info/SOURCES.txt +34 -0
- evolution_sdk-0.8.0/evolution_sdk.egg-info/dependency_links.txt +1 -0
- evolution_sdk-0.8.0/evolution_sdk.egg-info/requires.txt +3 -0
- evolution_sdk-0.8.0/evolution_sdk.egg-info/top_level.txt +1 -0
- evolution_sdk-0.8.0/pyproject.toml +36 -0
- evolution_sdk-0.8.0/setup.cfg +4 -0
- evolution_sdk-0.8.0/tests/test_adapters.py +146 -0
- evolution_sdk-0.8.0/tests/test_artifacts.py +83 -0
- evolution_sdk-0.8.0/tests/test_capture.py +121 -0
- evolution_sdk-0.8.0/tests/test_evaluator.py +145 -0
- evolution_sdk-0.8.0/tests/test_manifest.py +68 -0
- evolution_sdk-0.8.0/tests/test_repository.py +93 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Urvish A. Prajapati (prajapatiurvish712@gmail.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: evolution-sdk
|
|
3
|
+
Version: 0.8.0
|
|
4
|
+
Summary: Python SDK for Evolution â AI-Native Version Control Platform
|
|
5
|
+
Author-email: "Urvish.A.Prajapati" <prajapatiurvish712@gmail.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Urvish0/Evolution
|
|
8
|
+
Project-URL: Repository, https://github.com/Urvish0/Evolution
|
|
9
|
+
Project-URL: Specification, https://github.com/Urvish0/Evolution/blob/main/spec/intelligence-manifest-v1.0.md
|
|
10
|
+
Keywords: ai,version-control,llm,manifest,evaluation,langchain,llamaindex
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
14
|
+
Classifier: Topic :: Software Development :: Version Control
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
25
|
+
Dynamic: license-file
|
|
26
|
+
|
|
27
|
+
# Evolution Python SDK (`evolution-sdk`)
|
|
28
|
+
|
|
29
|
+
> **"Version Intelligence, Not Code."**
|
|
30
|
+
|
|
31
|
+
[](https://pypi.org/project/evolution-sdk/)
|
|
32
|
+
[](https://pypi.org/project/evolution-sdk/)
|
|
33
|
+
[](https://github.com/Urvish0/Evolution/blob/main/LICENSE)
|
|
34
|
+
[](#features)
|
|
35
|
+
|
|
36
|
+
The official Python SDK for **[Evolution](https://github.com/Urvish0/Evolution)** â an open-source, AI-native version control platform.
|
|
37
|
+
|
|
38
|
+
While traditional version control systems (like Git) track line-by-line changes to text files, **Evolution tracks and versions Intelligence**: the complete operational state of an AI system (system prompts, sampling parameters, memory strategies, vector store retrieval configurations, tool schemas, and guardrails).
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## ⥠Key Features
|
|
43
|
+
|
|
44
|
+
- ðŠķ **Zero Runtime Dependencies**: Pure Python implementation with zero third-party dependencies. Ultra-fast, lightweight, and won't conflict with your environment.
|
|
45
|
+
- ðŊ **Automatic Intelligence Capture**: Use the `@evolution.track` decorator to automatically extract docstring prompts, model hyperparameters, token consumption, and latency.
|
|
46
|
+
- âąïļ **Precision Execution Telemetry**: Record execution traces, inputs, outputs, and hardware latency using `@track` or the `evolution.record` context manager.
|
|
47
|
+
- ð **Universal Framework Adapters**: Seamlessly introspect and export standard Intelligence Manifests from **LangChain**, **LlamaIndex**, **CrewAI**, and direct OpenAI / Anthropic client calls.
|
|
48
|
+
- ð **Git-Compatible CAS Blobs**: Content-Addressable Storage with auto-computed SHA-256 Merkle hashes.
|
|
49
|
+
- ð **Intelligence Manifest Spec v1.0 Compliant**: Native support for creating, validating, and saving standard `evolution.manifest.json` schemas.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## ðĶ Installation
|
|
54
|
+
|
|
55
|
+
Install `evolution-sdk` via `pip` or `uv`:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pip install evolution-sdk
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Or using `uv`:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
uv add evolution-sdk
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## ð Quickstart in 30 Seconds
|
|
70
|
+
|
|
71
|
+
### 1. Initialize or Open an Evolution Repository
|
|
72
|
+
|
|
73
|
+
```python
|
|
74
|
+
import evolution as evo
|
|
75
|
+
|
|
76
|
+
# Initialize a new Evolution repository in the current directory
|
|
77
|
+
repo = evo.Repository.init("./my_ai_agent")
|
|
78
|
+
|
|
79
|
+
# Or open an existing repository
|
|
80
|
+
# repo = evo.Repository.open("./my_ai_agent")
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
### 2. Automatic Intelligence Tracking with `@evo.track`
|
|
86
|
+
|
|
87
|
+
Decorate your AI agent functions. Evolution automatically extracts the docstring as the system prompt, registers model configs, measures latency, and logs execution tokens without modifying your business logic:
|
|
88
|
+
|
|
89
|
+
```python
|
|
90
|
+
from openai import OpenAI
|
|
91
|
+
import evolution as evo
|
|
92
|
+
|
|
93
|
+
client = OpenAI()
|
|
94
|
+
repo = evo.Repository.init("./my_agent")
|
|
95
|
+
|
|
96
|
+
@evo.track(
|
|
97
|
+
repo=repo,
|
|
98
|
+
name="customer-support-agent",
|
|
99
|
+
model="gpt-4o",
|
|
100
|
+
temperature=0.2,
|
|
101
|
+
)
|
|
102
|
+
def handle_customer_inquiry(user_message: str):
|
|
103
|
+
"""Senior Customer Support Specialist. Always maintain professional tone and provide step-by-step guidance."""
|
|
104
|
+
response = client.chat.completions.create(
|
|
105
|
+
model="gpt-4o",
|
|
106
|
+
temperature=0.2,
|
|
107
|
+
messages=[
|
|
108
|
+
{"role": "system", "content": "You are a Senior Customer Support Specialist."},
|
|
109
|
+
{"role": "user", "content": user_message}
|
|
110
|
+
]
|
|
111
|
+
)
|
|
112
|
+
return response
|
|
113
|
+
|
|
114
|
+
# Run your agent
|
|
115
|
+
result = handle_customer_inquiry("How do I reset my API key?")
|
|
116
|
+
|
|
117
|
+
# Commit the captured intelligence snapshot
|
|
118
|
+
repo.commit("feat: initial customer support intelligence snapshot")
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
### 3. Precision Latency & Execution Recording with `record()`
|
|
124
|
+
|
|
125
|
+
For fine-grained telemetry or manual pipelines, use the `record` context manager:
|
|
126
|
+
|
|
127
|
+
```python
|
|
128
|
+
import evolution as evo
|
|
129
|
+
|
|
130
|
+
repo = evo.Repository.open(".")
|
|
131
|
+
|
|
132
|
+
with evo.record(repo, metadata={"phase": "testing"}) as ctx:
|
|
133
|
+
# Set inputs
|
|
134
|
+
ctx.set_inputs("User asked: Explain Merkle trees.")
|
|
135
|
+
|
|
136
|
+
# Execute your LLM call
|
|
137
|
+
response_text = "A Merkle tree is a cryptographic tree structure..."
|
|
138
|
+
|
|
139
|
+
# Record outputs and token metrics
|
|
140
|
+
ctx.set_outputs(response_text)
|
|
141
|
+
ctx.set_tokens(prompt_tokens=42, completion_tokens=128)
|
|
142
|
+
|
|
143
|
+
print(f"Recorded execution with duration: {ctx.execution.duration_ms} ms")
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## ð Framework Adapters
|
|
149
|
+
|
|
150
|
+
Evolution provides plug-and-play adapters to export standard Intelligence Manifests directly from your existing AI framework abstractions:
|
|
151
|
+
|
|
152
|
+
### LangChain Adapter
|
|
153
|
+
```python
|
|
154
|
+
from langchain_openai import ChatOpenAI
|
|
155
|
+
from langchain_core.prompts import ChatPromptTemplate
|
|
156
|
+
from evolution.adapters import LangChainAdapter
|
|
157
|
+
|
|
158
|
+
prompt = ChatPromptTemplate.from_template("Summarize the following legal document: {doc}")
|
|
159
|
+
llm = ChatOpenAI(model="gpt-4o", temperature=0.1)
|
|
160
|
+
chain = prompt | llm
|
|
161
|
+
|
|
162
|
+
manifest = LangChainAdapter.from_langchain(chain, name="legal-summarizer")
|
|
163
|
+
print(manifest.to_dict())
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### LlamaIndex Adapter
|
|
167
|
+
```python
|
|
168
|
+
from llama_index.core import VectorStoreIndex
|
|
169
|
+
from evolution.adapters import LlamaIndexAdapter
|
|
170
|
+
|
|
171
|
+
manifest = LlamaIndexAdapter.from_llamaindex(
|
|
172
|
+
index=my_vector_index,
|
|
173
|
+
name="financial-rag-agent",
|
|
174
|
+
similarity_top_k=5,
|
|
175
|
+
)
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### CrewAI Adapter
|
|
179
|
+
```python
|
|
180
|
+
from crewai import Agent, Crew, Task
|
|
181
|
+
from evolution.adapters import CrewAIAdapter
|
|
182
|
+
|
|
183
|
+
manifest = CrewAIAdapter.from_crewai(my_crew, name="research-crew")
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## ð The Intelligence Manifest Format (`evolution.manifest.json`)
|
|
189
|
+
|
|
190
|
+
Evolution stores your complete AI system state in a portable, framework-agnostic manifest following the **[Intelligence Manifest Specification v1.0](https://github.com/Urvish0/Evolution/blob/main/spec/intelligence-manifest-v1.0.md)**:
|
|
191
|
+
|
|
192
|
+
```json
|
|
193
|
+
{
|
|
194
|
+
"version": "1.0.0",
|
|
195
|
+
"name": "legal-dispute-resolution-system",
|
|
196
|
+
"description": "AI system powered by Evolution version control",
|
|
197
|
+
"artifacts": {
|
|
198
|
+
"prompts": [
|
|
199
|
+
{
|
|
200
|
+
"type": "prompt",
|
|
201
|
+
"name": "strict-legal-analyst-prompt",
|
|
202
|
+
"description": "Extracted docstring prompt",
|
|
203
|
+
"role": "system",
|
|
204
|
+
"format": "text"
|
|
205
|
+
}
|
|
206
|
+
],
|
|
207
|
+
"model_config": {
|
|
208
|
+
"type": "model_config",
|
|
209
|
+
"name": "analyst-model",
|
|
210
|
+
"model": "qwen/qwen3.8-27b",
|
|
211
|
+
"provider": "local",
|
|
212
|
+
"temperature": 0.1
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## ð§Š Running Tests
|
|
221
|
+
|
|
222
|
+
To run the SDK test suite:
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
pytest sdk/python/tests/ -v
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## ð License
|
|
231
|
+
|
|
232
|
+
This project is licensed under the **MIT License** â see the [LICENSE](LICENSE) file for details.
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## ð Links
|
|
237
|
+
|
|
238
|
+
- **GitHub Repository:** [https://github.com/Urvish0/Evolution](https://github.com/Urvish0/Evolution)
|
|
239
|
+
- **Specification:** [Intelligence Manifest Spec v1.0](https://github.com/Urvish0/Evolution/blob/main/spec/intelligence-manifest-v1.0.md)
|
|
240
|
+
- **Documentation:** [Technical Manual](https://github.com/Urvish0/Evolution/blob/main/DOCUMENTATION.md)
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
# Evolution Python SDK (`evolution-sdk`)
|
|
2
|
+
|
|
3
|
+
> **"Version Intelligence, Not Code."**
|
|
4
|
+
|
|
5
|
+
[](https://pypi.org/project/evolution-sdk/)
|
|
6
|
+
[](https://pypi.org/project/evolution-sdk/)
|
|
7
|
+
[](https://github.com/Urvish0/Evolution/blob/main/LICENSE)
|
|
8
|
+
[](#features)
|
|
9
|
+
|
|
10
|
+
The official Python SDK for **[Evolution](https://github.com/Urvish0/Evolution)** â an open-source, AI-native version control platform.
|
|
11
|
+
|
|
12
|
+
While traditional version control systems (like Git) track line-by-line changes to text files, **Evolution tracks and versions Intelligence**: the complete operational state of an AI system (system prompts, sampling parameters, memory strategies, vector store retrieval configurations, tool schemas, and guardrails).
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## ⥠Key Features
|
|
17
|
+
|
|
18
|
+
- ðŠķ **Zero Runtime Dependencies**: Pure Python implementation with zero third-party dependencies. Ultra-fast, lightweight, and won't conflict with your environment.
|
|
19
|
+
- ðŊ **Automatic Intelligence Capture**: Use the `@evolution.track` decorator to automatically extract docstring prompts, model hyperparameters, token consumption, and latency.
|
|
20
|
+
- âąïļ **Precision Execution Telemetry**: Record execution traces, inputs, outputs, and hardware latency using `@track` or the `evolution.record` context manager.
|
|
21
|
+
- ð **Universal Framework Adapters**: Seamlessly introspect and export standard Intelligence Manifests from **LangChain**, **LlamaIndex**, **CrewAI**, and direct OpenAI / Anthropic client calls.
|
|
22
|
+
- ð **Git-Compatible CAS Blobs**: Content-Addressable Storage with auto-computed SHA-256 Merkle hashes.
|
|
23
|
+
- ð **Intelligence Manifest Spec v1.0 Compliant**: Native support for creating, validating, and saving standard `evolution.manifest.json` schemas.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## ðĶ Installation
|
|
28
|
+
|
|
29
|
+
Install `evolution-sdk` via `pip` or `uv`:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pip install evolution-sdk
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Or using `uv`:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
uv add evolution-sdk
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## ð Quickstart in 30 Seconds
|
|
44
|
+
|
|
45
|
+
### 1. Initialize or Open an Evolution Repository
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
import evolution as evo
|
|
49
|
+
|
|
50
|
+
# Initialize a new Evolution repository in the current directory
|
|
51
|
+
repo = evo.Repository.init("./my_ai_agent")
|
|
52
|
+
|
|
53
|
+
# Or open an existing repository
|
|
54
|
+
# repo = evo.Repository.open("./my_ai_agent")
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
### 2. Automatic Intelligence Tracking with `@evo.track`
|
|
60
|
+
|
|
61
|
+
Decorate your AI agent functions. Evolution automatically extracts the docstring as the system prompt, registers model configs, measures latency, and logs execution tokens without modifying your business logic:
|
|
62
|
+
|
|
63
|
+
```python
|
|
64
|
+
from openai import OpenAI
|
|
65
|
+
import evolution as evo
|
|
66
|
+
|
|
67
|
+
client = OpenAI()
|
|
68
|
+
repo = evo.Repository.init("./my_agent")
|
|
69
|
+
|
|
70
|
+
@evo.track(
|
|
71
|
+
repo=repo,
|
|
72
|
+
name="customer-support-agent",
|
|
73
|
+
model="gpt-4o",
|
|
74
|
+
temperature=0.2,
|
|
75
|
+
)
|
|
76
|
+
def handle_customer_inquiry(user_message: str):
|
|
77
|
+
"""Senior Customer Support Specialist. Always maintain professional tone and provide step-by-step guidance."""
|
|
78
|
+
response = client.chat.completions.create(
|
|
79
|
+
model="gpt-4o",
|
|
80
|
+
temperature=0.2,
|
|
81
|
+
messages=[
|
|
82
|
+
{"role": "system", "content": "You are a Senior Customer Support Specialist."},
|
|
83
|
+
{"role": "user", "content": user_message}
|
|
84
|
+
]
|
|
85
|
+
)
|
|
86
|
+
return response
|
|
87
|
+
|
|
88
|
+
# Run your agent
|
|
89
|
+
result = handle_customer_inquiry("How do I reset my API key?")
|
|
90
|
+
|
|
91
|
+
# Commit the captured intelligence snapshot
|
|
92
|
+
repo.commit("feat: initial customer support intelligence snapshot")
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
### 3. Precision Latency & Execution Recording with `record()`
|
|
98
|
+
|
|
99
|
+
For fine-grained telemetry or manual pipelines, use the `record` context manager:
|
|
100
|
+
|
|
101
|
+
```python
|
|
102
|
+
import evolution as evo
|
|
103
|
+
|
|
104
|
+
repo = evo.Repository.open(".")
|
|
105
|
+
|
|
106
|
+
with evo.record(repo, metadata={"phase": "testing"}) as ctx:
|
|
107
|
+
# Set inputs
|
|
108
|
+
ctx.set_inputs("User asked: Explain Merkle trees.")
|
|
109
|
+
|
|
110
|
+
# Execute your LLM call
|
|
111
|
+
response_text = "A Merkle tree is a cryptographic tree structure..."
|
|
112
|
+
|
|
113
|
+
# Record outputs and token metrics
|
|
114
|
+
ctx.set_outputs(response_text)
|
|
115
|
+
ctx.set_tokens(prompt_tokens=42, completion_tokens=128)
|
|
116
|
+
|
|
117
|
+
print(f"Recorded execution with duration: {ctx.execution.duration_ms} ms")
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## ð Framework Adapters
|
|
123
|
+
|
|
124
|
+
Evolution provides plug-and-play adapters to export standard Intelligence Manifests directly from your existing AI framework abstractions:
|
|
125
|
+
|
|
126
|
+
### LangChain Adapter
|
|
127
|
+
```python
|
|
128
|
+
from langchain_openai import ChatOpenAI
|
|
129
|
+
from langchain_core.prompts import ChatPromptTemplate
|
|
130
|
+
from evolution.adapters import LangChainAdapter
|
|
131
|
+
|
|
132
|
+
prompt = ChatPromptTemplate.from_template("Summarize the following legal document: {doc}")
|
|
133
|
+
llm = ChatOpenAI(model="gpt-4o", temperature=0.1)
|
|
134
|
+
chain = prompt | llm
|
|
135
|
+
|
|
136
|
+
manifest = LangChainAdapter.from_langchain(chain, name="legal-summarizer")
|
|
137
|
+
print(manifest.to_dict())
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### LlamaIndex Adapter
|
|
141
|
+
```python
|
|
142
|
+
from llama_index.core import VectorStoreIndex
|
|
143
|
+
from evolution.adapters import LlamaIndexAdapter
|
|
144
|
+
|
|
145
|
+
manifest = LlamaIndexAdapter.from_llamaindex(
|
|
146
|
+
index=my_vector_index,
|
|
147
|
+
name="financial-rag-agent",
|
|
148
|
+
similarity_top_k=5,
|
|
149
|
+
)
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### CrewAI Adapter
|
|
153
|
+
```python
|
|
154
|
+
from crewai import Agent, Crew, Task
|
|
155
|
+
from evolution.adapters import CrewAIAdapter
|
|
156
|
+
|
|
157
|
+
manifest = CrewAIAdapter.from_crewai(my_crew, name="research-crew")
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## ð The Intelligence Manifest Format (`evolution.manifest.json`)
|
|
163
|
+
|
|
164
|
+
Evolution stores your complete AI system state in a portable, framework-agnostic manifest following the **[Intelligence Manifest Specification v1.0](https://github.com/Urvish0/Evolution/blob/main/spec/intelligence-manifest-v1.0.md)**:
|
|
165
|
+
|
|
166
|
+
```json
|
|
167
|
+
{
|
|
168
|
+
"version": "1.0.0",
|
|
169
|
+
"name": "legal-dispute-resolution-system",
|
|
170
|
+
"description": "AI system powered by Evolution version control",
|
|
171
|
+
"artifacts": {
|
|
172
|
+
"prompts": [
|
|
173
|
+
{
|
|
174
|
+
"type": "prompt",
|
|
175
|
+
"name": "strict-legal-analyst-prompt",
|
|
176
|
+
"description": "Extracted docstring prompt",
|
|
177
|
+
"role": "system",
|
|
178
|
+
"format": "text"
|
|
179
|
+
}
|
|
180
|
+
],
|
|
181
|
+
"model_config": {
|
|
182
|
+
"type": "model_config",
|
|
183
|
+
"name": "analyst-model",
|
|
184
|
+
"model": "qwen/qwen3.8-27b",
|
|
185
|
+
"provider": "local",
|
|
186
|
+
"temperature": 0.1
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## ð§Š Running Tests
|
|
195
|
+
|
|
196
|
+
To run the SDK test suite:
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
pytest sdk/python/tests/ -v
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## ð License
|
|
205
|
+
|
|
206
|
+
This project is licensed under the **MIT License** â see the [LICENSE](LICENSE) file for details.
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## ð Links
|
|
211
|
+
|
|
212
|
+
- **GitHub Repository:** [https://github.com/Urvish0/Evolution](https://github.com/Urvish0/Evolution)
|
|
213
|
+
- **Specification:** [Intelligence Manifest Spec v1.0](https://github.com/Urvish0/Evolution/blob/main/spec/intelligence-manifest-v1.0.md)
|
|
214
|
+
- **Documentation:** [Technical Manual](https://github.com/Urvish0/Evolution/blob/main/DOCUMENTATION.md)
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Evolution Python SDK â AI-Native Version Control Platform.
|
|
3
|
+
"Version Intelligence, Not Code."
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
from evolution.adapters import (
|
|
9
|
+
from_anthropic,
|
|
10
|
+
from_crewai,
|
|
11
|
+
from_langchain,
|
|
12
|
+
from_llamaindex,
|
|
13
|
+
from_openai,
|
|
14
|
+
)
|
|
15
|
+
from evolution.capture import RecordContextManager, record, track
|
|
16
|
+
from evolution.evaluators import (
|
|
17
|
+
DimensionScore,
|
|
18
|
+
EvaluationReport,
|
|
19
|
+
SemanticEvaluator,
|
|
20
|
+
)
|
|
21
|
+
from evolution.exceptions import (
|
|
22
|
+
ArtifactNotFoundError,
|
|
23
|
+
CommandExecutionError,
|
|
24
|
+
EvolutionError,
|
|
25
|
+
ManifestNotFoundError,
|
|
26
|
+
ManifestValidationError,
|
|
27
|
+
RepositoryAlreadyExistsError,
|
|
28
|
+
RepositoryNotFoundError,
|
|
29
|
+
)
|
|
30
|
+
from evolution.models import (
|
|
31
|
+
BaseArtifact,
|
|
32
|
+
EvaluationResult,
|
|
33
|
+
EvaluationScore,
|
|
34
|
+
Execution,
|
|
35
|
+
Manifest,
|
|
36
|
+
ManifestArtifacts,
|
|
37
|
+
MemoryArtifact,
|
|
38
|
+
ModelConfigArtifact,
|
|
39
|
+
PolicyArtifact,
|
|
40
|
+
PromptArtifact,
|
|
41
|
+
RetrievalArtifact,
|
|
42
|
+
TokenUsage,
|
|
43
|
+
ToolArtifact,
|
|
44
|
+
artifact_from_dict,
|
|
45
|
+
compute_blob_hash,
|
|
46
|
+
)
|
|
47
|
+
from evolution.repository import CommitInfo, RepoStatus, Repository
|
|
48
|
+
|
|
49
|
+
__version__ = "0.8.0"
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def init(path: Path | str = ".", name: str = "ai-intelligence") -> Repository:
|
|
53
|
+
"""Convenience function to initialize a new Evolution repository."""
|
|
54
|
+
return Repository.init(path=path, name=name)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def open(path: Path | str = ".") -> Repository:
|
|
58
|
+
"""Convenience function to open an existing Evolution repository."""
|
|
59
|
+
return Repository.open(path=path)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
__all__ = [
|
|
63
|
+
"ArtifactNotFoundError",
|
|
64
|
+
"BaseArtifact",
|
|
65
|
+
"CommandExecutionError",
|
|
66
|
+
"CommitInfo",
|
|
67
|
+
"DimensionScore",
|
|
68
|
+
"EvaluationReport",
|
|
69
|
+
"EvaluationResult",
|
|
70
|
+
"EvaluationScore",
|
|
71
|
+
"EvolutionError",
|
|
72
|
+
"Execution",
|
|
73
|
+
"Manifest",
|
|
74
|
+
"ManifestArtifacts",
|
|
75
|
+
"ManifestNotFoundError",
|
|
76
|
+
"ManifestValidationError",
|
|
77
|
+
"MemoryArtifact",
|
|
78
|
+
"ModelConfigArtifact",
|
|
79
|
+
"PolicyArtifact",
|
|
80
|
+
"PromptArtifact",
|
|
81
|
+
"RecordContextManager",
|
|
82
|
+
"RepoStatus",
|
|
83
|
+
"Repository",
|
|
84
|
+
"RepositoryAlreadyExistsError",
|
|
85
|
+
"RepositoryNotFoundError",
|
|
86
|
+
"RetrievalArtifact",
|
|
87
|
+
"SemanticEvaluator",
|
|
88
|
+
"TokenUsage",
|
|
89
|
+
"ToolArtifact",
|
|
90
|
+
"__version__",
|
|
91
|
+
"artifact_from_dict",
|
|
92
|
+
"compute_blob_hash",
|
|
93
|
+
"from_anthropic",
|
|
94
|
+
"from_crewai",
|
|
95
|
+
"from_langchain",
|
|
96
|
+
"from_llamaindex",
|
|
97
|
+
"from_openai",
|
|
98
|
+
"init",
|
|
99
|
+
"open",
|
|
100
|
+
"record",
|
|
101
|
+
"track",
|
|
102
|
+
]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Evolution framework adapters package.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from evolution.adapters.base import BaseAdapter
|
|
6
|
+
from evolution.adapters.crewai import CrewAIAdapter, from_crewai
|
|
7
|
+
from evolution.adapters.direct import (
|
|
8
|
+
AnthropicAdapter,
|
|
9
|
+
OpenAIAdapter,
|
|
10
|
+
from_anthropic,
|
|
11
|
+
from_openai,
|
|
12
|
+
)
|
|
13
|
+
from evolution.adapters.langchain import LangChainAdapter, from_langchain
|
|
14
|
+
from evolution.adapters.llamaindex import LlamaIndexAdapter, from_llamaindex
|
|
15
|
+
|
|
16
|
+
__all__ = [
|
|
17
|
+
"AnthropicAdapter",
|
|
18
|
+
"BaseAdapter",
|
|
19
|
+
"CrewAIAdapter",
|
|
20
|
+
"LangChainAdapter",
|
|
21
|
+
"LlamaIndexAdapter",
|
|
22
|
+
"OpenAIAdapter",
|
|
23
|
+
"from_anthropic",
|
|
24
|
+
"from_crewai",
|
|
25
|
+
"from_langchain",
|
|
26
|
+
"from_llamaindex",
|
|
27
|
+
"from_openai",
|
|
28
|
+
]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Base protocol and abstract class for framework adapters.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from abc import ABC, abstractmethod
|
|
8
|
+
from typing import Any
|
|
9
|
+
|
|
10
|
+
from evolution.models.manifest import Manifest
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class BaseAdapter(ABC):
|
|
14
|
+
"""Abstract base class for converting framework-specific AI configurations
|
|
15
|
+
into standard Intelligence Manifests (Spec v1.0).
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
@abstractmethod
|
|
19
|
+
def to_manifest(self, obj: Any, name: str = "ai-intelligence", description: str = "") -> Manifest:
|
|
20
|
+
"""Converts a framework-specific object into an Evolution Manifest."""
|
|
21
|
+
pass
|