@ltm-blueverse/alpha-semantic-hub 0.7.1 → 0.7.3
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.
- package/README.md +179 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
21
|
+
> **Install guide:** see [INSTALL.md](INSTALL.md) for step-by-step install instructions for every platform.
|
|
22
|
+
|
|
21
23
|
Alpha Semantic Hub is a graph-native context platform rebuilt end-to-end under the
|
|
22
24
|
**LTM Blueverse** identity: red brand system, futuristic "Alpha" logo (a red **A**
|
|
23
25
|
inside a red circle), a redesigned futuristic Studio UI/UX, scoped npm packages,
|
|
@@ -44,13 +46,13 @@ The Python distribution (`alphasemantichub`; CLI: `alphasemantichub`,
|
|
|
44
46
|
|
|
45
47
|
```bash
|
|
46
48
|
# latest release wheel
|
|
47
|
-
pip install https://github.com/DeejayAI/alpha-semantic-hub/releases/latest/download/alphasemantichub-0.7.
|
|
49
|
+
pip install https://github.com/DeejayAI/alpha-semantic-hub/releases/latest/download/alphasemantichub-0.7.1-py3-none-any.whl
|
|
48
50
|
|
|
49
51
|
# or from a specific release tag
|
|
50
|
-
pip install https://github.com/DeejayAI/alpha-semantic-hub/releases/download/v0.7.
|
|
52
|
+
pip install https://github.com/DeejayAI/alpha-semantic-hub/releases/download/v0.7.1/alphasemantichub-0.7.1-py3-none-any.whl
|
|
51
53
|
|
|
52
54
|
# with optional extras
|
|
53
|
-
pip install "https://github.com/DeejayAI/alpha-semantic-hub/releases/latest/download/alphasemantichub-0.7.
|
|
55
|
+
pip install "https://github.com/DeejayAI/alpha-semantic-hub/releases/latest/download/alphasemantichub-0.7.1-py3-none-any.whl[explorer]"
|
|
54
56
|
```
|
|
55
57
|
|
|
56
58
|
Verify:
|
|
@@ -105,7 +107,7 @@ Environment variables (all prefixed `ASHUB_`):
|
|
|
105
107
|
|---|---|
|
|
106
108
|
| `ASHUB_API_KEY` | API key for protected Studio routes (generate: `openssl rand -hex 32`) |
|
|
107
109
|
| `ASHUB_ALLOW_ANONYMOUS` | `true` bypasses the API key (local-only setups) |
|
|
108
|
-
| `ASHUB_KG_PATH` |
|
|
110
|
+
| `ASHUB_KG_PATH` | Graph persistence file — auto-loaded at startup, auto-saved on every import (set to `/data/graph.json` in the compose stack) |
|
|
109
111
|
| `ASHUB_LOG_LEVEL` | Logging verbosity |
|
|
110
112
|
| `ASHUB_CORS_ORIGINS` | Allowed CORS origins |
|
|
111
113
|
|
|
@@ -117,6 +119,25 @@ The repo ships ready-to-install plugins under `plugins/`. Install the npm metapa
|
|
|
117
119
|
(`npm install @ltm-blueverse/alpha-semantic-hub`) or point your tool at the checked-out
|
|
118
120
|
`plugins/` directory.
|
|
119
121
|
|
|
122
|
+
### How the harness integration works
|
|
123
|
+
|
|
124
|
+
Every integration follows the same shape:
|
|
125
|
+
|
|
126
|
+
1. The harness (Claude Code, Copilot, Codex, …) launches the **MCP server as a
|
|
127
|
+
child process** (`python -m alphasemantichub.mcp_server`, stdio transport)
|
|
128
|
+
2. The plugin manifest tells the harness which **skills** (markdown playbooks in
|
|
129
|
+
`plugins/skills/`) and **agents** (persona definitions in `plugins/agents/`)
|
|
130
|
+
to load alongside its native tools
|
|
131
|
+
3. The agent can then call knowledge-graph tools (`extract_entities`,
|
|
132
|
+
`record_decision`, `find_precedents`, `query_graph`, …) directly from its
|
|
133
|
+
chat/tool loop — reading from and writing to the same graph the Studio shows
|
|
134
|
+
4. Optional **hooks** (`plugins/hooks/hooks.json`) run small guards on
|
|
135
|
+
Write/Edit/Bash events (e.g. Python syntax checks on graph files)
|
|
136
|
+
|
|
137
|
+
Because the transport is stdio JSON-RPC, there is no server to manage: install
|
|
138
|
+
the Python package in the interpreter the harness uses, register the command,
|
|
139
|
+
and the tools appear.
|
|
140
|
+
|
|
120
141
|
### Claude (Claude Code / Claude Desktop)
|
|
121
142
|
|
|
122
143
|
```bash
|
|
@@ -173,12 +194,13 @@ Each has a ready manifest: `plugins/.windsurf-plugin`, `plugins/.cline-plugin`,
|
|
|
173
194
|
|
|
174
195
|
---
|
|
175
196
|
|
|
176
|
-
## 5 · The Studio UI
|
|
197
|
+
## 5 · The Studio UI
|
|
177
198
|
|
|
178
|
-
The bundled Knowledge Explorer
|
|
199
|
+
The bundled Knowledge Explorer ships in the Alpha red brand system with a light,
|
|
200
|
+
readable theme:
|
|
179
201
|
|
|
180
|
-
- **
|
|
181
|
-
-
|
|
202
|
+
- **White background with near-black text** and light red highlights/captions
|
|
203
|
+
- **Alpha red** accent system (`#E11D2E` → `#FF4B55` gradients), sharp futuristic geometry
|
|
182
204
|
- Red **A-in-circle** brand mark in the navigation rail, favicon and app icons
|
|
183
205
|
- All workspaces (Graph, Analyze, Decisions, Enrich, Manage, Ontology Hub) restyled
|
|
184
206
|
|
|
@@ -188,17 +210,159 @@ Serve it three ways:
|
|
|
188
210
|
2. **Docker:** `docker compose up -d` → http://localhost:8000
|
|
189
211
|
3. **Static:** grab `@ltm-blueverse/alpha-hub-studio` from npm and serve `static/`
|
|
190
212
|
|
|
191
|
-
## 6 · MCP server
|
|
213
|
+
## 6 · How the MCP server works
|
|
214
|
+
|
|
215
|
+
Alpha Semantic Hub exposes its knowledge graph to AI agents over the
|
|
216
|
+
**Model Context Protocol (MCP)**. The server speaks JSON-RPC 2.0 over **stdio** —
|
|
217
|
+
an agent harness launches it as a child process and exchanges newline-delimited
|
|
218
|
+
JSON-RPC messages (`initialize`, `tools/list`, `tools/call`, `resources/list`,
|
|
219
|
+
`resources/read`). No network port is opened, so it works identically in Claude
|
|
220
|
+
Code, VS Code, Codex, Cursor, or any MCP-capable client.
|
|
221
|
+
|
|
222
|
+
Two builds are included:
|
|
223
|
+
|
|
224
|
+
| Server | Launch | Tools |
|
|
225
|
+
|---|---|---|
|
|
226
|
+
| **Installed server** (`alphasemantichub.mcp_server`) | `alphasemantichub-mcp` or `python -m alphasemantichub.mcp_server` | 16 tools |
|
|
227
|
+
| **Extended in-repo server** (`alphasemantichub_mcp.mcp`) | `python -m alphasemantichub_mcp.mcp` | 22 tools (adds retrieval, provenance, impact analysis) |
|
|
228
|
+
|
|
229
|
+
What the tools cover:
|
|
230
|
+
|
|
231
|
+
- **Extraction** — `extract_entities` (NER over text), `extract_relations`
|
|
232
|
+
(relations + subject-predicate-object triplets)
|
|
233
|
+
- **Decision intelligence** — `record_decision`, `query_decisions`,
|
|
234
|
+
`find_precedents` (similarity search over past decisions), `get_causal_chain`
|
|
235
|
+
(trace what a decision influenced, upstream or downstream), `link_decisions`
|
|
236
|
+
(typed causal edges: CAUSED / INFLUENCED / PRECEDENT_FOR), `analyze_decision_impact`
|
|
237
|
+
- **Graph** — `add_entity`, `add_relationship`, `query_graph` (node lookup,
|
|
238
|
+
1–5-hop neighborhoods, keyword search), `get_graph_analytics` (PageRank,
|
|
239
|
+
community detection), `get_graph_summary`
|
|
240
|
+
- **Reasoning** — `run_reasoning` (forward-chaining IF/THEN rules over facts),
|
|
241
|
+
`abductive_reasoning` (hypotheses that explain observed facts)
|
|
242
|
+
- **Persistence & I/O** — `export_graph` (Turtle, JSON-LD, RDF/XML, GraphML,
|
|
243
|
+
CSV, Parquet, N-Triples), `update_node`, `delete_node` (soft archive)
|
|
244
|
+
- **Retrieval (extended server)** — `store_document` (chunk + embed),
|
|
245
|
+
`retrieve_context` (semantic search + related graph relationships)
|
|
246
|
+
|
|
247
|
+
State: point `ASHUB_KG_PATH` at a graph file and every mutation (decisions,
|
|
248
|
+
entities, relationships) is persisted and reloaded across sessions — the graph
|
|
249
|
+
your agent edits is the graph the Studio renders.
|
|
250
|
+
|
|
251
|
+
## 7 · How the ontology is built
|
|
252
|
+
|
|
253
|
+
Ontologies are produced by `OntologyEngine`, which composes a six-stage
|
|
254
|
+
generator pipeline:
|
|
255
|
+
|
|
256
|
+
1. **Parse** — normalize `{"entities": [...], "relationships": [...]}` produced
|
|
257
|
+
by the semantic-extraction pipeline (`NERExtractor`, `RelationExtractor`,
|
|
258
|
+
`TripletExtractor`)
|
|
259
|
+
2. **Define** — map concepts to candidate class definitions
|
|
260
|
+
3. **Type & property inference** — `PropertyGenerator.infer_properties` stamps
|
|
261
|
+
classes/properties with URIs from `NamespaceManager`
|
|
262
|
+
(base namespace `https://alphahub.ltmb.io/ontology/`)
|
|
263
|
+
4. **Hierarchy** — `ClassInferrer.build_class_hierarchy` assembles the class
|
|
264
|
+
tree (frequency-gated: concepts need `min_occurrences=2` to survive)
|
|
265
|
+
5. **Serialize** — `OWLGenerator` emits Turtle / RDF-XML / JSON-LD / N3
|
|
266
|
+
6. **Validate** — `OntologyValidator` checks consistency and satisfiability;
|
|
267
|
+
results land in `ontology["validation"]`
|
|
268
|
+
|
|
269
|
+
Then:
|
|
270
|
+
|
|
271
|
+
- **SHACL shapes** are derived with `OntologyEngine.to_shacl(...)` (quality
|
|
272
|
+
tiers basic/standard/strict) and enforced at runtime with
|
|
273
|
+
`validate_graph(...)` (pyshacl) — reports come back as plain-English
|
|
274
|
+
violations
|
|
275
|
+
- **Quality gate** — `quality_check(...)` returns a graded report of issues
|
|
276
|
+
- **Versioning** — `VersionManager.create_version` gives each ontology a
|
|
277
|
+
versioned IRI, and `compare_versions` / `diff_ontologies` produce change
|
|
278
|
+
reports between versions
|
|
279
|
+
- **LLM-assisted drafting** — `OntologyEngine.from_text(...)` drafts an ontology
|
|
280
|
+
from unstructured text; the result goes through the same validation and
|
|
281
|
+
versioning
|
|
282
|
+
|
|
283
|
+
Resulting dict shape:
|
|
284
|
+
|
|
285
|
+
```python
|
|
286
|
+
{
|
|
287
|
+
"uri": "https://alphahub.ltmb.io/ontology/v1.0/",
|
|
288
|
+
"name": "...", "version": "1.0",
|
|
289
|
+
"classes": [{"name", "uri", "label", "comment", "properties", "entity_count"}],
|
|
290
|
+
"properties": [...],
|
|
291
|
+
"validation": {"valid": true, "consistent": true, "satisfiable": true, ...}
|
|
292
|
+
}
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
## 8 · Connecting source systems
|
|
296
|
+
|
|
297
|
+
The `ingest` layer feeds the ontology and knowledge graph from external systems.
|
|
298
|
+
Every connector is lazy-loaded and degrades to a helpful install hint when its
|
|
299
|
+
SDK is missing. Two patterns:
|
|
300
|
+
|
|
301
|
+
- a **Connector** (auth + transport) paired with an **Ingestor** (extraction +
|
|
302
|
+
`export_as_documents`)
|
|
303
|
+
- a unified dispatcher: `ingest(sources, source_type="db", method=...)`
|
|
304
|
+
|
|
305
|
+
| Source system | Ingestor | Connection | Primary call |
|
|
306
|
+
|---|---|---|---|
|
|
307
|
+
| **Databricks** | `DatabricksIngestor` | `host`, `token`, `http_path`, `catalog`, `schema` (env: `DATABRICKS_HOST`, `DATABRICKS_TOKEN`, `DATABRICKS_HTTP_PATH`) | `ingest_table("silver_customers")`, `ingest_query("SELECT ...")` |
|
|
308
|
+
| **SAP** (OData) | `SAPIngestor` | `base_url`, `auth="oauth2"|"basic"`, `token_url`, `client_id`, `client_secret` | `discover_service()`, `ingest_entity_set(service, entity_set, top=1000)` |
|
|
309
|
+
| **Snowflake** | `SnowflakeIngestor` | `account`, `user`, `password`/`private_key`, `warehouse`, `database`, `schema`, `role` | `ingest_table(...)`, `ingest_query(...)` |
|
|
310
|
+
| **Salesforce** | `SalesforceIngestor` | `username`, `password`, `security_token` (env: `SALESFORCE_USERNAME`, …) | `ingest_sobject("Account", fields=[...])`, `ingest_query(soql)` |
|
|
311
|
+
| **ServiceNow** | `ServiceNowIngestor` | `instance_url`, `auth`, `username`/`client_id` + secret | `ingest_table(table="incident", query=..., limit=...)` |
|
|
312
|
+
| **Power BI** | `PowerBIIngestor` | `tenant_id`, `client_id`, `client_secret`, `workspace_id` | `ingest_workspace_metadata()` |
|
|
313
|
+
| **Tableau** | `TableauIngestor` | `server_url`, `site_name`, `token_name`, `token_value` | `ingest_workbooks()`, `ingest_datasources()` |
|
|
314
|
+
| **Looker** | `LookerIngestor` | `base_url`, `client_id`, `client_secret` (or `looker.ini`) | `ingest_looks()`, `ingest_dashboards()`, `ingest_lookml_models()` |
|
|
315
|
+
| **BigQuery** | `BigQueryIngestor` | `project`, `dataset`, `credentials_file` | `ingest_table(...)`, `ingest_query(...)` |
|
|
316
|
+
| **Web / intranet** | `WebIngestor` | `user_agent`, `respect_robots=True` | `ingest_url(url)`, `crawl_sitemap(...)`, `crawl_domain(...)` |
|
|
317
|
+
| **Files & cloud storage** | `FileIngestor`, `CloudStorageIngestor` | provider config for S3 / GCS / Azure Blob | `ingest_file`, `ingest_directory`, `ingest_cloud` |
|
|
318
|
+
| **Git repositories** | `RepoIngestor` | repo URL | `ingest_repository(url)` + commit/code analysis |
|
|
319
|
+
| **REST APIs** | `RESTIngestor` | `config={"headers": {...}}` | `ingest_endpoint(...)`, `paginated_fetch(...)` |
|
|
320
|
+
| **Other MCP servers** | `MCPIngestor` | `connect(server_name, url=...)` | `ingest_resources(...)`, `ingest_tool_output(...)` |
|
|
321
|
+
|
|
322
|
+
Also available: Redshift, Cassandra, MongoDB, DuckDB, Elasticsearch, Kafka-style
|
|
323
|
+
streams, email, RSS/Atom feeds, Airflow, Parquet/Arrow.
|
|
324
|
+
|
|
325
|
+
### Running ingestion (Python workflow)
|
|
326
|
+
|
|
327
|
+
Source ingestion is a **Python-library workflow** — the Studio UI imports graph
|
|
328
|
+
files (JSON/CSV), it does not call source systems directly. The bridge is
|
|
329
|
+
`examples/ingest_to_studio.py`:
|
|
192
330
|
|
|
193
331
|
```bash
|
|
194
|
-
|
|
195
|
-
|
|
332
|
+
# any text/document file — no credentials needed:
|
|
333
|
+
uv run python examples/ingest_to_studio.py ./doc.txt --kind file --import
|
|
334
|
+
|
|
335
|
+
# source systems (credentials via env vars, e.g. DATABRICKS_HOST/TOKEN/HTTP_PATH):
|
|
336
|
+
uv run python examples/ingest_to_studio.py silver_customers --kind databricks --import
|
|
337
|
+
uv run python examples/ingest_to_studio.py SalesOrder --kind sap --import
|
|
338
|
+
uv run python examples/ingest_to_studio.py CUSTOMERS --kind snowflake --import
|
|
339
|
+
uv run python examples/ingest_to_studio.py Account --kind salesforce --import
|
|
340
|
+
uv run python examples/ingest_to_studio.py https://api.example.com/items --kind rest --import
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
What it does: ingest → `export_as_documents` → extract entities + triplets
|
|
344
|
+
(NER/pattern) → build a `ContextGraph` → save JSON → `--import` POSTs it to the
|
|
345
|
+
running Studio (multipart `/api/import`), where it appears in the Graph view.
|
|
346
|
+
|
|
347
|
+
### A note on SharePoint
|
|
348
|
+
|
|
349
|
+
There is no dedicated SharePoint connector in this repository. The recommended
|
|
350
|
+
path today is **Microsoft Graph via `RESTIngestor`**:
|
|
351
|
+
|
|
352
|
+
```python
|
|
353
|
+
from alphasemantichub.ingest import RESTIngestor
|
|
354
|
+
|
|
355
|
+
ing = RESTIngestor(config={"headers": {"Authorization": f"Bearer {token}"}})
|
|
356
|
+
for page in ing.paginated_fetch("https://graph.microsoft.com/v1.0/sites/{site-id}/drive/root/children"):
|
|
357
|
+
...
|
|
196
358
|
```
|
|
197
359
|
|
|
198
|
-
|
|
199
|
-
|
|
360
|
+
…or `WebIngestor.ingest_url(...)` for pages, or `CloudStorageIngestor` /
|
|
361
|
+
`FileIngestor` for documents synced out of SharePoint document libraries. A
|
|
362
|
+
dedicated connector can be added by registering a new method in
|
|
363
|
+
`ingest/methods.py`.
|
|
200
364
|
|
|
201
|
-
##
|
|
365
|
+
## 9 · Development
|
|
202
366
|
|
|
203
367
|
```bash
|
|
204
368
|
git clone https://github.com/DeejayAI/alpha-semantic-hub.git
|
|
@@ -230,7 +394,7 @@ All environment variables use the **`ASHUB_`** prefix:
|
|
|
230
394
|
`ASHUB_DISABLE_PROGRESS`, `ASHUB_LOG_LEVEL`, and more — grep the source for
|
|
231
395
|
`ASHUB_` to see the full list.
|
|
232
396
|
|
|
233
|
-
##
|
|
397
|
+
## 10 · Identity summary
|
|
234
398
|
|
|
235
399
|
| Token | Value |
|
|
236
400
|
|---|---|
|
package/package.json
CHANGED