rust-kgdb 0.6.59 → 0.6.60

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 +53 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -99,7 +99,7 @@ This is what I built. A knowledge graph database with an AI layer that **cannot
99
99
 
100
100
  **Two components, one npm package:**
101
101
 
102
- ### 1. rust-kgdb Core: Embedded Knowledge Graph Database
102
+ ### rust-kgdb Core: Embedded Knowledge Graph Database
103
103
 
104
104
  A high-performance RDF/SPARQL database that runs **inside your application**. No server. No Docker. No config.
105
105
 
@@ -129,7 +129,7 @@ A high-performance RDF/SPARQL database that runs **inside your application**. No
129
129
 
130
130
  **Like SQLite - but for knowledge graphs.**
131
131
 
132
- ### 2. HyperMind: Neuro-Symbolic Agent Framework
132
+ ### HyperMind: Neuro-Symbolic Agent Framework
133
133
 
134
134
  An AI agent layer that uses **the database to prevent hallucinations**. The LLM plans, the database executes.
135
135
 
@@ -211,6 +211,57 @@ These aren't arbitrary choices. Each one solves a real problem I encountered bui
211
211
 
212
212
  ---
213
213
 
214
+ ## Why Our Tool Calling Is Different
215
+
216
+ Traditional AI tool calling (OpenAI Functions, LangChain Tools) has fundamental problems:
217
+
218
+ **The Traditional Approach:**
219
+ ```
220
+ LLM generates JSON → Runtime validates schema → Tool executes → Hope it works
221
+ ```
222
+
223
+ 1. **Schema is decorative.** The LLM sees a JSON schema and tries to match it. No guarantee outputs are correct types.
224
+ 2. **Composition is ad-hoc.** Chain Tool A → Tool B? Pray that A's output format happens to match B's input.
225
+ 3. **Errors happen at runtime.** You find out a tool chain is broken when a user hits it in production.
226
+ 4. **No mathematical guarantees.** "It usually works" is the best you get.
227
+
228
+ **Our Approach: Tools as Typed Morphisms**
229
+ ```
230
+ Tools are arrows in a category:
231
+ kg.sparql.query: Query → BindingSet
232
+ kg.motif.find: Pattern → Matches
233
+ kg.embeddings.search: EntityId → SimilarEntities
234
+
235
+ Composition is verified:
236
+ f: A → B
237
+ g: B → C
238
+ g ∘ f: A → C ✓ Compiles only if types match
239
+
240
+ Errors caught at plan time, not runtime.
241
+ ```
242
+
243
+ **What this means in practice:**
244
+
245
+ | Problem | Traditional | HyperMind |
246
+ |---------|-------------|-----------|
247
+ | **Type mismatch** | Runtime error | Won't compile |
248
+ | **Tool chaining** | Hope it works | Type-checked composition |
249
+ | **Output validation** | Schema validation (partial) | Refinement types (complete) |
250
+ | **Audit trail** | Optional logging | Built-in proof witnesses |
251
+
252
+ **Refinement Types: Beyond Basic Types**
253
+
254
+ We don't just have `string` and `number`. We have:
255
+ - `RiskScore` (number between 0 and 1)
256
+ - `PolicyNumber` (matches regex `^POL-\d{8}$`)
257
+ - `CreditScore` (integer between 300 and 850)
258
+
259
+ The type system *guarantees* a tool that outputs `RiskScore` produces a valid risk score. Not "probably" - mathematically proven.
260
+
261
+ **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
+
263
+ ---
264
+
214
265
  ## What You Can Do
215
266
 
216
267
  | Query Type | Use Case | Example |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rust-kgdb",
3
- "version": "0.6.59",
3
+ "version": "0.6.60",
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",