k9x 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.
- k9x-0.1.0/MANIFEST.in +3 -0
- k9x-0.1.0/PKG-INFO +220 -0
- k9x-0.1.0/README.md +203 -0
- k9x-0.1.0/backend/__init__.py +0 -0
- k9x-0.1.0/backend/api/__init__.py +0 -0
- k9x-0.1.0/backend/api/routes.py +1006 -0
- k9x-0.1.0/backend/main.py +67 -0
- k9x-0.1.0/backend/services/__init__.py +0 -0
- k9x-0.1.0/backend/services/bpmn_service.py +231 -0
- k9x-0.1.0/backend/services/config_service.py +78 -0
- k9x-0.1.0/backend/services/context_service.py +41 -0
- k9x-0.1.0/backend/services/langflow_export_service.py +232 -0
- k9x-0.1.0/backend/services/scaffold_service.py +769 -0
- k9x-0.1.0/backend/services/spec_parsing_service.py +293 -0
- k9x-0.1.0/backend/templates/agent.yaml.j2 +40 -0
- k9x-0.1.0/backend/templates/agent_base.py.j2 +45 -0
- k9x-0.1.0/backend/templates/agent_critic_actor.py.j2 +43 -0
- k9x-0.1.0/backend/templates/agent_validation_loop.py.j2 +70 -0
- k9x-0.1.0/backend/templates/config.yaml.j2 +134 -0
- k9x-0.1.0/backend/templates/main.py.j2 +227 -0
- k9x-0.1.0/backend/templates/orchestrator.py.j2 +69 -0
- k9x-0.1.0/backend/templates/run.sh.j2 +74 -0
- k9x-0.1.0/backend/templates/setup.sh.j2 +327 -0
- k9x-0.1.0/backend/templates/squad.yaml.j2 +15 -0
- k9x-0.1.0/backend/tests/__init__.py +0 -0
- k9x-0.1.0/backend/tests/test_scaffold_service.py +293 -0
- k9x-0.1.0/frontend/__init__.py +0 -0
- k9x-0.1.0/frontend/dist/.DS_Store +0 -0
- k9x-0.1.0/frontend/dist/architecture/index.html +177 -0
- k9x-0.1.0/frontend/dist/architecture/k9x_studio_class_diagram_v2.png +0 -0
- k9x-0.1.0/frontend/dist/architecture/studio_block_flow.png +0 -0
- k9x-0.1.0/frontend/dist/assets/index-BOO4PqWx.js +149 -0
- k9x-0.1.0/frontend/dist/assets/index-C3y48ba5.css +1 -0
- k9x-0.1.0/frontend/dist/assets/k9aif-logo-C_83S6EL.png +0 -0
- k9x-0.1.0/frontend/dist/class-diagrams/automotive.puml +91 -0
- k9x-0.1.0/frontend/dist/class-diagrams/automotive.svg +1 -0
- k9x-0.1.0/frontend/dist/class-diagrams/customer-service.puml +80 -0
- k9x-0.1.0/frontend/dist/class-diagrams/customer-service.svg +1 -0
- k9x-0.1.0/frontend/dist/class-diagrams/document-intelligence.puml +91 -0
- k9x-0.1.0/frontend/dist/class-diagrams/document-intelligence.svg +1 -0
- k9x-0.1.0/frontend/dist/class-diagrams/financial-analysis.puml +94 -0
- k9x-0.1.0/frontend/dist/class-diagrams/financial-analysis.svg +1 -0
- k9x-0.1.0/frontend/dist/class-diagrams/god-almighty.puml +157 -0
- k9x-0.1.0/frontend/dist/class-diagrams/god-almighty.svg +1 -0
- k9x-0.1.0/frontend/dist/class-diagrams/healthcare.puml +91 -0
- k9x-0.1.0/frontend/dist/class-diagrams/healthcare.svg +1 -0
- k9x-0.1.0/frontend/dist/class-diagrams/saving-grace.puml +138 -0
- k9x-0.1.0/frontend/dist/class-diagrams/saving-grace.svg +1 -0
- k9x-0.1.0/frontend/dist/favicon.svg +1 -0
- k9x-0.1.0/frontend/dist/icons.svg +24 -0
- k9x-0.1.0/frontend/dist/index.html +14 -0
- k9x-0.1.0/k9x/__init__.py +4 -0
- k9x-0.1.0/k9x/__main__.py +5 -0
- k9x-0.1.0/k9x/_generator_templates/agent_template.py.j2 +45 -0
- k9x-0.1.0/k9x/_generator_templates/agents_template.yaml.j2 +35 -0
- k9x-0.1.0/k9x/_generator_templates/config_template.yaml.j2 +54 -0
- k9x-0.1.0/k9x/_generator_templates/conftest_template.py.j2 +28 -0
- k9x-0.1.0/k9x/_generator_templates/init_template.py.j2 +12 -0
- k9x-0.1.0/k9x/_generator_templates/main_template.py.j2 +49 -0
- k9x-0.1.0/k9x/_generator_templates/orchestrator_template.py.j2 +63 -0
- k9x-0.1.0/k9x/_generator_templates/squads_template.yaml.j2 +18 -0
- k9x-0.1.0/k9x/_generator_templates/test_template.py.j2 +35 -0
- k9x-0.1.0/k9x/cli.py +271 -0
- k9x-0.1.0/k9x/env_template.py +83 -0
- k9x-0.1.0/k9x.egg-info/PKG-INFO +220 -0
- k9x-0.1.0/k9x.egg-info/SOURCES.txt +70 -0
- k9x-0.1.0/k9x.egg-info/dependency_links.txt +1 -0
- k9x-0.1.0/k9x.egg-info/entry_points.txt +2 -0
- k9x-0.1.0/k9x.egg-info/requires.txt +9 -0
- k9x-0.1.0/k9x.egg-info/top_level.txt +3 -0
- k9x-0.1.0/pyproject.toml +37 -0
- k9x-0.1.0/setup.cfg +4 -0
k9x-0.1.0/MANIFEST.in
ADDED
k9x-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: k9x
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: K9-AIF Studio — visual, drag-and-drop architecture builder for K9-AIF projects
|
|
5
|
+
License: Apache-2.0
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
Requires-Dist: k9-aif>=1.2.6
|
|
9
|
+
Requires-Dist: fastapi>=0.111.0
|
|
10
|
+
Requires-Dist: uvicorn[standard]>=0.30.0
|
|
11
|
+
Requires-Dist: pydantic>=2.0
|
|
12
|
+
Requires-Dist: jinja2>=3.1.0
|
|
13
|
+
Requires-Dist: python-multipart>=0.0.9
|
|
14
|
+
Requires-Dist: requests>=2.31.0
|
|
15
|
+
Requires-Dist: pyyaml>=6.0
|
|
16
|
+
Requires-Dist: python-dotenv>=1.0
|
|
17
|
+
|
|
18
|
+
# k9x_studio
|
|
19
|
+
|
|
20
|
+
**Visual Architecture Builder for K9-AIF Systems**
|
|
21
|
+
|
|
22
|
+
k9x_studio is a browser-based drag-and-drop IDE for designing K9-AIF multi-agent systems. It reads the `k9_aif_abb` component library, lets architects compose systems visually on a canvas, and generates production-ready YAML configuration and Python scaffold — the same output as `k9_generator.sh`, but designed rather than typed.
|
|
23
|
+
|
|
24
|
+
Try it live: [studio.k9x.ai](https://studio.k9x.ai)
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Workflow
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
1. Project Setup
|
|
32
|
+
└── Name, author, domain, description
|
|
33
|
+
|
|
34
|
+
2. Canvas Design (drag-and-drop)
|
|
35
|
+
├── Palette (left): Router, Orchestrator, Squad, Agent, ...
|
|
36
|
+
├── Canvas (center): drop nodes, draw connections
|
|
37
|
+
└── Inspector (right): configure selected node
|
|
38
|
+
|
|
39
|
+
3. Generate Architecture (LLM-powered when configured)
|
|
40
|
+
└── AI suggests Orchestrators, Squads, and Agents based on description
|
|
41
|
+
|
|
42
|
+
4. Export Scaffold
|
|
43
|
+
└── Downloads ZIP: config/ + agents/ + squads/ + Python stubs
|
|
44
|
+
OR writes directly to k9_projects/<AppName>/
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## LLM Configuration
|
|
50
|
+
|
|
51
|
+
LLM is **optional but strongly recommended**. Without it the studio works in *demo mode* — templates and manual canvas composition are fully functional, but the **Generate Architecture** button produces a generic fallback instead of an AI-tailored suggestion.
|
|
52
|
+
|
|
53
|
+
### Why configure an LLM?
|
|
54
|
+
|
|
55
|
+
- **Generate Architecture** uses the LLM to suggest Orchestrators, Squads, and Agents suited to your project description
|
|
56
|
+
- **BPMN import** (complex diagrams) uses the LLM to intelligently group flat tasks into meaningful Squads
|
|
57
|
+
|
|
58
|
+
### Recommended approach — run LLM locally
|
|
59
|
+
|
|
60
|
+
Install [Ollama](https://ollama.ai) on your own machine or server and pull a model:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
ollama pull granite3-dense:2b # fast, good JSON output
|
|
64
|
+
# or
|
|
65
|
+
ollama pull llama3.1:8b # higher quality suggestions
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Then point the studio at your Ollama endpoint. Your data never leaves your environment.
|
|
69
|
+
|
|
70
|
+
### Supported providers
|
|
71
|
+
|
|
72
|
+
| Provider | Endpoint example | Notes |
|
|
73
|
+
|---|---|---|
|
|
74
|
+
| **Ollama** | `http://192.168.1.10:11434` | Local / self-hosted. No API key needed. |
|
|
75
|
+
| **OpenAI-compatible** | `https://api.openai.com/v1` | Also works with vLLM, LM Studio, Together AI |
|
|
76
|
+
| **Anthropic** | `https://api.anthropic.com` | Requires Anthropic API key |
|
|
77
|
+
|
|
78
|
+
> **Note:** `localhost` and `127.0.0.1` are intentionally blocked on the hosted instance at studio.k9x.ai to prevent the server's own resources from being used. Always use an IP address or hostname when configuring the endpoint.
|
|
79
|
+
|
|
80
|
+
### Recommended models
|
|
81
|
+
|
|
82
|
+
| Use case | Model |
|
|
83
|
+
|---|---|
|
|
84
|
+
| Local / fast | `granite3-dense:2b`, `mistral:7b` |
|
|
85
|
+
| Local / quality | `llama3.1:8b`, `llama3.2:3b` |
|
|
86
|
+
| OpenAI | `gpt-4o-mini` (best price/quality for JSON tasks) |
|
|
87
|
+
| Anthropic | `claude-haiku-4-5-20251001` (fast), `claude-sonnet-4-6` (quality) |
|
|
88
|
+
|
|
89
|
+
### Configuration methods
|
|
90
|
+
|
|
91
|
+
The studio checks LLM config in this priority order:
|
|
92
|
+
|
|
93
|
+
#### 1. `.env` file — recommended for self-hosted deployments
|
|
94
|
+
|
|
95
|
+
Copy `.env.sample` to `.env` and fill in your values:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
cp .env.sample .env
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
# .env
|
|
103
|
+
LLM_PROVIDER=ollama
|
|
104
|
+
LLM_ENDPOINT=http://192.168.1.10:11434
|
|
105
|
+
LLM_MODEL=granite3-dense:2b
|
|
106
|
+
LLM_API_KEY= # leave blank for Ollama
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
The `.env` file is loaded automatically on startup and is excluded from source control.
|
|
110
|
+
|
|
111
|
+
#### 2. Environment variables (Docker / Podman `-e` flags)
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
podman run -d --name k9x_studio -p 8080:8080 \
|
|
115
|
+
-e LLM_PROVIDER=ollama \
|
|
116
|
+
-e LLM_ENDPOINT=http://192.168.1.10:11434 \
|
|
117
|
+
-e LLM_MODEL=granite3-dense:2b \
|
|
118
|
+
-e K9X_PROJECTS_ROOT="/k9x/projects" \
|
|
119
|
+
-v ~/k9x-studio-working:/k9x/projects:Z \
|
|
120
|
+
ghcr.io/k9aif/k9x-studio:latest
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
#### 3. `config.yaml` (file-based, alternative to `.env`)
|
|
124
|
+
|
|
125
|
+
Edit `config.yaml` in the studio root before starting:
|
|
126
|
+
|
|
127
|
+
```yaml
|
|
128
|
+
llm:
|
|
129
|
+
enabled: true
|
|
130
|
+
provider: ollama
|
|
131
|
+
endpoint: "http://192.168.1.10:11434"
|
|
132
|
+
model: granite3-dense:2b
|
|
133
|
+
api_key: ""
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
#### 4. Browser UI (session-only, transient)
|
|
137
|
+
|
|
138
|
+
Click **⬡ LLM Config** at the bottom of the left panel. Enter endpoint, model, and optional API key. Config is held in your browser session only — it is **not stored** and clears on page refresh. Ideal for one-off use on a shared or public instance.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Running locally
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
cd k9x_studio
|
|
146
|
+
|
|
147
|
+
# 1. Configure your environment (first time only)
|
|
148
|
+
cp .env.sample .env
|
|
149
|
+
# Edit .env — add your LLM endpoint, API keys, and any other external config
|
|
150
|
+
|
|
151
|
+
# 2. Start
|
|
152
|
+
./run.sh # starts backend (port 8080) + frontend dev server (port 5173)
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
`.env` is gitignored and never committed. All secrets stay local to your machine.
|
|
156
|
+
|
|
157
|
+
Or pull and run the container:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
podman pull ghcr.io/k9aif/k9x-studio:latest
|
|
161
|
+
podman run -d --name k9x_studio -p 8080:8080 \
|
|
162
|
+
-e K9X_PROJECTS_ROOT="/k9x/projects" \
|
|
163
|
+
-v ~/k9x-studio-working:/k9x/projects:Z \
|
|
164
|
+
ghcr.io/k9aif/k9x-studio:latest
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Architecture
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
┌──────────┐ ┌────────────────────────────────────────────┐ ┌────────────────┐
|
|
173
|
+
│ │ │ CANVAS │ │ INSPECTOR │
|
|
174
|
+
│ PALETTE │ │ │ │ │
|
|
175
|
+
│ │ │ [Router]────►[Orchestrator] │ │ Node: Agent │
|
|
176
|
+
│ Router │ │ │ │ │ Name: FraudDet │
|
|
177
|
+
│ Orch. │ │ [ClaimsSquad] │ │ Model: reason │
|
|
178
|
+
│ Squad │ │ ┌─────┴──────┐ │ │ Pattern: loop │
|
|
179
|
+
│ Agent │ │ [Triage] [Fraud] [Audit] │ │ Role: ... │
|
|
180
|
+
│ ValLoop │ │ │ │ │
|
|
181
|
+
│ CritAct │ │ │ │ │
|
|
182
|
+
│ Guard │ │ │ │ │
|
|
183
|
+
└──────────┘ └────────────────────────────────────────────┘ └────────────────┘
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## Component Palette → ABB Mapping
|
|
189
|
+
|
|
190
|
+
| Palette Node | K9-AIF ABB | Output |
|
|
191
|
+
|---|---|---|
|
|
192
|
+
| **Router** | `K9EventRouter` | `router/` Python + config |
|
|
193
|
+
| **Orchestrator** | `BaseOrchestrator` | `orchestrators/` Python + config |
|
|
194
|
+
| **Squad** | `BaseSquad` | `squads/yaml/<name>.yaml` |
|
|
195
|
+
| **Agent** | `BaseAgent` | `agents/yaml/<name>.yaml` + `agents/src/<name>.py` |
|
|
196
|
+
| **Validation Loop** | `K9ValidationLoopAgent` | Agent with iterative loop scaffold |
|
|
197
|
+
| **Critic-Actor** | `K9CriticActorAgent` | Agent with actor/critic scaffold |
|
|
198
|
+
| **Guard** | `BaseGovernance` | Governance config entry |
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Tech Stack
|
|
203
|
+
|
|
204
|
+
| Layer | Technology |
|
|
205
|
+
|---|---|
|
|
206
|
+
| Frontend canvas | React + [React Flow](https://reactflow.dev) |
|
|
207
|
+
| Frontend UI | TypeScript + CSS |
|
|
208
|
+
| Backend API | Python FastAPI |
|
|
209
|
+
| Scaffold generation | Jinja2 templates |
|
|
210
|
+
| Export | ZIP download or write to `k9_projects/` |
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## References
|
|
215
|
+
|
|
216
|
+
- K9-AIF Framework: [github.com/k9aif/k9-aif-framework](https://github.com/k9aif/k9-aif-framework)
|
|
217
|
+
- Studio container: `ghcr.io/k9aif/k9x-studio:latest`
|
|
218
|
+
- Live demo: [studio.k9x.ai](https://studio.k9x.ai)
|
|
219
|
+
- Ecosystem: [k9x.ai/ecosystem](https://k9x.ai/ecosystem)
|
|
220
|
+
# studiox
|
k9x-0.1.0/README.md
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
# k9x_studio
|
|
2
|
+
|
|
3
|
+
**Visual Architecture Builder for K9-AIF Systems**
|
|
4
|
+
|
|
5
|
+
k9x_studio is a browser-based drag-and-drop IDE for designing K9-AIF multi-agent systems. It reads the `k9_aif_abb` component library, lets architects compose systems visually on a canvas, and generates production-ready YAML configuration and Python scaffold — the same output as `k9_generator.sh`, but designed rather than typed.
|
|
6
|
+
|
|
7
|
+
Try it live: [studio.k9x.ai](https://studio.k9x.ai)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Workflow
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
1. Project Setup
|
|
15
|
+
└── Name, author, domain, description
|
|
16
|
+
|
|
17
|
+
2. Canvas Design (drag-and-drop)
|
|
18
|
+
├── Palette (left): Router, Orchestrator, Squad, Agent, ...
|
|
19
|
+
├── Canvas (center): drop nodes, draw connections
|
|
20
|
+
└── Inspector (right): configure selected node
|
|
21
|
+
|
|
22
|
+
3. Generate Architecture (LLM-powered when configured)
|
|
23
|
+
└── AI suggests Orchestrators, Squads, and Agents based on description
|
|
24
|
+
|
|
25
|
+
4. Export Scaffold
|
|
26
|
+
└── Downloads ZIP: config/ + agents/ + squads/ + Python stubs
|
|
27
|
+
OR writes directly to k9_projects/<AppName>/
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## LLM Configuration
|
|
33
|
+
|
|
34
|
+
LLM is **optional but strongly recommended**. Without it the studio works in *demo mode* — templates and manual canvas composition are fully functional, but the **Generate Architecture** button produces a generic fallback instead of an AI-tailored suggestion.
|
|
35
|
+
|
|
36
|
+
### Why configure an LLM?
|
|
37
|
+
|
|
38
|
+
- **Generate Architecture** uses the LLM to suggest Orchestrators, Squads, and Agents suited to your project description
|
|
39
|
+
- **BPMN import** (complex diagrams) uses the LLM to intelligently group flat tasks into meaningful Squads
|
|
40
|
+
|
|
41
|
+
### Recommended approach — run LLM locally
|
|
42
|
+
|
|
43
|
+
Install [Ollama](https://ollama.ai) on your own machine or server and pull a model:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
ollama pull granite3-dense:2b # fast, good JSON output
|
|
47
|
+
# or
|
|
48
|
+
ollama pull llama3.1:8b # higher quality suggestions
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Then point the studio at your Ollama endpoint. Your data never leaves your environment.
|
|
52
|
+
|
|
53
|
+
### Supported providers
|
|
54
|
+
|
|
55
|
+
| Provider | Endpoint example | Notes |
|
|
56
|
+
|---|---|---|
|
|
57
|
+
| **Ollama** | `http://192.168.1.10:11434` | Local / self-hosted. No API key needed. |
|
|
58
|
+
| **OpenAI-compatible** | `https://api.openai.com/v1` | Also works with vLLM, LM Studio, Together AI |
|
|
59
|
+
| **Anthropic** | `https://api.anthropic.com` | Requires Anthropic API key |
|
|
60
|
+
|
|
61
|
+
> **Note:** `localhost` and `127.0.0.1` are intentionally blocked on the hosted instance at studio.k9x.ai to prevent the server's own resources from being used. Always use an IP address or hostname when configuring the endpoint.
|
|
62
|
+
|
|
63
|
+
### Recommended models
|
|
64
|
+
|
|
65
|
+
| Use case | Model |
|
|
66
|
+
|---|---|
|
|
67
|
+
| Local / fast | `granite3-dense:2b`, `mistral:7b` |
|
|
68
|
+
| Local / quality | `llama3.1:8b`, `llama3.2:3b` |
|
|
69
|
+
| OpenAI | `gpt-4o-mini` (best price/quality for JSON tasks) |
|
|
70
|
+
| Anthropic | `claude-haiku-4-5-20251001` (fast), `claude-sonnet-4-6` (quality) |
|
|
71
|
+
|
|
72
|
+
### Configuration methods
|
|
73
|
+
|
|
74
|
+
The studio checks LLM config in this priority order:
|
|
75
|
+
|
|
76
|
+
#### 1. `.env` file — recommended for self-hosted deployments
|
|
77
|
+
|
|
78
|
+
Copy `.env.sample` to `.env` and fill in your values:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
cp .env.sample .env
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# .env
|
|
86
|
+
LLM_PROVIDER=ollama
|
|
87
|
+
LLM_ENDPOINT=http://192.168.1.10:11434
|
|
88
|
+
LLM_MODEL=granite3-dense:2b
|
|
89
|
+
LLM_API_KEY= # leave blank for Ollama
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
The `.env` file is loaded automatically on startup and is excluded from source control.
|
|
93
|
+
|
|
94
|
+
#### 2. Environment variables (Docker / Podman `-e` flags)
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
podman run -d --name k9x_studio -p 8080:8080 \
|
|
98
|
+
-e LLM_PROVIDER=ollama \
|
|
99
|
+
-e LLM_ENDPOINT=http://192.168.1.10:11434 \
|
|
100
|
+
-e LLM_MODEL=granite3-dense:2b \
|
|
101
|
+
-e K9X_PROJECTS_ROOT="/k9x/projects" \
|
|
102
|
+
-v ~/k9x-studio-working:/k9x/projects:Z \
|
|
103
|
+
ghcr.io/k9aif/k9x-studio:latest
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
#### 3. `config.yaml` (file-based, alternative to `.env`)
|
|
107
|
+
|
|
108
|
+
Edit `config.yaml` in the studio root before starting:
|
|
109
|
+
|
|
110
|
+
```yaml
|
|
111
|
+
llm:
|
|
112
|
+
enabled: true
|
|
113
|
+
provider: ollama
|
|
114
|
+
endpoint: "http://192.168.1.10:11434"
|
|
115
|
+
model: granite3-dense:2b
|
|
116
|
+
api_key: ""
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
#### 4. Browser UI (session-only, transient)
|
|
120
|
+
|
|
121
|
+
Click **⬡ LLM Config** at the bottom of the left panel. Enter endpoint, model, and optional API key. Config is held in your browser session only — it is **not stored** and clears on page refresh. Ideal for one-off use on a shared or public instance.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Running locally
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
cd k9x_studio
|
|
129
|
+
|
|
130
|
+
# 1. Configure your environment (first time only)
|
|
131
|
+
cp .env.sample .env
|
|
132
|
+
# Edit .env — add your LLM endpoint, API keys, and any other external config
|
|
133
|
+
|
|
134
|
+
# 2. Start
|
|
135
|
+
./run.sh # starts backend (port 8080) + frontend dev server (port 5173)
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
`.env` is gitignored and never committed. All secrets stay local to your machine.
|
|
139
|
+
|
|
140
|
+
Or pull and run the container:
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
podman pull ghcr.io/k9aif/k9x-studio:latest
|
|
144
|
+
podman run -d --name k9x_studio -p 8080:8080 \
|
|
145
|
+
-e K9X_PROJECTS_ROOT="/k9x/projects" \
|
|
146
|
+
-v ~/k9x-studio-working:/k9x/projects:Z \
|
|
147
|
+
ghcr.io/k9aif/k9x-studio:latest
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Architecture
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
┌──────────┐ ┌────────────────────────────────────────────┐ ┌────────────────┐
|
|
156
|
+
│ │ │ CANVAS │ │ INSPECTOR │
|
|
157
|
+
│ PALETTE │ │ │ │ │
|
|
158
|
+
│ │ │ [Router]────►[Orchestrator] │ │ Node: Agent │
|
|
159
|
+
│ Router │ │ │ │ │ Name: FraudDet │
|
|
160
|
+
│ Orch. │ │ [ClaimsSquad] │ │ Model: reason │
|
|
161
|
+
│ Squad │ │ ┌─────┴──────┐ │ │ Pattern: loop │
|
|
162
|
+
│ Agent │ │ [Triage] [Fraud] [Audit] │ │ Role: ... │
|
|
163
|
+
│ ValLoop │ │ │ │ │
|
|
164
|
+
│ CritAct │ │ │ │ │
|
|
165
|
+
│ Guard │ │ │ │ │
|
|
166
|
+
└──────────┘ └────────────────────────────────────────────┘ └────────────────┘
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## Component Palette → ABB Mapping
|
|
172
|
+
|
|
173
|
+
| Palette Node | K9-AIF ABB | Output |
|
|
174
|
+
|---|---|---|
|
|
175
|
+
| **Router** | `K9EventRouter` | `router/` Python + config |
|
|
176
|
+
| **Orchestrator** | `BaseOrchestrator` | `orchestrators/` Python + config |
|
|
177
|
+
| **Squad** | `BaseSquad` | `squads/yaml/<name>.yaml` |
|
|
178
|
+
| **Agent** | `BaseAgent` | `agents/yaml/<name>.yaml` + `agents/src/<name>.py` |
|
|
179
|
+
| **Validation Loop** | `K9ValidationLoopAgent` | Agent with iterative loop scaffold |
|
|
180
|
+
| **Critic-Actor** | `K9CriticActorAgent` | Agent with actor/critic scaffold |
|
|
181
|
+
| **Guard** | `BaseGovernance` | Governance config entry |
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Tech Stack
|
|
186
|
+
|
|
187
|
+
| Layer | Technology |
|
|
188
|
+
|---|---|
|
|
189
|
+
| Frontend canvas | React + [React Flow](https://reactflow.dev) |
|
|
190
|
+
| Frontend UI | TypeScript + CSS |
|
|
191
|
+
| Backend API | Python FastAPI |
|
|
192
|
+
| Scaffold generation | Jinja2 templates |
|
|
193
|
+
| Export | ZIP download or write to `k9_projects/` |
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## References
|
|
198
|
+
|
|
199
|
+
- K9-AIF Framework: [github.com/k9aif/k9-aif-framework](https://github.com/k9aif/k9-aif-framework)
|
|
200
|
+
- Studio container: `ghcr.io/k9aif/k9x-studio:latest`
|
|
201
|
+
- Live demo: [studio.k9x.ai](https://studio.k9x.ai)
|
|
202
|
+
- Ecosystem: [k9x.ai/ecosystem](https://k9x.ai/ecosystem)
|
|
203
|
+
# studiox
|
|
File without changes
|
|
File without changes
|