spt-server
SPT Format TCP/HTTP streaming server with REST API
Overview
spt-server provides a network-accessible interface to spt-runtime, exposing HTTP REST endpoints via Axum and a binary TCP streaming protocol for inter-agent vector exchange. Optional features add cryptographic vector exchange, scoped document sharing, SPT Wire event publishing, and sptdb collection management. It serves as the primary network entry point for SPT vector database operations.
Key Features
- HTTP REST API -- Axum-based endpoints for vector search, insert, delete, and collection management
- TCP streaming -- binary protocol for high-throughput inter-agent vector transfer
- Vector exchange -- Ed25519-signed peer-to-peer vector sharing (optional
exchangefeature) - Document sharing -- scoped sharing with scope manager coordination (optional
sharingfeature) - SPT Wire publishing -- event stream publishing for cluster coordination over QUIC (optional
wirefeature)
Dependencies
Key internal dependencies:
spt-runtime-- core store operations (SptStore,SptOptions)spt-types-- shared error and type definitionsspt-crypto-- Ed25519 signing for exchange/sharing (optional)spt-wire-- SPT Wire transport for event publishing (optional)spt-core-- sptdb storage backend (optional)axum/tokio-- async HTTP server runtime
Usage
rust
use spt_server::{ServerConfig, open_or_create_store};
let config = ServerConfig {
http_port: 8080,
tcp_port: 9090,
data_path: "data.spt".into(),
dimension: 128,
..Default::default()
};
let store = open_or_create_store(&config).unwrap();API Reference
Core Types
| Type | Description |
|---|---|
ServerConfig | Full server configuration (ports, paths, feature flags) |
open_or_create_store | Open existing or create new SPT store from config |
SharedStore | Thread-safe shared handle to the underlying SptStore |