Skip to content

@smartpointstech/spt-sptdb-onnx

SPT SptDB with optimized ONNX embeddings - 100% local, GPU-accelerated AI agent memory

Overview

This package provides a high-performance AI agent memory system that combines ONNX Runtime for local embedding generation with SPT's vector storage via sptflo-memory. It supports GPU acceleration, batch embedding, and includes ReflexionMemory and ReasoningBank for agent learning workflows. A CLI is included for database management.

Installation

bash
npm install @smartpointstech/spt-sptdb-onnx

Key Features

  • Local ONNX Embeddings -- generates embeddings on-device using models like all-MiniLM-L6-v2
  • GPU Acceleration -- optional GPU-backed inference via ONNX Runtime
  • ReflexionMemory -- episodic memory with critique, reward, and success tracking
  • ReasoningBank Integration -- pattern storage via sptflo-memory
  • CLI Tool -- spt-sptdb-onnx command for database operations and benchmarks

Dependencies

Key internal dependencies:

  • @smartpointstech/sptflo-memory -- database creation, ReasoningBank, ReflexionMemory
  • onnxruntime-node -- ONNX Runtime for local model inference
  • @xenova/transformers -- transformer model loading and tokenization

Quick Start

typescript
import { createONNXSptDB, ONNXEmbeddingService } from '@smartpointstech/spt-sptdb-onnx';

const sptDB = await createONNXSptDB({
  dbPath: './agent-memory.db',
  modelName: 'Xenova/all-MiniLM-L6-v2',
  useGPU: true,
});

API Reference

Exports

ExportTypeDescription
createONNXSptDBfunctionCreate an SptDB instance with ONNX embeddings
ONNXEmbeddingServiceclassONNX-powered embedding generation service
ONNXConfigtypeConfiguration for model, GPU, batch size, cache
EmbeddingResulttypeSingle embedding result
BatchEmbeddingResulttypeBatch embedding result

Released under the MIT License.