graphjin 3.18.34 → 3.18.35
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 +65 -42
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# GraphJin -
|
|
1
|
+
# GraphJin - The Governed Data Plane for AI Agents
|
|
2
2
|
|
|
3
3
|
[](https://github.com/dosco/graphjin/blob/master/LICENSE)
|
|
4
4
|
[](https://www.npmjs.com/package/graphjin)
|
|
@@ -7,9 +7,18 @@
|
|
|
7
7
|
[](https://pkg.go.dev/github.com/dosco/graphjin/core/v3)
|
|
8
8
|
[](https://goreportcard.com/report/github.com/dosco/graphjin/core/v3)
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
GraphJin is a compiler and runtime that lets AI agents connect to the systems a real company already has: databases, warehouses, files, source code, workflows, metadata, and security policy. Instead of handing an agent raw credentials and hoping it guesses correctly, GraphJin gives it one governed GraphQL + MCP surface where it can discover before acting, validate queries, run approved work, and observe runtime status.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
It is not only for agents. GraphJin is still a high-performance GraphQL-to-database compiler, Go library, standalone API service, REST/OpenAPI gateway, and real-time subscription server. The agent use case is where everything comes together: the same compiler that serves your apps can also give AI a smart, auditable way to work across data, code, and operations.
|
|
13
|
+
|
|
14
|
+
Works with PostgreSQL, MySQL, MongoDB, SQLite, Oracle, MSSQL, Snowflake, Redshift, BigQuery, Apache Cassandra / Amazon Keyspaces, S3/GCS/local files, CodeSQL source indexes - and models from Claude/GPT-4 to local 7B models.
|
|
15
|
+
|
|
16
|
+
## Why GraphJin For Agents
|
|
17
|
+
|
|
18
|
+
- **One governed surface for many systems** - Query operational databases, warehouses, MongoDB, object stores, local files, CodeSQL source indexes, workflows, and GraphJin system roots through GraphQL and MCP.
|
|
19
|
+
- **Smart discovery before action** - Agents start with `query_catalog(search: "<user instruction>")`, `graphql_help`, relationship evidence, examples, config recipes, and safety notes before writing or running queries.
|
|
20
|
+
- **Guarded action, not raw access** - Source-mode access, query allow-lists, read-only boundaries, policy-aware MCP tools, local encrypted secrets, and `gj_config` preview/apply keep changes auditable.
|
|
21
|
+
- **Operational awareness** - `gj_security`, `gj_runtime`, and the built-in console expose policy and bounded runtime status so agents can check what is safe before they act.
|
|
13
22
|
|
|
14
23
|
## Installation
|
|
15
24
|
|
|
@@ -40,8 +49,9 @@ docker pull dosco/graphjin
|
|
|
40
49
|
|
|
41
50
|
## Try It Now
|
|
42
51
|
|
|
43
|
-
This is a quick way to try out GraphJin
|
|
44
|
-
|
|
52
|
+
This is a quick way to try out GraphJin. The `--demo` flag runs a curated local
|
|
53
|
+
demo, creates local state under the example's `demo/` folder, and reuses that
|
|
54
|
+
state on later starts. Delete `demo/` to reset from scratch.
|
|
45
55
|
|
|
46
56
|
Download the source which contains the `webshop` demo
|
|
47
57
|
```
|
|
@@ -54,6 +64,14 @@ Now launch the Graphjin service that you installed using the install options abo
|
|
|
54
64
|
graphjin serve --demo --path examples/webshop
|
|
55
65
|
```
|
|
56
66
|
|
|
67
|
+
For a larger agent-driven example with Postgres operations data, a BigQuery
|
|
68
|
+
simulator for roast telemetry, CodeSQL over internal business code, and
|
|
69
|
+
executable workflows:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
graphjin serve --demo --path examples/coffee-roastery
|
|
73
|
+
```
|
|
74
|
+
|
|
57
75
|
You'll see output like this:
|
|
58
76
|
```
|
|
59
77
|
GraphJin started
|
|
@@ -324,7 +342,7 @@ mutation {
|
|
|
324
342
|
|
|
325
343
|
## Real-time Subscriptions
|
|
326
344
|
|
|
327
|
-
Get live updates when your data changes. GraphJin handles thousands of concurrent subscribers with a single database query - not one per subscriber.
|
|
345
|
+
Get live updates when your data changes. For databases with batching support, GraphJin handles thousands of concurrent subscribers with a single database query - not one per subscriber.
|
|
328
346
|
|
|
329
347
|
```graphql
|
|
330
348
|
subscription {
|
|
@@ -341,6 +359,8 @@ subscription {
|
|
|
341
359
|
- Automatic change detection - updates only sent when data actually changes
|
|
342
360
|
- Built-in cursor pagination for feeds and infinite scroll
|
|
343
361
|
|
|
362
|
+
Dialects that do not implement GraphJin's batched polling path are listed as unsupported in the database support matrix.
|
|
363
|
+
|
|
344
364
|
Subscribe over **WebSockets** (`graphql-ws` / `graphql-transport-ws` subprotocols) or **Server-Sent Events** — set `Accept: text/event-stream` on a `POST /api/v1/graphql` request and GraphJin streams `event: next` frames for each result, terminated by `event: complete`. Works from Node.js, Go, or any browser `EventSource` / WebSocket client.
|
|
345
365
|
|
|
346
366
|
## Filesystem Tables (Local, S3, GCS)
|
|
@@ -461,44 +481,47 @@ federation:
|
|
|
461
481
|
| `/api/v1/mcp/message` | `POST` | MCP HTTP transport for stateless message integrations. |
|
|
462
482
|
| `/api/v1/discovery` | `GET` | Legacy discovery document. In source mode it is registered only when `mcp.legacy_discovery: true`; use catalog GraphQL roots otherwise. |
|
|
463
483
|
| `/api/v1/discovery/<section>` | `GET` | Legacy discovery drill-down (e.g. `tables`, `insights`), gated the same way as `/api/v1/discovery`. |
|
|
464
|
-
| `/api/v1/admin/tables` | `GET` | Admin: list known tables (Web UI). |
|
|
465
|
-
| `/api/v1/admin/tables/<name>` | `GET` | Admin: schema for a single table. |
|
|
466
|
-
| `/api/v1/admin/queries` | `GET` | Admin: list saved queries. |
|
|
467
|
-
| `/api/v1/admin/queries/<name>` | `GET` | Admin: details for a saved query. |
|
|
468
|
-
| `/api/v1/admin/fragments` | `GET` | Admin: list GraphQL fragments. |
|
|
469
|
-
| `/api/v1/admin/config` | `GET` | Admin: effective runtime config. |
|
|
470
|
-
| `/api/v1/admin/database` / `/api/v1/admin/databases` | `GET` | Admin: connected database info. |
|
|
471
484
|
| `/api/v1/auth/device` | `POST` | OIDC device-flow start (only if `auth_login.enabled`). |
|
|
472
485
|
| `/api/v1/auth/device/token` | `POST` | OIDC device-flow poll. |
|
|
473
486
|
| `/api/v1/auth/login` | `GET` | OIDC login redirect. |
|
|
474
487
|
| `/api/v1/auth/callback` | `GET` | OIDC callback. |
|
|
475
488
|
| `/health` | `GET` | Liveness probe. **No auth.** |
|
|
476
|
-
| `/` | `GET` | Built-in Web UI
|
|
489
|
+
| `/` | `GET` | Built-in Web UI. Defaults on in `dev` and `agentic` modes, off in `prod`; set `web_ui` explicitly to override. The UI uses `/api/v1/graphql` and GraphJin system roots such as `gj_catalog`, `gj_security`, `gj_runtime`, `gj_code`, and `gj_config`; there is no separate admin REST API. |
|
|
477
490
|
|
|
478
491
|
**Mode flags that change which routes are live:**
|
|
479
492
|
- `mcp.disable: true` — removes `/api/v1/mcp` and `/api/v1/mcp/message`.
|
|
480
493
|
- `mcp.only: true` — keeps only `/health` and `/api/v1/mcp*`. Legacy `/api/v1/workflows/*` and `/api/v1/discovery*` remain only when `mcp.legacy_discovery: true`.
|
|
481
494
|
- Source mode (`sources:` present) disables legacy `/api/v1/workflows/*` and `/api/v1/discovery*` unless `mcp.legacy_discovery: true`.
|
|
482
|
-
- `
|
|
495
|
+
- `web_ui: false` — drops `/` even in dev or agentic mode.
|
|
483
496
|
|
|
484
497
|
## MCP Tools
|
|
485
498
|
|
|
486
|
-
GraphJin exposes a catalog-first
|
|
499
|
+
GraphJin exposes a catalog-first MCP surface that guides AI models to discover before acting. The surface is caller-aware: `tools/list`, `graphql_help`, and `query_catalog` reflect the caller's visible tools, `gj_*` roots, catalog capabilities, and blocked/admin-only actions.
|
|
500
|
+
|
|
501
|
+
- Start goal-driven work with `query_catalog(search: "<user instruction>")` when it is listed.
|
|
502
|
+
- Inspect the best row with `query_catalog(id: "...")` before writing queries, choosing relationships, or using GraphJin-specific syntax.
|
|
503
|
+
- Use `config_recipe` rows for operator work; they spell out preflight, preview/apply, unsupported apply, verification, stop conditions, and forbidden patterns.
|
|
504
|
+
- Act through governed GraphQL roots such as `gj_workflow_execution(insert)`, `gj_workflow(insert/update/delete)`, and `gj_config(id: "current", update: ...)` only when policy exposes them.
|
|
505
|
+
- In source mode, `gj_config` writes must run `mode: "preview"` with `expected_catalog_revision`, then resend the exact same payload with `mode: "apply"` and `preview_id`.
|
|
506
|
+
- Source access and GraphJin root changes should use `source_patches` by exact source name instead of rewriting the full `sources` array.
|
|
507
|
+
- Legacy discovery tools are migration shims and are disabled unless `mcp.legacy_discovery: true`.
|
|
508
|
+
|
|
509
|
+
Schema reloads, schema changes, where-clause validation, and query repair remain MCP action tools.
|
|
487
510
|
|
|
488
511
|
For teams building MCP agents, internal copilots, workflow agents, or enterprise automation, see [AGENTIC.md](AGENTIC.md). It explains the catalog-first agent loop in detail: discover, inspect, validate, act, observe, and refine.
|
|
489
512
|
|
|
490
|
-
Key discovery tools:
|
|
491
|
-
- `
|
|
492
|
-
- `query_catalog` to search schema, relationship, workflow, language, config, policy, capability, and query-pattern items. Use `search` for ranked text discovery and `where` for exact filters.
|
|
493
|
-
- `
|
|
513
|
+
Key discovery tools, when listed for the caller:
|
|
514
|
+
- `graphql_help` to choose a catalog-backed topic route when the task is broad or unclear
|
|
515
|
+
- `query_catalog` to search schema, relationship, workflow, language, `config_recipe`, config, policy, capability, and query-pattern items. Use `search` for ranked text discovery and `where` for exact filters.
|
|
516
|
+
- `query_catalog(id: "...")` to inspect evidence, examples, details, safety notes, and graph edges for one row
|
|
494
517
|
- `validate_where_clause` to validate filters before execution
|
|
495
518
|
|
|
496
519
|
For JS orchestration, use:
|
|
497
520
|
- `query_catalog` with `where: { kind: { eq: "workflow" } }` to discover reusable workflows
|
|
498
|
-
- `
|
|
521
|
+
- `graphql_help(for: "workflow_runtime")` and workflow catalog rows to discover exactly which globals/functions are available inside workflow scripts
|
|
499
522
|
- `gj_workflow_execution(insert: { workflow_name: "...", variables: {...} })` to run `./workflows/<name>.js` through GraphQL. This is mutation-only and returns an ephemeral result row; it does not store run history. Mark the workflows source or `gj_workflow_execution` table `read_only` to block it. The `execute_workflow` MCP compatibility tool is available only when `mcp.legacy_discovery: true` and `mcp.allow_workflow_execution: true`.
|
|
500
523
|
|
|
501
|
-
|
|
524
|
+
Legacy prompts such as `write_query` and `fix_query_error` are available only when the caller's MCP surface lists them; in source mode their guidance lives in `graphql_help`, `query_catalog`, and GraphJin repair hints.
|
|
502
525
|
|
|
503
526
|
## JS Workflows (GraphQL + REST)
|
|
504
527
|
|
|
@@ -577,7 +600,7 @@ Real conversations showing how an AI assistant uses GraphJin MCP tools to help y
|
|
|
577
600
|
|
|
578
601
|
> **You:** Show me users with their orders.
|
|
579
602
|
|
|
580
|
-
> **Claude:** *calls `query_catalog` with `search: "join users orders", where: {kind: {eq: "relationship"}}`, then `
|
|
603
|
+
> **Claude:** *calls `query_catalog` with `search: "join users orders", where: {kind: {eq: "relationship"}}`, then `query_catalog(id: "<relationship_id>")`, then `execute_graphql` if raw execution is listed*
|
|
581
604
|
> ```graphql
|
|
582
605
|
> { users { id name email orders { id total status } } }
|
|
583
606
|
> ```
|
|
@@ -610,7 +633,7 @@ Real conversations showing how an AI assistant uses GraphJin MCP tools to help y
|
|
|
610
633
|
>
|
|
611
634
|
> Tables found: `customers`, `products`, `orders`, `order_items`, `categories`. Let me check how they relate.
|
|
612
635
|
>
|
|
613
|
-
> *calls `query_catalog` with `search: "join orders customers order_items products", where: {kind: {eq: "relationship"}}`, then `
|
|
636
|
+
> *calls `query_catalog` with `search: "join orders customers order_items products", where: {kind: {eq: "relationship"}}`, then `query_catalog(id: "<relationship_id>")` for the relevant relationship items*
|
|
614
637
|
>
|
|
615
638
|
> `orders` connects to `customers` (via customer_id) and `order_items` (via order_id), and `order_items` links to `products`. Here's a nested query:
|
|
616
639
|
>
|
|
@@ -641,7 +664,7 @@ Real conversations showing how an AI assistant uses GraphJin MCP tools to help y
|
|
|
641
664
|
|
|
642
665
|
> **You:** Show me all tasks with their project name, sorted by due date.
|
|
643
666
|
|
|
644
|
-
> **Claude:** *calls `query_catalog` with `search: "join tasks projects", where: {kind: {eq: "relationship"}}`, then `
|
|
667
|
+
> **Claude:** *calls `query_catalog` with `search: "join tasks projects", where: {kind: {eq: "relationship"}}`, then `query_catalog(id: "<relationship_id>")`, then `execute_graphql` if raw execution is listed*
|
|
645
668
|
> ```graphql
|
|
646
669
|
> { tasks(order_by: {due_date: asc}) { id title due_date completed project { name } } }
|
|
647
670
|
> ```
|
|
@@ -649,20 +672,22 @@ Real conversations showing how an AI assistant uses GraphJin MCP tools to help y
|
|
|
649
672
|
|
|
650
673
|
## Database Support
|
|
651
674
|
|
|
652
|
-
| Database | Queries | Mutations | Subscriptions | Full-Text | GIS |
|
|
653
|
-
|
|
654
|
-
| PostgreSQL | Yes | Yes | Yes | Yes | PostGIS |
|
|
655
|
-
| MySQL | Yes | Yes | Yes | Yes | 8.0+ |
|
|
656
|
-
| MariaDB | Yes | Yes | Yes | Yes | Yes |
|
|
657
|
-
| MSSQL | Yes | Yes | Yes | No | Yes |
|
|
658
|
-
| Oracle | Yes | Yes | Yes | No | Yes |
|
|
659
|
-
| SQLite | Yes | Yes | Yes | FTS5 | SpatiaLite |
|
|
660
|
-
| MongoDB | Yes | Yes | Yes | Yes | Yes |
|
|
661
|
-
|
|
|
662
|
-
|
|
|
663
|
-
|
|
|
664
|
-
|
|
665
|
-
|
|
675
|
+
| Database | Queries | Mutations | Subscriptions | Full-Text | GIS | Schema DDL |
|
|
676
|
+
|----------|---------|-----------|---------------|-----------|-----|------------|
|
|
677
|
+
| PostgreSQL | Yes | Yes | Yes | Yes | PostGIS | Yes |
|
|
678
|
+
| MySQL | Yes | Yes | Yes | Yes | 8.0+ | Yes |
|
|
679
|
+
| MariaDB | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
680
|
+
| MSSQL | Yes | Yes | Yes | No | Yes | Yes |
|
|
681
|
+
| Oracle | Yes | Yes | Yes | No | Yes | Yes |
|
|
682
|
+
| SQLite | Yes | Yes | Yes | FTS5 | SpatiaLite | Yes |
|
|
683
|
+
| MongoDB | Yes | Yes | Yes | Yes | Yes | No |
|
|
684
|
+
| Cassandra / Keyspaces | CQL-native | Single-table PK | Partition-bound polling | No | No | No |
|
|
685
|
+
| Snowflake | Yes | Yes | No | No | No | Yes |
|
|
686
|
+
| Redshift | Experimental queries | Experimental PK writes | Experimental batched polling | Limited search | Limited | Experimental basic DDL |
|
|
687
|
+
| BigQuery | Yes (experimental) | No | No | No | No | No |
|
|
688
|
+
| CockroachDB | Yes | Yes | Yes | Yes | No | No |
|
|
689
|
+
|
|
690
|
+
Also works with AWS Aurora/RDS, Google Cloud SQL, and YugabyteDB. Snowflake supports key pair (JWT) authentication and SHOW-based catalog discovery/paging. Redshift support is experimental: queries/discovery, single-table primary-key writes, batched polling subscriptions, limited `ILIKE` search over configured `full_text` columns, limited spatial filters, and basic generated DDL. Redshift subscriptions are polling-based warehouse queries, not native change streams. BigQuery support is experimental and query-focused. Cassandra / Keyspaces support CQL-native queries, partition-bound polling subscriptions, and single-table primary-key writes; aggregates, full scans, OR-style cross-partition filters, full-text, and GIS remain outside the generic surface.
|
|
666
691
|
|
|
667
692
|
## Production Security
|
|
668
693
|
|
|
@@ -723,10 +748,8 @@ Built-in web UI at `http://localhost:8080` for query development.
|
|
|
723
748
|
|
|
724
749
|
## Documentation
|
|
725
750
|
|
|
726
|
-
|
|
727
|
-
|
|
728
751
|
- [Configuration Reference](CONFIG.md)
|
|
729
|
-
- [Feature Reference](
|
|
752
|
+
- [Feature Reference](FEATURES.md)
|
|
730
753
|
- [Go Examples](https://pkg.go.dev/github.com/dosco/graphjin/core#pkg-examples)
|
|
731
754
|
|
|
732
755
|
## Get in Touch
|