rust-kgdb 0.5.6 → 0.5.9
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/CHANGELOG.md +205 -0
- package/README.md +812 -36
- package/examples/embeddings-example.ts +4 -4
- package/examples/hypermind-agent-architecture.js +1709 -0
- package/hypermind-agent.js +636 -1
- package/index.d.ts +248 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,211 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to the rust-kgdb TypeScript SDK will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.5.9] - 2025-12-15
|
|
6
|
+
|
|
7
|
+
### Expert-Level Documentation - Complete Neuro-Symbolic AI Framework
|
|
8
|
+
|
|
9
|
+
This release provides comprehensive documentation for building production neuro-symbolic AI agents with full embedding integration.
|
|
10
|
+
|
|
11
|
+
#### New Documentation Sections
|
|
12
|
+
|
|
13
|
+
**Why Embeddings? The Rise of Neuro-Symbolic AI**
|
|
14
|
+
- Problem with pure symbolic systems (no semantic similarity)
|
|
15
|
+
- Problem with pure neural systems (hallucination, no audit)
|
|
16
|
+
- Neuro-symbolic solution: Neural discovery → Symbolic reasoning → Neural explanation
|
|
17
|
+
- Why 1-hop ARCADE embeddings matter for fraud ring detection
|
|
18
|
+
|
|
19
|
+
**Embedding Service: Multi-Provider Vector Search**
|
|
20
|
+
- Provider abstraction pattern for OpenAI, Voyage AI, Cohere
|
|
21
|
+
- Composite multi-provider embeddings for robustness
|
|
22
|
+
- Aggregation strategies: RRF, max score, majority voting
|
|
23
|
+
- API key configuration examples
|
|
24
|
+
|
|
25
|
+
**Graph Ingestion Pipeline with Embedding Triggers**
|
|
26
|
+
- Automatic embedding generation on triple insert
|
|
27
|
+
- 1-hop cache update triggers
|
|
28
|
+
- Periodic HNSW index rebuild
|
|
29
|
+
- Complete pipeline architecture diagram
|
|
30
|
+
|
|
31
|
+
**HyperAgent Framework Components**
|
|
32
|
+
- Governance Layer: Policy engine, capability grants, audit trail
|
|
33
|
+
- Runtime Layer: LLMPlanner, PlanExecutor, WasmSandbox
|
|
34
|
+
- Proxy Layer: Object proxy with typed morphisms (gRPC-style)
|
|
35
|
+
- Memory Layer: Working, long-term (KG), episodic memory
|
|
36
|
+
- Scope Layer: Namespace isolation, resource limits
|
|
37
|
+
|
|
38
|
+
**Enhanced Production Examples**
|
|
39
|
+
- Fraud detection with 5-step pre-configuration:
|
|
40
|
+
1. Environment configuration (API keys)
|
|
41
|
+
2. Service initialization
|
|
42
|
+
3. Embedding provider setup
|
|
43
|
+
4. Dataset loading with embedding triggers
|
|
44
|
+
5. Full pipeline execution
|
|
45
|
+
|
|
46
|
+
#### Architecture Clarifications
|
|
47
|
+
|
|
48
|
+
- Updated security model description in "What's Rust vs JavaScript" table
|
|
49
|
+
- Clarified NAPI-RS memory isolation + WasmSandbox capability control
|
|
50
|
+
- Defense-in-depth: NAPI-RS for memory safety, WasmSandbox for capability control
|
|
51
|
+
|
|
52
|
+
#### Test Results
|
|
53
|
+
|
|
54
|
+
All tests continue to pass:
|
|
55
|
+
- npm test: 42/42 ✅
|
|
56
|
+
- Documentation examples: 21/21 ✅
|
|
57
|
+
- Regression tests: 36/36 ✅
|
|
58
|
+
- GraphFrames tests: 35/35 ✅
|
|
59
|
+
- HyperMind agent tests: 21/21 ✅ (10 skipped - require K8s cluster)
|
|
60
|
+
|
|
61
|
+
## [0.5.8] - 2025-12-15
|
|
62
|
+
|
|
63
|
+
### Documentation Overhaul - Expert-Level, Factually Accurate
|
|
64
|
+
|
|
65
|
+
This release provides comprehensive documentation updates emphasizing the two-layer architecture with full factual accuracy.
|
|
66
|
+
|
|
67
|
+
#### Two-Layer Architecture Clarified
|
|
68
|
+
|
|
69
|
+
**Rust Core Engine (Native Performance via NAPI-RS)**
|
|
70
|
+
- GraphDB: 2.78µs lookups, 35x faster than RDFox
|
|
71
|
+
- GraphFrame: WCOJ-optimized graph algorithms
|
|
72
|
+
- EmbeddingService: HNSW similarity search with 1-hop cache
|
|
73
|
+
- DatalogProgram: Semi-naive evaluation for reasoning
|
|
74
|
+
- All exposed to TypeScript via NAPI-RS zero-copy bindings
|
|
75
|
+
|
|
76
|
+
**HyperMind Agent Framework (Mathematical Abstractions)**
|
|
77
|
+
- TypeId: Hindley-Milner type system with refinement types
|
|
78
|
+
- LLMPlanner: Natural language → typed tool pipelines
|
|
79
|
+
- WasmSandbox: WASM isolation with capability-based security
|
|
80
|
+
- AgentBuilder: Fluent composition of typed tools
|
|
81
|
+
- ExecutionWitness: SHA-256 cryptographic proofs for audit
|
|
82
|
+
|
|
83
|
+
#### Updated README.md
|
|
84
|
+
|
|
85
|
+
- Added "What's Rust vs JavaScript?" table showing exact implementation of each component
|
|
86
|
+
- Added architecture diagram showing Rust core + HyperMind layers
|
|
87
|
+
- Added naming disclaimers for GraphDB (not Ontotext) and GraphFrame (inspired by Apache Spark)
|
|
88
|
+
- Added comprehensive Benchmark Methodology section with reproducible steps
|
|
89
|
+
- Clarified WASM security model for all Rust interactions
|
|
90
|
+
|
|
91
|
+
#### Updated TypeScript Definitions (index.d.ts)
|
|
92
|
+
|
|
93
|
+
Added complete type definitions for HyperMind architecture components:
|
|
94
|
+
- `TypeId` - Type system with refinement types
|
|
95
|
+
- `TOOL_REGISTRY` - Typed tool morphisms (Category Theory)
|
|
96
|
+
- `LLMPlanner` - Natural language to execution plans
|
|
97
|
+
- `WasmSandbox` - WASM sandbox configuration and metrics
|
|
98
|
+
- `AgentBuilder` - Fluent builder pattern
|
|
99
|
+
- `ComposedAgent` - Agent with witness generation
|
|
100
|
+
|
|
101
|
+
#### Test Results
|
|
102
|
+
|
|
103
|
+
All tests passing:
|
|
104
|
+
- npm test: 42/42 ✅
|
|
105
|
+
- Documentation examples: 21/21 ✅
|
|
106
|
+
- Regression tests: 36/36 ✅
|
|
107
|
+
- GraphFrames tests: 35/35 ✅
|
|
108
|
+
- HyperMind agent tests: 21/21 ✅ (10 skipped - require K8s cluster)
|
|
109
|
+
|
|
110
|
+
#### Exports (hypermind-agent.js)
|
|
111
|
+
|
|
112
|
+
```javascript
|
|
113
|
+
const {
|
|
114
|
+
// Rust Core (via NAPI-RS)
|
|
115
|
+
GraphDB, GraphFrame, EmbeddingService, DatalogProgram,
|
|
116
|
+
|
|
117
|
+
// HyperMind Framework
|
|
118
|
+
TypeId, TOOL_REGISTRY, LLMPlanner, WasmSandbox,
|
|
119
|
+
AgentBuilder, ComposedAgent,
|
|
120
|
+
|
|
121
|
+
// Benchmark & Utilities
|
|
122
|
+
HyperMindAgent, runHyperMindBenchmark
|
|
123
|
+
} = require('rust-kgdb')
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## [0.5.7] - 2025-12-15
|
|
127
|
+
|
|
128
|
+
### HyperMind Architecture Components - Production-Ready Framework
|
|
129
|
+
|
|
130
|
+
This release adds the complete HyperMind agent architecture with production-ready components for building neuro-symbolic AI systems.
|
|
131
|
+
|
|
132
|
+
#### New Architecture Components
|
|
133
|
+
|
|
134
|
+
**TypeId System (Hindley-Milner Style)**
|
|
135
|
+
```javascript
|
|
136
|
+
const { TypeId } = require('rust-kgdb/hypermind-agent')
|
|
137
|
+
|
|
138
|
+
// Base types
|
|
139
|
+
TypeId.String, TypeId.Int64, TypeId.Float64, TypeId.Bool
|
|
140
|
+
|
|
141
|
+
// RDF-native types
|
|
142
|
+
TypeId.Node, TypeId.Triple, TypeId.BindingSet
|
|
143
|
+
|
|
144
|
+
// Compound types
|
|
145
|
+
TypeId.List('Fact'), TypeId.Option('String'), TypeId.Result('T', 'Error')
|
|
146
|
+
|
|
147
|
+
// Refinement types for business domains
|
|
148
|
+
TypeId.RiskScore, // 0.0..1.0
|
|
149
|
+
TypeId.PolicyNumber, // POL-NNNN-NNNN
|
|
150
|
+
TypeId.ClaimAmount // Currency > 0
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**LLMPlanner Class**
|
|
154
|
+
- Natural language → typed tool pipelines
|
|
155
|
+
- Intent decomposition with domain awareness
|
|
156
|
+
- Type composition validation at plan time
|
|
157
|
+
- Confidence scoring for execution plans
|
|
158
|
+
|
|
159
|
+
**WasmSandbox Class**
|
|
160
|
+
- Capability-based security (ReadKG, ExecuteTool, WriteKG)
|
|
161
|
+
- Fuel metering for resource limits
|
|
162
|
+
- Memory isolation (configurable limits)
|
|
163
|
+
- Full audit logging via Object Proxy
|
|
164
|
+
|
|
165
|
+
**AgentBuilder (Fluent Builder Pattern)**
|
|
166
|
+
```javascript
|
|
167
|
+
const agent = new AgentBuilder('compliance-checker')
|
|
168
|
+
.withTool('kg.sparql.query')
|
|
169
|
+
.withTool('kg.datalog.infer')
|
|
170
|
+
.withPlanner(new LLMPlanner('claude-sonnet-4', TOOL_REGISTRY))
|
|
171
|
+
.withSandbox({ capabilities: ['ReadKG'], fuelLimit: 1000000 })
|
|
172
|
+
.withHook('afterExecute', (step, result) => console.log(step.tool))
|
|
173
|
+
.build()
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
**ComposedAgent**
|
|
177
|
+
- Executable agent with full execution witness
|
|
178
|
+
- SHA-256 cryptographic proof hashes
|
|
179
|
+
- Complete audit trail for compliance
|
|
180
|
+
|
|
181
|
+
#### New Example: Complete Architecture Demo
|
|
182
|
+
|
|
183
|
+
`examples/hypermind-agent-architecture.js` - 1000+ line comprehensive demo:
|
|
184
|
+
1. Problem Statement (Why current AI agents fail)
|
|
185
|
+
2. High-Level Architecture Diagram
|
|
186
|
+
3. Sequence Diagram (User → SDK → Planner → Sandbox → KG)
|
|
187
|
+
4. Component Interaction Diagram
|
|
188
|
+
5. Type System Foundation (TypeId)
|
|
189
|
+
6. WASM Sandbox Security
|
|
190
|
+
7. Agent Composition
|
|
191
|
+
8. Core Concepts (Type/Category/Proof Theory)
|
|
192
|
+
9. HyperMind vs MCP Comparison
|
|
193
|
+
10. Live Agent Demonstration
|
|
194
|
+
|
|
195
|
+
#### Updated README.md
|
|
196
|
+
|
|
197
|
+
- Added "HyperMind Architecture Deep Dive" section with ASCII diagrams
|
|
198
|
+
- Added "HyperMind vs MCP" comparison showing domain proxy advantages
|
|
199
|
+
- Full code examples for AgentBuilder pattern
|
|
200
|
+
|
|
201
|
+
#### New Exports
|
|
202
|
+
|
|
203
|
+
```javascript
|
|
204
|
+
const {
|
|
205
|
+
TypeId, TOOL_REGISTRY, LLMPlanner, WasmSandbox,
|
|
206
|
+
AgentBuilder, ComposedAgent
|
|
207
|
+
} = require('rust-kgdb/hypermind-agent')
|
|
208
|
+
```
|
|
209
|
+
|
|
5
210
|
## [0.5.6] - 2025-12-15
|
|
6
211
|
|
|
7
212
|
### Enhanced HyperMind Examples - Show REAL Power
|