SPT Examples
Practical examples demonstrating SPT capabilities for vector intelligence, agent coordination, and distributed systems.
SptDB (Vector Database)
Work with SPT's vector database and memory operations.
| Example | Description |
|---|---|
| Batch Query | Execute multiple vector queries with throughput metrics |
| Batch Store | Store multiple patterns/vectors in bulk with progress tracking |
| Cached Query | Query cache layer with TTL for repeated queries (2000x speedup) |
| Connection Pool | Connection pool manager for concurrent database access |
| Perf Monitor | Performance monitor that tracks query/store metrics |
Swarm Coordination
Multi-agent swarm orchestration and QUIC transport.
| Example | Description |
|---|---|
| Multi-Agent Deployment | Full swarm deployment with hierarchical topology and 4 agent types |
| QUIC Server Coordinator | QUIC server as central coordinator for distributed agent swarms |
| QUIC Swarm Coordination | Distributed code review and refactoring pipeline over QUIC |
ReasoningBank
Self-learning reasoning system with SAFLA capabilities.
| Example | Description |
|---|---|
| Benchmark | Performance benchmark suite for storage, query, and optimisation |
| Learning Demo | Self-learning with semantic pattern storage and cross-domain queries |
| Optimize | Optimisation suite: VACUUM, caching, batch ops, performance tips |
NATS Integration (Legacy)
Legacy NATS examples. The core transport has been replaced by SPT Wire (spt-wire crate, QUIC-based). NATS remains available as a SmartConnector for bridging to external systems. See ADR-088.
| Example | Description |
|---|---|
| Swarm Pub/Sub | Pub/sub patterns for agent status, task distribution, memory coordination |
| JetStream Task Queue | Persistent task queues with at-least-once delivery and consumer groups |
| KV Agent State | Key-value store for real-time agent state management with watches |
Prerequisites
- Node.js 18+
- For swarm examples:
ANTHROPIC_API_KEYenvironment variable - For legacy NATS examples:
nats-serverrunning locally - For ReasoningBank:
npx sptCLI available