rust-kgdb 0.6.49 → 0.6.51

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 +56 -0
  2. package/README.md +99 -15
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,62 @@
2
2
 
3
3
  All notable changes to the rust-kgdb TypeScript SDK will be documented in this file.
4
4
 
5
+ ## [0.6.51] - 2025-12-17
6
+
7
+ ### Factual Capabilities Comparison
8
+
9
+ #### Added Built-in Capabilities Table
10
+ Shows what HyperMind has natively vs what LangChain/DSPy need external dependencies for:
11
+
12
+ | Capability | HyperMind | LangChain/DSPy |
13
+ |------------|-----------|----------------|
14
+ | Recursive Reasoning | Datalog semi-naive (native) | Manual implementation |
15
+ | Graph Propagation | Pregel BSP | External library (NetworkX) |
16
+ | Multi-way Joins | WCOJ O(N^(ρ/2)) | No native support |
17
+ | Pattern Matching | Motif DSL | Manual traversal |
18
+ | OWL 2 RL Reasoning | Sparse matrix CSR/CSC | External reasoner |
19
+ | Vector Similarity | HNSW + ARCADE cache | External vector DB |
20
+ | Transitive Closure | Native Datalog | Loop implementation |
21
+
22
+ #### Added Agent Memory to Framework Comparison
23
+ - Built-in: Working + Episodic + KG-backed memory
24
+ - Memory Retrieval: 94% Recall@10 at 10K depth, 16.7ms
25
+
26
+ ---
27
+
28
+ ## [0.6.50] - 2025-12-17
29
+
30
+ ### Complete Architecture Documentation
31
+
32
+ #### Comprehensive "What Is This?" Section
33
+ Added full architecture diagrams showing all implemented features:
34
+
35
+ **Layer 1: Rust Core (Native Performance)**
36
+ | Component | What It Does | Performance |
37
+ |-----------|--------------|-------------|
38
+ | SPARQL 1.1 | W3C-compliant, 64 builtins | 449ns lookups |
39
+ | WCOJ Joins | Worst-case optimal joins | O(N^(ρ/2)) |
40
+ | Datalog | Semi-naive evaluation | Incremental |
41
+ | Sparse Matrix | CSR/CSC reasoning (OWL 2 RL) | Memory-efficient |
42
+ | GraphFrames | PageRank, components, motifs | Parallel |
43
+ | Pregel | Bulk Synchronous Parallel | Superstep-based |
44
+ | HNSW | Hierarchical NSW index | O(log N) |
45
+ | ARCADE Cache | 1-hop neighbor pre-cache | O(1) context |
46
+ | Storage | InMemory/RocksDB/LMDB | 24 bytes/triple |
47
+
48
+ **Layer 2: HyperMind Agent Framework (JavaScript)**
49
+ | Component | What It Does |
50
+ |-----------|--------------|
51
+ | LLMPlanner | Schema-aware query generation |
52
+ | MemoryManager | Working + episodic + long-term memory |
53
+ | WASM Sandbox | Secure execution with capabilities |
54
+ | ProofDAG | Audit trail with hash |
55
+ | TypedTools | Input/output validation |
56
+
57
+ **New WASM Sandbox Diagram**: Shows capability-based security, fuel metering, and audit logging.
58
+
59
+ ---
60
+
5
61
  ## [0.6.49] - 2025-12-17
6
62
 
7
63
  ### Core Concepts Section Added
package/README.md CHANGED
@@ -6,22 +6,92 @@
6
6
 
7
7
  ## What Is This?
8
8
 
9
- **rust-kgdb** is two things in one package:
9
+ **rust-kgdb** is two layers in one package:
10
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
11
+ ```
12
+ ┌─────────────────────────────────────────────────────────────────────────────┐
13
+ │ YOUR APPLICATION │
14
+ └─────────────────────────────────┬───────────────────────────────────────────┘
15
+
16
+ ┌─────────────────────────────────▼───────────────────────────────────────────┐
17
+ │ HYPERMIND AGENT FRAMEWORK (JavaScript) │
18
+ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
19
+ │ │ LLMPlanner │ │ MemoryMgr │ │ WASM │ │ ProofDAG │ │
20
+ │ │ (Schema- │ │ (Working/ │ │ Sandbox │ │ (Audit │ │
21
+ │ │ Aware) │ │ Episodic) │ │ (Secure) │ │ Trail) │ │
22
+ │ └─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ │
23
+ └─────────────────────────────────┬───────────────────────────────────────────┘
24
+ │ NAPI-RS (zero-copy)
25
+ ┌─────────────────────────────────▼───────────────────────────────────────────┐
26
+ │ RUST CORE (Native Performance) │
27
+ │ ┌──────────────────────────────────────────────────────────────────────┐ │
28
+ │ │ QUERY ENGINE │ │
29
+ │ │ • SPARQL 1.1 (449ns lookups) • WCOJ Joins (worst-case optimal) │ │
30
+ │ │ • Datalog (semi-naive eval) • Sparse Matrix (CSR/CSC reasoning) │ │
31
+ │ └──────────────────────────────────────────────────────────────────────┘ │
32
+ │ ┌──────────────────────────────────────────────────────────────────────┐ │
33
+ │ │ GRAPH ANALYTICS │ │
34
+ │ │ • GraphFrames (PageRank, Components, Triangles, Motifs) │ │
35
+ │ │ • Pregel BSP (Bulk Synchronous Parallel) │ │
36
+ │ │ • Shortest Paths, Label Propagation │ │
37
+ │ └──────────────────────────────────────────────────────────────────────┘ │
38
+ │ ┌──────────────────────────────────────────────────────────────────────┐ │
39
+ │ │ VECTOR & RETRIEVAL │ │
40
+ │ │ • HNSW Index (O(log N) ANN) • ARCADE 1-Hop Cache (O(1) neighbors) │ │
41
+ │ │ • Multi-provider Embeddings • RRF Reranking │ │
42
+ │ └──────────────────────────────────────────────────────────────────────┘ │
43
+ │ ┌──────────────────────────────────────────────────────────────────────┐ │
44
+ │ │ STORAGE │ │
45
+ │ │ • InMemory (dev) • RocksDB (prod) • LMDB (read-heavy) │ │
46
+ │ │ • SPOC/POCS/OCSP/CSPO Indexes • 24 bytes/triple │ │
47
+ │ └──────────────────────────────────────────────────────────────────────┘ │
48
+ └─────────────────────────────────────────────────────────────────────────────┘
49
+ ```
50
+
51
+ ### Layer 1: Rust Core (Native Performance)
52
+
53
+ | Component | What It Does | Performance |
54
+ |-----------|--------------|-------------|
55
+ | **SPARQL 1.1** | W3C-compliant query engine, 64 builtin functions | 449ns lookups |
56
+ | **WCOJ Joins** | Worst-case optimal joins for multi-way patterns | O(N^(ρ/2)) |
57
+ | **Datalog** | Semi-naive evaluation with recursion | Incremental |
58
+ | **Sparse Matrix** | CSR/CSC-based reasoning for OWL 2 RL | Memory-efficient |
59
+ | **GraphFrames** | PageRank, components, triangles, motifs | Parallel |
60
+ | **Pregel** | Bulk Synchronous Parallel graph processing | Superstep-based |
61
+ | **HNSW** | Hierarchical Navigable Small World index | O(log N) |
62
+ | **ARCADE Cache** | 1-hop neighbor pre-caching | O(1) context |
63
+ | **Storage** | InMemory, RocksDB, LMDB backends | 24 bytes/triple |
17
64
 
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
65
+ ### Layer 2: HyperMind Agent Framework (JavaScript)
23
66
 
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.
67
+ | Component | What It Does |
68
+ |-----------|--------------|
69
+ | **LLMPlanner** | Schema-aware query generation (auto-extracts from data) |
70
+ | **MemoryManager** | Working memory + episodic memory + long-term KG |
71
+ | **WASM Sandbox** | Secure execution with capability-based permissions |
72
+ | **ProofDAG** | Audit trail with cryptographic hash for reproducibility |
73
+ | **TypedTools** | Input/output validation prevents hallucination |
74
+
75
+ ### WASM Sandbox Architecture
76
+
77
+ ```
78
+ ┌─────────────────────────────────────────────────────────────────────────────┐
79
+ │ WASM SANDBOX (Secure Agent Execution) │
80
+ ├─────────────────────────────────────────────────────────────────────────────┤
81
+ │ │
82
+ │ ┌─────────────────────┐ ┌─────────────────────┐ ┌────────────────┐ │
83
+ │ │ CAPABILITIES │ │ FUEL METERING │ │ AUDIT LOG │ │
84
+ │ │ • ReadKG │ │ • CPU budget limit │ │ • Every action │ │
85
+ │ │ • ExecuteTool │ │ • Prevents infinite │ │ • Timestamps │ │
86
+ │ │ • WriteKG (opt) │ │ loops │ │ • Arguments │ │
87
+ │ └─────────────────────┘ └─────────────────────┘ └────────────────┘ │
88
+ │ │
89
+ │ Agent Code → WASM Runtime → Capability Check → Tool Execution → Audit │
90
+ │ │
91
+ └─────────────────────────────────────────────────────────────────────────────┘
92
+ ```
93
+
94
+ **Think of it as**: A knowledge graph database (Rust, native performance) with an AI agent runtime (JavaScript, WASM-sandboxed) on top. The database provides ground truth. The runtime makes it accessible via natural language with full security and audit trails.
25
95
 
26
96
  ---
27
97
 
@@ -84,8 +154,22 @@
84
154
  | **Core Function** | Execute queries on data | Chain LLM prompts |
85
155
  | **Data Storage** | Built-in QuadStore | None (BYODB) |
86
156
  | **Query Execution** | Native SPARQL/Datalog | External DB needed |
87
-
88
- **Where HyperMind Genuinely Wins**:
157
+ | **Agent Memory** | Built-in (Working + Episodic + KG-backed) | External vector DB needed |
158
+ | **Memory Retrieval** | 94% Recall@10 at 10K depth, 16.7ms | Depends on external provider |
159
+
160
+ **Built-in Capabilities (No External Dependencies)**:
161
+
162
+ | Capability | HyperMind | LangChain/DSPy |
163
+ |------------|-----------|----------------|
164
+ | **Recursive Reasoning** | Datalog semi-naive evaluation (native) | Manual implementation needed |
165
+ | **Graph Propagation** | Pregel BSP (PageRank, shortest paths) | External library (NetworkX) |
166
+ | **Multi-way Joins** | WCOJ algorithm O(N^(ρ/2)) | No native support |
167
+ | **Pattern Matching** | Motif DSL `(a)-[]->(b); (b)-[]->(c)` | Manual graph traversal |
168
+ | **OWL 2 RL Reasoning** | Sparse matrix CSR/CSC (native) | External reasoner needed |
169
+ | **Vector Similarity** | HNSW + ARCADE 1-hop cache | External vector DB (Pinecone, etc.) |
170
+ | **Transitive Closure** | `ancestor(?X,?Z) :- parent(?X,?Y), ancestor(?Y,?Z)` | Loop implementation |
171
+
172
+ **Database Performance (vs Industry Leaders)**:
89
173
 
90
174
  | Metric | HyperMind | Comparison |
91
175
  |--------|-----------|------------|
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rust-kgdb",
3
- "version": "0.6.49",
3
+ "version": "0.6.51",
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",