sylo-sdk 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sylo_sdk-0.1.0/.gitignore +42 -0
- sylo_sdk-0.1.0/LICENSE +21 -0
- sylo_sdk-0.1.0/MANIFEST.in +2 -0
- sylo_sdk-0.1.0/PKG-INFO +386 -0
- sylo_sdk-0.1.0/README.md +349 -0
- sylo_sdk-0.1.0/assets/sylo.svg +6 -0
- sylo_sdk-0.1.0/examples/demo.py +137 -0
- sylo_sdk-0.1.0/pyproject.toml +61 -0
- sylo_sdk-0.1.0/sylo/__init__.py +212 -0
- sylo_sdk-0.1.0/sylo/cli.py +257 -0
- sylo_sdk-0.1.0/sylo/config.py +113 -0
- sylo_sdk-0.1.0/sylo/core/__init__.py +1 -0
- sylo_sdk-0.1.0/sylo/core/approval.py +457 -0
- sylo_sdk-0.1.0/sylo/core/audit.py +396 -0
- sylo_sdk-0.1.0/sylo/core/checkpoint.py +449 -0
- sylo_sdk-0.1.0/sylo/core/context.py +227 -0
- sylo_sdk-0.1.0/sylo/core/costs.py +88 -0
- sylo_sdk-0.1.0/sylo/core/pipeline.py +393 -0
- sylo_sdk-0.1.0/sylo/core/trust.py +99 -0
- sylo_sdk-0.1.0/sylo/exceptions.py +70 -0
- sylo_sdk-0.1.0/sylo/integrations/__init__.py +1 -0
- sylo_sdk-0.1.0/sylo/integrations/langgraph.py +396 -0
- sylo_sdk-0.1.0/sylo/models.py +182 -0
- sylo_sdk-0.1.0/sylo/py.typed +1 -0
- sylo_sdk-0.1.0/sylo/storage/__init__.py +52 -0
- sylo_sdk-0.1.0/sylo/storage/base.py +135 -0
- sylo_sdk-0.1.0/sylo/storage/cloud_store.py +251 -0
- sylo_sdk-0.1.0/sylo/storage/local_store.py +261 -0
- sylo_sdk-0.1.0/sylo/storage/redis_store.py +220 -0
- sylo_sdk-0.1.0/tests/__init__.py +1 -0
- sylo_sdk-0.1.0/tests/conftest.py +85 -0
- sylo_sdk-0.1.0/tests/test_approval.py +166 -0
- sylo_sdk-0.1.0/tests/test_audit_engine.py +472 -0
- sylo_sdk-0.1.0/tests/test_checkpoint.py +450 -0
- sylo_sdk-0.1.0/tests/test_cli.py +174 -0
- sylo_sdk-0.1.0/tests/test_config.py +154 -0
- sylo_sdk-0.1.0/tests/test_error_handling.py +181 -0
- sylo_sdk-0.1.0/tests/test_langgraph.py +277 -0
- sylo_sdk-0.1.0/tests/test_local_store.py +209 -0
- sylo_sdk-0.1.0/tests/test_models.py +177 -0
- sylo_sdk-0.1.0/tests/test_pipeline.py +159 -0
- sylo_sdk-0.1.0/tests/test_redis_store.py +143 -0
- sylo_sdk-0.1.0/tests/test_trust.py +200 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
*.egg-info/
|
|
7
|
+
*.egg
|
|
8
|
+
dist/
|
|
9
|
+
build/
|
|
10
|
+
.eggs/
|
|
11
|
+
|
|
12
|
+
# Virtual environments
|
|
13
|
+
.venv/
|
|
14
|
+
venv/
|
|
15
|
+
ENV/
|
|
16
|
+
|
|
17
|
+
# IDE
|
|
18
|
+
.vscode/
|
|
19
|
+
.idea/
|
|
20
|
+
*.swp
|
|
21
|
+
*.swo
|
|
22
|
+
*~
|
|
23
|
+
|
|
24
|
+
# OS
|
|
25
|
+
.DS_Store
|
|
26
|
+
Thumbs.db
|
|
27
|
+
|
|
28
|
+
# Testing
|
|
29
|
+
.pytest_cache/
|
|
30
|
+
.coverage
|
|
31
|
+
htmlcov/
|
|
32
|
+
.tox/
|
|
33
|
+
|
|
34
|
+
# Environment variables
|
|
35
|
+
.env
|
|
36
|
+
.env.local
|
|
37
|
+
.env.*.local
|
|
38
|
+
|
|
39
|
+
# Confidential build brief — do NOT push
|
|
40
|
+
SYLO_BUILD_BRIEF.md
|
|
41
|
+
snapshot_script.py
|
|
42
|
+
PROJECT_SNAPSHOT.md
|
sylo_sdk-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sylo
|
|
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.
|
sylo_sdk-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sylo-sdk
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Production operating layer for AI agent pipelines — checkpointing, permission enforcement, human approval gates, and audit logging.
|
|
5
|
+
Project-URL: Homepage, https://sylo.dev
|
|
6
|
+
Project-URL: Documentation, https://docs.sylo.dev
|
|
7
|
+
Project-URL: Repository, https://github.com/saketjndl/Sylo
|
|
8
|
+
Author-email: Sylo <team@sylo.dev>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: agents,ai,audit,checkpointing,llm,production
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
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
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Classifier: Typing :: Typed
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Requires-Dist: click>=8.0
|
|
24
|
+
Requires-Dist: httpx>=0.25
|
|
25
|
+
Requires-Dist: pydantic<3.0,>=2.0
|
|
26
|
+
Requires-Dist: python-dotenv>=1.0
|
|
27
|
+
Requires-Dist: redis>=5.0
|
|
28
|
+
Provides-Extra: dev
|
|
29
|
+
Requires-Dist: fakeredis>=2.21; extra == 'dev'
|
|
30
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
|
|
31
|
+
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
|
|
32
|
+
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
33
|
+
Provides-Extra: langgraph
|
|
34
|
+
Requires-Dist: langchain-core>=0.2; extra == 'langgraph'
|
|
35
|
+
Requires-Dist: langgraph>=0.2; extra == 'langgraph'
|
|
36
|
+
Description-Content-Type: text/markdown
|
|
37
|
+
|
|
38
|
+
<div align="center">
|
|
39
|
+
|
|
40
|
+
<img src="assets/sylo.svg" alt="Sylo Logo" width="180"/>
|
|
41
|
+
|
|
42
|
+
# Sylo
|
|
43
|
+
|
|
44
|
+
### The Production Operating Layer for AI Agents
|
|
45
|
+
|
|
46
|
+
**Ship fault-tolerant, compliant, and controllable autonomous agent pipelines.**
|
|
47
|
+
Add checkpoint recovery, zero-trust permission enforcement, human-in-the-loop approval gates, and immutable audit logs to your existing Python agents in 3 lines of code.
|
|
48
|
+
|
|
49
|
+
[](https://pypi.org/project/sylo-sdk/)
|
|
50
|
+
[](https://python.org)
|
|
51
|
+
[](https://github.com/saketjndl/Sylo)
|
|
52
|
+
[](https://docs.pydantic.dev/)
|
|
53
|
+
[](https://opensource.org/licenses/MIT)
|
|
54
|
+
|
|
55
|
+
[Documentation](https://docs.sylo.dev) · [Quickstart](#quickstart) · [Core Features](#core-features) · [Storage Backends](#storage-backends) · [Discord](https://discord.gg/sylo)
|
|
56
|
+
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## ⚡ Why Sylo?
|
|
62
|
+
|
|
63
|
+
When autonomous AI agents move from local prototypes to production environments, unexpected edge cases inevitably arise: API rate limits trigger crashes, hallucinations lead to unauthorized resource access, or destructive actions fire without oversight.
|
|
64
|
+
|
|
65
|
+
**Sylo wraps your existing workflows (LangGraph, CrewAI, OpenAI Agents SDK, or vanilla Python) with mission-critical reliability and safety rails:**
|
|
66
|
+
|
|
67
|
+
| Challenge in Production | Without Sylo | With Sylo SDK |
|
|
68
|
+
| :--- | :--- | :--- |
|
|
69
|
+
| **Pipeline Failures & Crashes** | A 5-step workflow crashes at step 4 due to an API timeout. You restart from step 1, burning duplicated LLM tokens and wasting minutes. | **Instant Checkpoint Recovery**. Sylo automatically resumes execution exactly at step 4, returning cached results for steps 1–3 and saving up to 90% in token costs. |
|
|
70
|
+
| **Agent Over-Privilege & Leaks** | An autonomous email assistant hallucinates and accesses internal customer databases or file systems it shouldn't touch. | **Zero-Trust Runtime Enforcement**. Declare granular permissions (`can_read`, `can_write`) per step. Unauthorized access attempts are blocked and logged instantly. |
|
|
71
|
+
| **Irreversible Destructive Actions** | An agent deletes customer records, initiates financial transfers, or modifies production databases automatically without notice. | **Human Approval Gates**. Execution automatically pauses at defined gates, dispatching Slack/Email/Webhook notifications and waiting for explicit human sign-off. |
|
|
72
|
+
| **Compliance & Traceability** | Debugging agent behavior requires sifting through scattered text logs with no standardized cost metrics or audit trails. | **Immutable Audit Logging**. Every step, retry, cost estimate, and permission check produces standardized JSONL or Redis Stream audit records. |
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## 🏗️ Architecture & Data Flow
|
|
77
|
+
|
|
78
|
+
Sylo acts as an asynchronous middleware layer between your pipeline logic and your infrastructure storage.
|
|
79
|
+
|
|
80
|
+
```mermaid
|
|
81
|
+
graph TD
|
|
82
|
+
subgraph App [Your Application Pipeline]
|
|
83
|
+
P[sylo.pipeline context] --> S1["@sylo.step: Fetch Data"]
|
|
84
|
+
S1 --> S2["@sylo.step + @sylo.trust: Transform & Access API"]
|
|
85
|
+
S2 --> S3["@sylo.step + @sylo.requires_approval: Execute Action"]
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
subgraph Core [Sylo Core Engine]
|
|
89
|
+
C[Checkpoint Engine]
|
|
90
|
+
T[Trust & Security Broker]
|
|
91
|
+
A[Approval Gate Engine]
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
subgraph Store [Persistence Layer]
|
|
95
|
+
LStore[(Local Disk JSONL)]
|
|
96
|
+
RStore[(Redis / Streams)]
|
|
97
|
+
CStore[(Sylo Cloud API)]
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
S1 <-->|Read Cache / Save State| C
|
|
101
|
+
S2 <-->|Validate Permissions| T
|
|
102
|
+
S3 <-->|Pause & Notify / Poll Decision| A
|
|
103
|
+
|
|
104
|
+
C --> Store
|
|
105
|
+
T --> Store
|
|
106
|
+
A --> Store
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## 🚀 Quickstart
|
|
112
|
+
|
|
113
|
+
### 1. Installation
|
|
114
|
+
|
|
115
|
+
Install the Sylo SDK via pip:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
pip install sylo-sdk
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
For Redis storage support in production environments:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
pip install "sylo-sdk[redis]"
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### 2. Five-Minute Integration
|
|
128
|
+
|
|
129
|
+
Here is a complete, production-ready pipeline demonstrating **Checkpointing**, **Permission Enforcement**, and **Human Approval Gates** working together:
|
|
130
|
+
|
|
131
|
+
```python
|
|
132
|
+
import asyncio
|
|
133
|
+
import httpx
|
|
134
|
+
import sylo
|
|
135
|
+
|
|
136
|
+
# 1. Initialize Sylo SDK (defaults to local disk storage in development)
|
|
137
|
+
sylo.init(project="customer-operations", environment="development")
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
# 2. Define pipeline steps using decorators
|
|
141
|
+
@sylo.step("fetch-customer-data", max_retries=3, retry_delay=1.0)
|
|
142
|
+
@sylo.trust(can_read=["crm.customers"])
|
|
143
|
+
async def fetch_customer(ctx: sylo.Context, customer_id: str) -> dict:
|
|
144
|
+
"""Fetch customer details through permission-checked context access."""
|
|
145
|
+
|
|
146
|
+
async def _api_call():
|
|
147
|
+
# Simulate external API call
|
|
148
|
+
return {"id": customer_id, "name": "Acme Corp", "status": "inactive"}
|
|
149
|
+
|
|
150
|
+
# Sylo verifies at runtime that "crm.customers" is allowed for reading
|
|
151
|
+
return await ctx.access("crm.customers", action="read", handler=_api_call)
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
@sylo.step("analyze-churn-risk")
|
|
155
|
+
async def analyze_churn(ctx: sylo.Context) -> dict:
|
|
156
|
+
"""Analyze risk using previous step outputs."""
|
|
157
|
+
# Retrieve cached output from the previous step without re-running it
|
|
158
|
+
customer = ctx.get_output("fetch-customer-data")
|
|
159
|
+
|
|
160
|
+
# Record simulated LLM token usage for cost estimation
|
|
161
|
+
ctx.record_token_usage(prompt_tokens=450, completion_tokens=120, model="gpt-4o")
|
|
162
|
+
|
|
163
|
+
return {"customer_id": customer["id"], "risk_score": 0.89, "recommendation": "terminate"}
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
@sylo.step("delete-account")
|
|
167
|
+
@sylo.requires_approval(
|
|
168
|
+
title="Confirm Account Deletion",
|
|
169
|
+
description="About to permanently delete account for {customer_id} (Risk Score: {risk_score})",
|
|
170
|
+
action_class="destructive",
|
|
171
|
+
timeout_hours=24,
|
|
172
|
+
on_timeout="abort",
|
|
173
|
+
notify=["slack", "email"],
|
|
174
|
+
metadata_keys=["customer_id", "risk_score"]
|
|
175
|
+
)
|
|
176
|
+
async def delete_account(ctx: sylo.Context) -> dict:
|
|
177
|
+
"""Dangerous action guarded by a human approval gate."""
|
|
178
|
+
customer_id = ctx.metadata["customer_id"]
|
|
179
|
+
return {"status": "deleted", "customer_id": customer_id}
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
# 3. Run the pipeline context
|
|
183
|
+
async def main():
|
|
184
|
+
async with sylo.pipeline("churn-remediation", metadata={"customer_id": "cust_8842"}) as pipe:
|
|
185
|
+
data = await fetch_customer(pipe.context, "cust_8842")
|
|
186
|
+
analysis = await analyze_churn(pipe.context)
|
|
187
|
+
|
|
188
|
+
# Merge analysis results into metadata so the approval gate template can render them
|
|
189
|
+
pipe.context.metadata.update(analysis)
|
|
190
|
+
|
|
191
|
+
result = await delete_account(pipe.context)
|
|
192
|
+
print(f"Pipeline finished successfully: {result}")
|
|
193
|
+
|
|
194
|
+
if __name__ == "__main__":
|
|
195
|
+
asyncio.run(main())
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Console Output During Execution
|
|
199
|
+
|
|
200
|
+
When reaching the approval gate in local development mode, Sylo automatically spins up a background HTTP server on port `7749` and prints a clean, actionable prompt to your terminal:
|
|
201
|
+
|
|
202
|
+
```text
|
|
203
|
+
⏸ Sylo Approval Required
|
|
204
|
+
Pipeline: churn-remediation
|
|
205
|
+
Step: delete-account
|
|
206
|
+
Action: About to permanently delete account for cust_8842 (Risk Score: 0.89) (DESTRUCTIVE)
|
|
207
|
+
|
|
208
|
+
Approve: http://localhost:7749/approve/d3b07384-d113-4c4e-9c81-bcc318231221
|
|
209
|
+
Reject: http://localhost:7749/reject/d3b07384-d113-4c4e-9c81-bcc318231221
|
|
210
|
+
|
|
211
|
+
Expires in: 24.0 hours
|
|
212
|
+
Waiting for decision...
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Clicking either URL instantly registers your decision, logs the audit event, and resumes or aborts the asynchronous pipeline.
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## 💎 Core Features
|
|
220
|
+
|
|
221
|
+
### 1. 🔄 Smart Checkpointing & Cost Tracking
|
|
222
|
+
|
|
223
|
+
Wrap any async or sync function with `@sylo.step("step-name")`. Every successful execution is serialized and persisted to storage. If a downstream step crashes or raises an exception, subsequent reruns skip completed steps instantly.
|
|
224
|
+
|
|
225
|
+
```python
|
|
226
|
+
@sylo.step("generate-report", max_retries=5, retry_delay=2.0)
|
|
227
|
+
async def generate_report(ctx: sylo.Context) -> dict:
|
|
228
|
+
# Access outputs from earlier steps safely
|
|
229
|
+
raw_data = ctx.get_output("fetch-data")
|
|
230
|
+
|
|
231
|
+
# Track model usage
|
|
232
|
+
ctx.record_token_usage(prompt_tokens=1200, completion_tokens=350, model="claude-3-5-sonnet")
|
|
233
|
+
return {"report_url": "https://..."}
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
* **Automatic Retries**: Exponential backoff with jitter on network failures.
|
|
237
|
+
* **Token & Cost Ledger**: Automatically tallies prompt and completion tokens across models (`gpt-4o`, `claude-3-5-sonnet`, etc.), estimating real-time USD costs in the execution summary.
|
|
238
|
+
|
|
239
|
+
> [!NOTE]
|
|
240
|
+
> **Transparent Cost Modeling (No API Keys Needed)**
|
|
241
|
+
> How does Sylo calculate token savings and USD cost during local development? Sylo includes a built-in pricing table (`MODEL_PRICES`) for major LLMs ($2.50/$10 per 1M tokens for `gpt-4o`, etc.). In your step functions, you can either report token counts manually via `ctx.record_token_usage(prompt_tokens=..., completion_tokens=..., model="...")` or let Sylo extract them from framework response headers. When a pipeline crashes and resumes, Sylo loads cached checkpoints from disk and credits the exact token counts and estimated USD cost saved—allowing developers to benchmark and audit financial savings in local CI/CD pipelines before spending real money on production API calls.
|
|
242
|
+
|
|
243
|
+
### 2. 🛡️ Zero-Trust Security Broker
|
|
244
|
+
|
|
245
|
+
Prevent agents from performing unauthorized network requests or file modifications by declaring explicit capability manifests.
|
|
246
|
+
|
|
247
|
+
```python
|
|
248
|
+
@sylo.step("send-slack-notification")
|
|
249
|
+
@sylo.trust(
|
|
250
|
+
can_read=["slack.channels", "users.profile"],
|
|
251
|
+
can_write=["slack.messages"],
|
|
252
|
+
can_execute=[],
|
|
253
|
+
can_delete=[]
|
|
254
|
+
)
|
|
255
|
+
async def notify_team(ctx: sylo.Context):
|
|
256
|
+
# This succeeds: matches declared can_write pattern
|
|
257
|
+
await ctx.access("slack.messages", action="write", handler=post_message)
|
|
258
|
+
|
|
259
|
+
# This raises SyloPermissionError and logs an audit violation immediately!
|
|
260
|
+
await ctx.access("aws.s3.buckets", action="delete", handler=delete_bucket)
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### 3. ⏸️ Human Approval Gates
|
|
264
|
+
|
|
265
|
+
Guard destructive, financial, or external actions behind asynchronous human reviews.
|
|
266
|
+
|
|
267
|
+
```python
|
|
268
|
+
@sylo.requires_approval(
|
|
269
|
+
title="Wire Transfer Request",
|
|
270
|
+
description="Transferring ${amount} to account {recipient}",
|
|
271
|
+
action_class="financial",
|
|
272
|
+
timeout_hours=4.0,
|
|
273
|
+
on_timeout="escalate", # Options: "abort", "auto_approve", "escalate"
|
|
274
|
+
notify=["slack", "webhook"], # Dispatches Block Kit / HMAC webhooks
|
|
275
|
+
metadata_keys=["amount", "recipient"]
|
|
276
|
+
)
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
* **Programmatic Fallbacks**: You can also approve or reject requests programmatically from external backend webhooks or CLI scripts via `await sylo.approve(approval_id, decided_by="supervisor")`.
|
|
280
|
+
|
|
281
|
+
### 4. 📜 Immutable Audit Trails
|
|
282
|
+
|
|
283
|
+
Every execution maintains an append-only sequence of immutable events (`PIPELINE_STARTED`, `STEP_COMPLETED`, `PERMISSION_VIOLATION`, `APPROVAL_REQUESTED`, `APPROVAL_DECISION`).
|
|
284
|
+
|
|
285
|
+
In local mode, logs are formatted as standard JSONL (`~/.sylo/executions/{id}/audit.jsonl`). In production Redis storage, events are streamed to high-throughput **Redis Streams** (`XRANGE`), providing complete auditability for SOC2 and enterprise compliance.
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
## 🗄️ Storage Backends
|
|
290
|
+
|
|
291
|
+
Sylo provides a standardized interface across multiple storage engines, allowing you to develop locally without infrastructure overhead and deploy to production seamlessly.
|
|
292
|
+
|
|
293
|
+
| Storage Backend | Configuration | Use Case & Persistence Guarantees |
|
|
294
|
+
| :--- | :--- | :--- |
|
|
295
|
+
| **Local File Store** *(Default)* | `storage="local"` | Perfect for local development and CI testing. Stores execution manifests, checkpoints, and JSONL audit logs under `~/.sylo/executions/`. Fails silently on network errors so development workflows are never blocked. |
|
|
296
|
+
| **Redis & Redis Streams** | `storage="redis"` | Built for high-concurrency production workloads. Uses Redis key-value storage for state checkpoints and append-only Redis Streams for real-time audit event distribution. |
|
|
297
|
+
| **Sylo Cloud API** | `storage="cloud"` | Enterprise managed cloud platform. Syncs executions, approval queues, and telemetry directly to your centralized Sylo Cloud dashboard. |
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
## ⚙️ Configuration Matrix
|
|
302
|
+
|
|
303
|
+
Initialize Sylo programmatically at application startup or via standard environment variables:
|
|
304
|
+
|
|
305
|
+
### Programmatic Configuration
|
|
306
|
+
|
|
307
|
+
```python
|
|
308
|
+
import sylo
|
|
309
|
+
|
|
310
|
+
sylo.init(
|
|
311
|
+
project="autonomous-researcher",
|
|
312
|
+
api_key="sylo_live_xxxxx",
|
|
313
|
+
environment="production", # "development" | "staging" | "production"
|
|
314
|
+
storage="redis", # "local" | "redis" | "cloud"
|
|
315
|
+
redis_url="redis://redis-master:6379/0",
|
|
316
|
+
notifications={
|
|
317
|
+
"slack": {"webhook_url": "https://hooks.slack.com/services/..."},
|
|
318
|
+
"email": {"provider": "resend", "api_key": "re_123456", "from": "bot@company.com"}
|
|
319
|
+
}
|
|
320
|
+
)
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
### Environment Variables
|
|
324
|
+
|
|
325
|
+
| Variable | Description | Default |
|
|
326
|
+
| :--- | :--- | :--- |
|
|
327
|
+
| `SYLO_PROJECT` | Identifier for the pipeline group or application | `default` |
|
|
328
|
+
| `SYLO_ENVIRONMENT` | Current runtime environment (`development`, `production`) | `development` |
|
|
329
|
+
| `SYLO_STORAGE` | Storage backend driver (`local`, `redis`, `cloud`) | `local` |
|
|
330
|
+
| `SYLO_API_KEY` | API key when communicating with Sylo Cloud | `None` |
|
|
331
|
+
| `SYLO_REDIS_URL` | Connection string for Redis backend | `redis://localhost:6379` |
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
## 🔌 Framework Integrations
|
|
336
|
+
|
|
337
|
+
Sylo is designed to wrap around your agent code without replacing your framework.
|
|
338
|
+
|
|
339
|
+
### LangGraph Integration
|
|
340
|
+
|
|
341
|
+
```python
|
|
342
|
+
from langgraph.graph import StateGraph
|
|
343
|
+
import sylo
|
|
344
|
+
|
|
345
|
+
# Define standard LangGraph nodes wrapped in Sylo steps
|
|
346
|
+
@sylo.step("research-node")
|
|
347
|
+
async def research_step(state: dict) -> dict:
|
|
348
|
+
# Perform agent logic...
|
|
349
|
+
return {"findings": "..."}
|
|
350
|
+
|
|
351
|
+
async def run_graph(initial_state: dict):
|
|
352
|
+
# Wrap graph execution inside Sylo pipeline context
|
|
353
|
+
async with sylo.pipeline("langgraph-researcher") as pipe:
|
|
354
|
+
# Pass pipe.context or state freely
|
|
355
|
+
result = await research_step(initial_state)
|
|
356
|
+
return result
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
---
|
|
360
|
+
|
|
361
|
+
## 🧑💻 Contributing & Development
|
|
362
|
+
|
|
363
|
+
We welcome contributions from the open-source community!
|
|
364
|
+
|
|
365
|
+
```bash
|
|
366
|
+
# 1. Clone the repository
|
|
367
|
+
git clone https://github.com/saketjndl/Sylo.git
|
|
368
|
+
cd Sylo
|
|
369
|
+
|
|
370
|
+
# 2. Install dependencies in editable mode
|
|
371
|
+
pip install -e ".[dev,redis]"
|
|
372
|
+
|
|
373
|
+
# 3. Run the test suite (100% async test coverage)
|
|
374
|
+
pytest tests/ -v
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
---
|
|
378
|
+
|
|
379
|
+
## 📄 License
|
|
380
|
+
|
|
381
|
+
Sylo is open-source software licensed under the [MIT License](LICENSE).
|
|
382
|
+
|
|
383
|
+
<div align="center">
|
|
384
|
+
<p>Built with ❤️ by the Sylo Engineering Team.</p>
|
|
385
|
+
<p><a href="https://docs.sylo.dev">Documentation</a> • <a href="https://github.com/saketjndl/Sylo/issues">Report an Issue</a> • <a href="https://discord.gg/sylo">Join Discord</a></p>
|
|
386
|
+
</div>
|