graphjin 3.18.42 → 3.18.43
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 +14 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,6 +15,7 @@ Works with PostgreSQL, MySQL, MongoDB, SQLite, Oracle, MSSQL, Snowflake, Redshif
|
|
|
15
15
|
|
|
16
16
|
## Why GraphJin For Agents
|
|
17
17
|
|
|
18
|
+
- **A built-in agent, one call away** - POST one instruction to `/api/v1/agent` (or call the `ask_graphjin_agent` MCP tool) and GraphJin runs the discovery loop itself - as the caller, under the caller's permissions - and returns a typed, evidence-backed answer. See [Server-Side Agent](#server-side-agent).
|
|
18
19
|
- **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
20
|
- **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
21
|
- **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.
|
|
@@ -90,6 +91,18 @@ GraphJin started
|
|
|
90
91
|
MCP: http://localhost:8080/api/v1/mcp
|
|
91
92
|
```
|
|
92
93
|
|
|
94
|
+
**Ask the built-in agent**
|
|
95
|
+
|
|
96
|
+
With a model API key in `./.env` (`OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, or `GOOGLE_APIKEY`), `--demo` also switches into agentic mode and enables GraphJin's built-in agent - one instruction in, a typed, evidence-backed answer out. Against the coffee-roastery demo:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
curl -sS localhost:8080/api/v1/agent \
|
|
100
|
+
-H 'content-type: application/json' \
|
|
101
|
+
-d '{"instruction": "What production work should we prioritize next?"}'
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Answers come back as `{status, answer, data, evidence, actions, next}`, grounded by server-side protocol guards. See [Server-Side Agent](#server-side-agent) below, [AGENTIC.md](AGENTIC.md#server-side-agent), and [graphjin.com/agentic/server-agent](https://graphjin.com/agentic/server-agent/).
|
|
105
|
+
|
|
93
106
|
## Add GraphJin To Your AI Client
|
|
94
107
|
|
|
95
108
|
### Local / Dev
|
|
@@ -581,7 +594,7 @@ Legacy prompts such as `write_query` and `fix_query_error` are available only wh
|
|
|
581
594
|
Optional: instead of your client chaining `query_catalog` → `validate_where_clause` → `execute_saved_query`, let GraphJin run the catalog-first discovery loop for you. When enabled, GraphJin exposes one MCP tool `ask_graphjin_agent` and one REST endpoint `POST /api/v1/agent` that take a single instruction and return a typed, evidence-backed answer (`status`, `answer`, `data`, `evidence`, `actions`, `next`).
|
|
582
595
|
|
|
583
596
|
- **Enable** by loading `agentic.yml` (`GO_ENV=agentic`) with `agent.enabled: true` plus a provider, model, and `api_key_env`.
|
|
584
|
-
- **
|
|
597
|
+
- **Execution control:** there are no per-request agent modes. `agent.read_only: true` forces the server-side agent to reject mutations, including saved-query mutations; otherwise core roles, row-level security, source/table `read_only`, and Go protocol guards decide what can run.
|
|
585
598
|
- **Caller-scoped:** the agent runs as the caller, so core roles + row-level security enforce access. The caller's role only changes which *guidance* the agent follows, never what it can read or write.
|
|
586
599
|
- **Grounded:** Go protocol guards keep every answer backed by real catalog/validation/execution evidence and downgrade to `blocked` (with evidence) when a step is skipped.
|
|
587
600
|
- **Machine-actionable refusals:** blocked responses carry a structured `refusal` (code, reasons, unblock steps, `policy_final`/`retryable`) so a calling agent can course-correct in one step instead of guessing.
|