semanticembed 0.2.0__tar.gz → 0.2.1__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.
- {semanticembed-0.2.0 → semanticembed-0.2.1}/PKG-INFO +1 -3
- {semanticembed-0.2.0 → semanticembed-0.2.1}/docs/api_reference.md +1 -1
- {semanticembed-0.2.0 → semanticembed-0.2.1}/pyproject.toml +1 -2
- semanticembed-0.2.1/skill/SETUP.md +59 -0
- semanticembed-0.2.1/skill/SKILL.md +164 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/src/semanticembed/__init__.py +1 -1
- {semanticembed-0.2.0 → semanticembed-0.2.1}/src/semanticembed/client.py +1 -1
- {semanticembed-0.2.0 → semanticembed-0.2.1}/.claude/skills/analyze/SKILL.md +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/.gitignore +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/LICENSE +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/README.md +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/agent/README.md +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/agent/__init__.py +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/agent/__main__.py +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/agent/agent.py +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/agent/gemini_agent.py +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/dimensions.md +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/docs/dimensions.md +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/docs/getting_started.md +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/docs/input_format.md +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/docs/license_keys.md +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/docs/output_format.md +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/examples/ai_agent_pipeline.json +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/examples/cicd_pipeline.json +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/examples/google_online_boutique.json +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/examples/react/README.md +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/examples/react/RadarChart.tsx +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/examples/react/RiskTable.tsx +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/examples/react/TopologySummary.tsx +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/examples/react/useSemanticEmbed.ts +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/examples/weaveworks_sock_shop.json +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/notebooks/01_quickstart.ipynb +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/notebooks/02_dimensions.ipynb +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/notebooks/03_drift_detection.ipynb +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/notebooks/04_bring_your_own.ipynb +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/notebooks/05_ai_agent_pipelines.ipynb +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/notebooks/06_cicd_pipelines.ipynb +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/notebooks/07_opentelemetry.ipynb +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/notebooks/08_qwen_compression.ipynb +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/notebooks/qwen_compression_cookbook.py +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/skill/analyze.py +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/src/semanticembed/exceptions.py +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/src/semanticembed/explain.py +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/src/semanticembed/extract.py +0 -0
- {semanticembed-0.2.0 → semanticembed-0.2.1}/src/semanticembed/models.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: semanticembed
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: 6D structural intelligence for directed graphs. Six numbers per node. Sub-millisecond.
|
|
5
5
|
Project-URL: Homepage, https://github.com/jmurray10/semanticembed-sdk
|
|
6
6
|
Project-URL: Documentation, https://github.com/jmurray10/semanticembed-sdk
|
|
@@ -32,8 +32,6 @@ Requires-Dist: google-genai; extra == 'all'
|
|
|
32
32
|
Requires-Dist: pyyaml>=6.0; extra == 'all'
|
|
33
33
|
Provides-Extra: extract
|
|
34
34
|
Requires-Dist: pyyaml>=6.0; extra == 'extract'
|
|
35
|
-
Provides-Extra: llm
|
|
36
|
-
Requires-Dist: httpx>=0.24; extra == 'llm'
|
|
37
35
|
Description-Content-Type: text/markdown
|
|
38
36
|
|
|
39
37
|
# SemanticEmbed SDK
|
|
@@ -6,7 +6,7 @@ Complete reference for the `semanticembed` Python SDK.
|
|
|
6
6
|
|
|
7
7
|
## Functions
|
|
8
8
|
|
|
9
|
-
### `encode(edges, *, license_key=None, api_url=None, timeout=
|
|
9
|
+
### `encode(edges, *, license_key=None, api_url=None, timeout=60.0)`
|
|
10
10
|
|
|
11
11
|
Encode a directed graph and return 6D structural coordinates.
|
|
12
12
|
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "semanticembed"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.1"
|
|
8
8
|
description = "6D structural intelligence for directed graphs. Six numbers per node. Sub-millisecond."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = {text = "Proprietary"}
|
|
@@ -30,7 +30,6 @@ dependencies = [
|
|
|
30
30
|
|
|
31
31
|
[project.optional-dependencies]
|
|
32
32
|
extract = ["pyyaml>=6.0"]
|
|
33
|
-
llm = ["httpx>=0.24"]
|
|
34
33
|
agent-claude = ["claude-agent-sdk", "pyyaml>=6.0"]
|
|
35
34
|
agent-gemini = ["google-genai", "pyyaml>=6.0"]
|
|
36
35
|
all = ["pyyaml>=6.0", "claude-agent-sdk", "google-genai"]
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Setup Guide
|
|
2
|
+
|
|
3
|
+
Two dependencies. That's it.
|
|
4
|
+
|
|
5
|
+
## 1. SemanticEmbed SDK
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install semanticembed
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Optional -- set your license key to unlock graphs with more than 50 nodes:
|
|
12
|
+
```bash
|
|
13
|
+
export SEMANTICEMBED_LICENSE_KEY=se-xxxxxxxxxxxxxxxxxxxx
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Add to your shell profile to persist:
|
|
17
|
+
```bash
|
|
18
|
+
echo 'export SEMANTICEMBED_LICENSE_KEY=se-xxxx' >> ~/.zshrc
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## 2. Ollama with Gemma 4
|
|
22
|
+
|
|
23
|
+
Install Ollama: https://ollama.com/download
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
ollama serve
|
|
27
|
+
ollama pull gemma4 # ~16GB, one-time download
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Verify:
|
|
31
|
+
```bash
|
|
32
|
+
ollama list
|
|
33
|
+
# gemma4 ...
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Optional environment variables
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
export SEMBED_OLLAMA_URL=http://localhost:11434 # if Ollama is on another host
|
|
40
|
+
export SEMBED_MODEL=gemma4 # to use a different model
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Verify everything works
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
python3 -c "
|
|
47
|
+
import semanticembed
|
|
48
|
+
result = semanticembed.encode([('a','b'),('b','c')])
|
|
49
|
+
print('SDK OK -- encoding in', result.encoding_time_ms, 'ms')
|
|
50
|
+
"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
curl -s http://localhost:11434/api/tags | python3 -c "
|
|
55
|
+
import sys, json
|
|
56
|
+
models = json.load(sys.stdin).get('models', [])
|
|
57
|
+
print('Ollama OK --', [m['name'] for m in models])
|
|
58
|
+
"
|
|
59
|
+
```
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: semanticembed
|
|
3
|
+
description: >
|
|
4
|
+
Run 6D structural analysis on any directed graph -- microservice architectures,
|
|
5
|
+
AI agent pipelines, CI/CD graphs, data workflows. Use this skill whenever the
|
|
6
|
+
user wants to understand structural risk, find single points of failure,
|
|
7
|
+
detect bottlenecks, analyze vendor concentration, or compare two architecture
|
|
8
|
+
versions. Triggers on: "analyze my pipeline", "find bottlenecks", "which node
|
|
9
|
+
is the SPOF", "structural analysis", "6D encoding", or when the user describes
|
|
10
|
+
a system with nodes and connections and wants to understand fragility. Accepts
|
|
11
|
+
plain English descriptions, source code (LangGraph, CrewAI, Prefect, YAML),
|
|
12
|
+
or OpenTelemetry trace JSON.
|
|
13
|
+
license: Proprietary. See LICENSE.txt for complete terms.
|
|
14
|
+
compatibility: Requires pip install semanticembed and ollama with gemma4 pulled.
|
|
15
|
+
metadata:
|
|
16
|
+
author: SemanticEmbed
|
|
17
|
+
version: "0.1.0"
|
|
18
|
+
patent: "Pending -- Application #63/994,075"
|
|
19
|
+
allowed-tools: Bash(python3:*) Bash(pip:*) Bash(ollama:*)
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# SemanticEmbed 6D Structural Analysis
|
|
23
|
+
|
|
24
|
+
Analyze directed graphs for structural risk using the SemanticEmbed 6D encoding.
|
|
25
|
+
Computes six structural dimensions per node (depth, independence, hierarchy,
|
|
26
|
+
throughput, criticality, fanout) and identifies SPOFs, bottlenecks, and cascade
|
|
27
|
+
amplification risks from topology alone. No runtime telemetry required.
|
|
28
|
+
|
|
29
|
+
Two dependencies only:
|
|
30
|
+
- `semanticembed` Python SDK -- calls Railway for encoding (algorithm server-side)
|
|
31
|
+
- `ollama` with `gemma4` -- handles edge extraction and narrative locally
|
|
32
|
+
|
|
33
|
+
## Step 1: Check dependencies
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
python3 -c "import semanticembed; print('SDK OK')" 2>/dev/null || pip install semanticembed
|
|
37
|
+
python3 -c "import httpx; print('httpx OK')" 2>/dev/null || pip install httpx
|
|
38
|
+
ollama list 2>/dev/null | grep -q gemma4 || ollama pull gemma4
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
If the license key is set, unlimited nodes are available:
|
|
42
|
+
```bash
|
|
43
|
+
echo $SEMANTICEMBED_LICENSE_KEY # should be non-empty for production use
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Step 2: Determine input type
|
|
47
|
+
|
|
48
|
+
| What the user provides | `--type` |
|
|
49
|
+
|------------------------|----------|
|
|
50
|
+
| Plain English description | `text` |
|
|
51
|
+
| Python/YAML/JSON source file | `code` |
|
|
52
|
+
| OpenTelemetry trace JSON | `trace` |
|
|
53
|
+
| Raw edge list | `text` |
|
|
54
|
+
|
|
55
|
+
## Step 3: Run the analysis
|
|
56
|
+
|
|
57
|
+
The script is at `scripts/analyze.py` relative to this skill file.
|
|
58
|
+
Always use the absolute path resolved from this skill's location.
|
|
59
|
+
|
|
60
|
+
**Text description:**
|
|
61
|
+
```bash
|
|
62
|
+
python3 {SKILL_DIR}/scripts/analyze.py \
|
|
63
|
+
--input "supervisor calls planner-agent and research-agent. Both call openai-gpt4." \
|
|
64
|
+
--type text
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**Code file:**
|
|
68
|
+
```bash
|
|
69
|
+
python3 {SKILL_DIR}/scripts/analyze.py \
|
|
70
|
+
--input /path/to/pipeline.py \
|
|
71
|
+
--type code
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**OTel trace:**
|
|
75
|
+
```bash
|
|
76
|
+
python3 {SKILL_DIR}/scripts/analyze.py \
|
|
77
|
+
--input /path/to/trace.json \
|
|
78
|
+
--type trace
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**JSON output (for programmatic use):**
|
|
82
|
+
```bash
|
|
83
|
+
python3 {SKILL_DIR}/scripts/analyze.py \
|
|
84
|
+
--input "..." --type text --json
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Fast mode (no narrative):**
|
|
88
|
+
```bash
|
|
89
|
+
python3 {SKILL_DIR}/scripts/analyze.py \
|
|
90
|
+
--input "..." --type text --no-narrative
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Edge extraction only (preview before encoding):**
|
|
94
|
+
```bash
|
|
95
|
+
python3 {SKILL_DIR}/scripts/analyze.py \
|
|
96
|
+
--input "..." --type text --edges-only
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Drift detection (before vs after):**
|
|
100
|
+
```bash
|
|
101
|
+
python3 {SKILL_DIR}/scripts/analyze.py \
|
|
102
|
+
--type text \
|
|
103
|
+
--before "original architecture description" \
|
|
104
|
+
--after "updated architecture description"
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Step 4: Present results to the user
|
|
108
|
+
|
|
109
|
+
Always show:
|
|
110
|
+
1. The extracted edge list -- let the user confirm the graph was parsed correctly
|
|
111
|
+
2. Risk flags grouped by severity
|
|
112
|
+
3. The 6D table sorted by criticality
|
|
113
|
+
4. The narrative report
|
|
114
|
+
|
|
115
|
+
**Risk severity markers in output:**
|
|
116
|
+
- `!!!` = critical (SPOF, criticality > 0.08)
|
|
117
|
+
- `!! ` = high (bottleneck, amplifier, concentration)
|
|
118
|
+
- `! ` = medium (deep dependency)
|
|
119
|
+
|
|
120
|
+
**What each flag means:**
|
|
121
|
+
|
|
122
|
+
| Flag | Meaning | Action |
|
|
123
|
+
|------|---------|--------|
|
|
124
|
+
| SPOF | One node on most paths -- single point of failure | Add fallback / redundant path |
|
|
125
|
+
| BOTTLENECK | Throughput concentrated here | Split into parallel workers |
|
|
126
|
+
| AMPLIFIER | Failure fans to many downstream nodes | Add circuit breaker upstream |
|
|
127
|
+
| CONCENTRATION | Zero lateral redundancy | Add alternative path |
|
|
128
|
+
| DEEP | Late-stage, hard to recover from | Add health check / timeout |
|
|
129
|
+
|
|
130
|
+
## Step 5: Suggest fixes
|
|
131
|
+
|
|
132
|
+
After presenting risks, always offer concrete next steps. Example:
|
|
133
|
+
|
|
134
|
+
> "The `openai_gpt4` node has criticality=0.44, meaning it sits on 44% of all
|
|
135
|
+
> paths through this pipeline. Adding a fallback to a second provider (e.g.
|
|
136
|
+
> `anthropic_claude`) would reduce its criticality score. Want me to show you
|
|
137
|
+
> what that would look like structurally?"
|
|
138
|
+
|
|
139
|
+
Then offer to re-run with the proposed change to show the drift.
|
|
140
|
+
|
|
141
|
+
## Environment variables
|
|
142
|
+
|
|
143
|
+
| Variable | Default | Purpose |
|
|
144
|
+
|----------|---------|---------|
|
|
145
|
+
| `SEMBED_OLLAMA_URL` | `http://localhost:11434` | Ollama instance URL |
|
|
146
|
+
| `SEMBED_MODEL` | `gemma4` | Model name |
|
|
147
|
+
| `SEMANTICEMBED_LICENSE_KEY` | (none) | Unlocks >50 nodes |
|
|
148
|
+
|
|
149
|
+
## Example interactions
|
|
150
|
+
|
|
151
|
+
**"Analyze my LangGraph pipeline"**
|
|
152
|
+
→ Ask for the file path, run with `--type code`
|
|
153
|
+
|
|
154
|
+
**"Which service is my biggest SPOF?"**
|
|
155
|
+
→ Ask for edge list or description, run with `--type text`, highlight highest criticality node
|
|
156
|
+
|
|
157
|
+
**"I added a fallback -- did it help?"**
|
|
158
|
+
→ Get before/after descriptions, run with `--before` and `--after` flags, show drift
|
|
159
|
+
|
|
160
|
+
**"6D encode this: A->B, B->C, A->C"**
|
|
161
|
+
→ Run with `--type text --no-narrative` for fast vector output
|
|
162
|
+
|
|
163
|
+
See [references/DRIFT.md](references/DRIFT.md) for detailed drift analysis guidance.
|
|
164
|
+
See [references/SETUP.md](references/SETUP.md) if dependencies are missing.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|