rust-kgdb 0.6.60 → 0.6.61

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.
Files changed (2) hide show
  1. package/README.md +59 -10
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -6,15 +6,15 @@
6
6
 
7
7
  ---
8
8
 
9
- ## Why I Built This
9
+ ## The Problem With AI Today
10
10
 
11
- I spent years watching enterprise AI projects fail. Not because the technology was bad, but because we were using it wrong.
11
+ Enterprise AI projects keep failing. Not because the technology is bad, but because organizations use it wrong.
12
12
 
13
13
  A claims investigator asks ChatGPT: *"Has Provider #4521 shown suspicious billing patterns?"*
14
14
 
15
15
  The AI responds confidently: *"Yes, Provider #4521 has a history of duplicate billing and upcoding."*
16
16
 
17
- The investigator opens a case. Weeks later, legal discovers **Provider #4521 has a perfect record**. The AI made it up. Now we're facing a lawsuit.
17
+ The investigator opens a case. Weeks later, legal discovers **Provider #4521 has a perfect record**. The AI made it up. Lawsuit incoming.
18
18
 
19
19
  This keeps happening:
20
20
 
@@ -30,8 +30,6 @@ Every time, the same pattern: The AI sounds confident. The AI is wrong. People g
30
30
 
31
31
  ## The Engineering Problem
32
32
 
33
- I'm an engineer. I don't accept "that's just how LLMs work." I wanted to understand *why* this happens and *how* to fix it properly.
34
-
35
33
  **The root cause is simple:** LLMs are language models, not databases. They predict plausible text. They don't look up facts.
36
34
 
37
35
  When you ask "Has Provider #4521 shown suspicious patterns?", the LLM doesn't query your claims database. It generates text that *sounds like* an answer based on patterns from its training data.
@@ -40,20 +38,20 @@ When you ask "Has Provider #4521 shown suspicious patterns?", the LLM doesn't qu
40
38
 
41
39
  These help, but they're patches. RAG retrieves *similar* documents - similar isn't the same as *correct*. Fine-tuning teaches patterns, not facts. Guardrails catch obvious errors, but "Provider #4521 has billing anomalies" sounds perfectly plausible.
42
40
 
43
- **I wanted a real solution.** One built on solid engineering principles, not hope.
41
+ **A real solution requires a different architecture.** One built on solid engineering principles, not hope.
44
42
 
45
43
  ---
46
44
 
47
- ## The Insight
45
+ ## The Solution
48
46
 
49
- What if we stopped asking AI for **answers** and started asking it for **questions**?
47
+ What if AI stopped providing **answers** and started generating **queries**?
50
48
 
51
49
  Think about it:
52
50
  - **Your database** knows the facts (claims, providers, transactions)
53
51
  - **AI** understands language (can parse "find suspicious patterns")
54
52
  - **You need both** working together
55
53
 
56
- The AI should translate intent into queries. The database should find facts. The AI should never make up data.
54
+ The AI translates intent into queries. The database finds facts. The AI never makes up data.
57
55
 
58
56
  ```
59
57
  Before (Dangerous):
@@ -67,7 +65,7 @@ After (Safe):
67
65
  Result: Real data with audit trail ← VERIFIABLE
68
66
  ```
69
67
 
70
- This is what I built. A knowledge graph database with an AI layer that **cannot hallucinate** because it only returns data from your actual systems.
68
+ rust-kgdb is a knowledge graph database with an AI layer that **cannot hallucinate** because it only returns data from your actual systems.
71
69
 
72
70
  ---
73
71
 
@@ -260,6 +258,57 @@ The type system *guarantees* a tool that outputs `RiskScore` produces a valid ri
260
258
 
261
259
  **The Insight:** Category theory isn't academic overhead. It's the same math that makes your database transactions safe (ACID = category theory applied to data). We apply it to tool composition.
262
260
 
261
+ **Trust Model: Proxied Execution**
262
+
263
+ Traditional tool calling trusts the LLM output completely:
264
+ ```
265
+ LLM → Tool (direct execution) → Result
266
+ ```
267
+
268
+ The LLM decides what to execute. The tool runs it blindly. This is why prompt injection attacks work - the LLM's output *is* the program.
269
+
270
+ **Our approach: Agent → Proxy → Sandbox → Tool**
271
+ ```
272
+ ┌─────────────────────────────────────────────────────────────────────┐
273
+ │ Agent Request: "Find suspicious claims" │
274
+ └────────────────────────────┬────────────────────────────────────────┘
275
+
276
+
277
+ ┌─────────────────────────────────────────────────────────────────────┐
278
+ │ LLMPlanner: Generates tool call plan │
279
+ │ → kg.sparql.query(pattern) │
280
+ │ → kg.datalog.infer(rules) │
281
+ └────────────────────────────┬────────────────────────────────────────┘
282
+ │ Plan (NOT executed yet)
283
+
284
+ ┌─────────────────────────────────────────────────────────────────────┐
285
+ │ HyperAgentProxy: Validates plan against capabilities │
286
+ │ ✓ Does agent have ReadKG capability? Yes │
287
+ │ ✓ Is query schema-valid? Yes │
288
+ │ ✓ Are all types correct? Yes │
289
+ │ ✗ Blocked: WriteKG not in capability set │
290
+ └────────────────────────────┬────────────────────────────────────────┘
291
+ │ Validated plan only
292
+
293
+ ┌─────────────────────────────────────────────────────────────────────┐
294
+ │ WasmSandbox: Executes with resource limits │
295
+ │ • Fuel metering: 1M operations max │
296
+ │ • Memory cap: 64MB │
297
+ │ • Capability enforcement: Cannot exceed granted permissions │
298
+ └────────────────────────────┬────────────────────────────────────────┘
299
+ │ Execution with audit
300
+
301
+ ┌─────────────────────────────────────────────────────────────────────┐
302
+ │ ProofDAG: Records execution witness │
303
+ │ • What tool ran │
304
+ │ • What inputs were used │
305
+ │ • What outputs were produced │
306
+ │ • SHA-256 hash of entire execution │
307
+ └─────────────────────────────────────────────────────────────────────┘
308
+ ```
309
+
310
+ The LLM never executes directly. It proposes. The proxy validates. The sandbox enforces. The proof records. Four independent layers of defense.
311
+
263
312
  ---
264
313
 
265
314
  ## What You Can Do
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rust-kgdb",
3
- "version": "0.6.60",
3
+ "version": "0.6.61",
4
4
  "description": "High-performance RDF/SPARQL database with AI agent framework. GraphDB (449ns lookups, 35x faster than RDFox), GraphFrames analytics (PageRank, motifs), Datalog reasoning, HNSW vector embeddings. HyperMindAgent for schema-aware query generation with audit trails. W3C SPARQL 1.1 compliant. Native performance via Rust + NAPI-RS.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",