rust-kgdb 0.6.46 → 0.6.48

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 (3) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.md +48 -2
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,57 @@
2
2
 
3
3
  All notable changes to the rust-kgdb TypeScript SDK will be documented in this file.
4
4
 
5
+ ## [0.6.48] - 2025-12-17
6
+
7
+ ### Clearer Product Definition
8
+
9
+ #### Added "What Is This?" Section
10
+ New section at the very top of README explaining:
11
+
12
+ 1. **rust-kgdb** = High-Performance RDF Database (Rust core)
13
+ - SPARQL 1.1 query engine (449ns lookups)
14
+ - GraphFrames, Datalog, HNSW embeddings
15
+
16
+ 2. **HyperMind Agent Framework** = AI agent layer (JavaScript)
17
+ - Natural language queries
18
+ - Schema auto-extraction
19
+ - Audit trail
20
+
21
+ **Summary**: "A knowledge graph database with an AI agent layer on top."
22
+
23
+ #### Fixed Misleading +14.3pp Claim
24
+ - **Old (wrong)**: "HyperMind's +14.3pp comes from predicate resolver"
25
+ - **New (correct)**: DSPy gets 14.3% WITHOUT schema due to structured output format
26
+
27
+ **Fact check**: All frameworks achieve identical 71.4% WITH schema.
28
+
29
+ ---
30
+
31
+ ## [0.6.47] - 2025-12-17
32
+
33
+ ### Memory Retrieval Depth Benchmark Added
34
+
35
+ #### New Benchmark Documentation
36
+ Added Memory Retrieval Depth Benchmark to README, based on academic benchmarks:
37
+ - MemQ (arXiv 2503.05193)
38
+ - mKGQAgent (Text2SPARQL 2025)
39
+ - MTEB (Massive Text Embedding Benchmark)
40
+
41
+ **Results** (50 queries per depth, HNSW index):
42
+
43
+ | Depth | P50 Latency | Recall@5 | Recall@10 | MRR |
44
+ |-------|-------------|----------|-----------|-----|
45
+ | 10 | 0.06 ms | 78% | 100% | 0.68 |
46
+ | 100 | 0.50 ms | 88% | 98% | 0.42 |
47
+ | 1,000 | 1.59 ms | 80% | 94% | 0.50 |
48
+ | 10,000 | 16.71 ms | 76% | 94% | 0.54 |
49
+
50
+ **Key insight**: Even at 10K stored queries, Recall@10 stays at 94% with sub-17ms latency.
51
+
52
+ Reproduce: `node memory-retrieval-benchmark.js`
53
+
54
+ ---
55
+
5
56
  ## [0.6.46] - 2025-12-17
6
57
 
7
58
  ### Honest Comparison Fix
package/README.md CHANGED
@@ -4,6 +4,27 @@
4
4
  [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
5
5
  [![W3C](https://img.shields.io/badge/W3C-SPARQL%201.1%20%7C%20RDF%201.2-blue)](https://www.w3.org/TR/sparql11-query/)
6
6
 
7
+ ## What Is This?
8
+
9
+ **rust-kgdb** is two things in one package:
10
+
11
+ 1. **High-Performance RDF Database** (Rust core)
12
+ - SPARQL 1.1 query engine with 449ns lookup speed
13
+ - GraphFrames analytics (PageRank, connected components, motifs)
14
+ - Datalog reasoning engine
15
+ - HNSW vector embeddings for similarity search
16
+ - 35x faster than RDFox, 25% less memory
17
+
18
+ 2. **HyperMind Agent Framework** (JavaScript layer)
19
+ - AI agents that query the database using natural language
20
+ - Schema auto-extraction from your data
21
+ - Typed tools that prevent hallucination
22
+ - Audit trail for every answer
23
+
24
+ **Think of it as**: A knowledge graph database with an AI agent layer on top. The database provides ground truth. The agent layer makes it accessible via natural language.
25
+
26
+ ---
27
+
7
28
  ## AI Answers You Can Trust
8
29
 
9
30
  **The Problem**: LLMs hallucinate. They make up facts, invent data, and confidently state falsehoods. In regulated industries (finance, healthcare, legal), this is not just annoying—it's a liability.
@@ -135,6 +156,31 @@ db.loadTtl(':Provider123 :hasRiskScore "0.87" .', null)
135
156
  └─────────────────────────────────────────────────────────────────────────────┘
136
157
  ```
137
158
 
159
+ ### Memory Retrieval Depth Benchmark
160
+
161
+ Based on academic benchmarks: MemQ (arXiv 2503.05193), mKGQAgent (Text2SPARQL 2025), MTEB.
162
+
163
+ ```
164
+ ┌─────────────────────────────────────────────────────────────────────────────┐
165
+ │ BENCHMARK: Memory Retrieval at Depth (50 queries per depth) │
166
+ │ METHODOLOGY: LUBM schema-driven queries, HNSW index, random seed 42 │
167
+ ├─────────────────────────────────────────────────────────────────────────────┤
168
+ │ │
169
+ │ DEPTH │ P50 LATENCY │ P95 LATENCY │ Recall@5 │ Recall@10 │ MRR │
170
+ │ ──────────────────────────────────────────────────────────────────────────│
171
+ │ 10 │ 0.06 ms │ 0.26 ms │ 78% │ 100% │ 0.68 │
172
+ │ 100 │ 0.50 ms │ 0.75 ms │ 88% │ 98% │ 0.42 │
173
+ │ 1,000 │ 1.59 ms │ 5.03 ms │ 80% │ 94% │ 0.50 │
174
+ │ 10,000 │ 16.71 ms │ 17.37 ms │ 76% │ 94% │ 0.54 │
175
+ │ ──────────────────────────────────────────────────────────────────────────│
176
+ │ │
177
+ │ KEY INSIGHT: Even at 10,000 stored queries, Recall@10 stays at 94% │
178
+ │ Sub-17ms retrieval from 10K query pool = practical for production use │
179
+ │ │
180
+ │ Reproduce: node memory-retrieval-benchmark.js │
181
+ └─────────────────────────────────────────────────────────────────────────────┘
182
+ ```
183
+
138
184
  ### Where We Actually Outperform (Database Performance)
139
185
 
140
186
  ```
@@ -175,8 +221,8 @@ db.loadTtl(':Provider123 :hasRiskScore "0.87" .', null)
175
221
  │ HONEST TRUTH: Schema injection improves ALL frameworks equally. │
176
222
  │ Any framework + schema context achieves ~71% accuracy. │
177
223
  │ │
178
- HyperMind's +14.3pp comes from predicate resolver, but this is
179
- incremental improvement, not a fundamental breakthrough.
224
+ NOTE: DSPy gets 14.3% WITHOUT schema (vs 0% for others) due to
225
+ its structured output format. With schema, all converge to 71.4%.
180
226
  │ │
181
227
  │ OUR REAL VALUE: We include the database. Others don't. │
182
228
  │ - LangChain generates SPARQL → you need to find a database │
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rust-kgdb",
3
- "version": "0.6.46",
3
+ "version": "0.6.48",
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",