tauri-plugin-velesdb
A Tauri plugin for VelesDB — Vector search in desktop applications.
Features
- Fast Vector Search — Microsecond latency similarity search (HNSW + AVX2/AVX-512)
- Text Search — BM25 full-text search across payloads
- Hybrid Search — Combined vector + text with RRF fusion
- Multi-Query Fusion — MQG support with RRF / Weighted / Average strategies
- Collection Management — Create, list, and delete vector and metadata collections
- Knowledge Graph — Add edges, traverse (BFS/DFS), get node degrees
- VelesQL — SQL-like query language for advanced searches
- Event System — Real-time notifications for data changes
- Local-First — All data stays on the user's device
Installation
Rust (Cargo.toml)
[]
= "1"
TypeScript SDK (package.json)
A typed JS/TS wrapper ships in guest-js/index.ts. Build it with your bundler or import directly:
# pnpm add @wiscale/tauri-plugin-velesdb
# yarn add @wiscale/tauri-plugin-velesdb
Usage
Rust — Plugin Registration
TypeScript SDK (recommended)
import {
createCollection, upsert, search,
hybridSearch, textSearch, multiQuerySearch,
listCollections, deleteCollection,
createMetadataCollection, upsertMetadata,
addEdge, traverseGraph, getNodeDegree,
isEmpty, flush
} from '@wiscale/tauri-plugin-velesdb';
// Create a collection
await createCollection({ name: 'documents', dimension: 768, metric: 'cosine' });
// Insert vectors
await upsert({
collection: 'documents',
points: [
{ id: 1, vector: [0.1, 0.2, /* ... 768 dims */], payload: { title: 'Intro to AI' } },
{ id: 2, vector: [0.4, 0.5, /* ... */], payload: { title: 'ML Guide' } }
]
});
// Vector similarity search
const results = await search({
collection: 'documents',
vector: [0.15, 0.25, /* ... */],
topK: 5
});
// { results: [{ id: 1, score: 0.98, payload: {...} }], timingMs: 0.5 }
JavaScript (raw invoke)
import from '@tauri-apps/api/core';
// Create a collection
await ;
// Insert vectors
await ;
// Vector similarity search
const results = await ;
// Text search (BM25)
const textResults = await ;
// Hybrid search (vector + text with RRF)
const hybridResults = await ;
// Multi-query fusion search (MQG)
const mqResults = await ;
// VelesQL query
const queryResults = await ;
// Delete collection
await ;
Knowledge Graph
// Add a directed edge
await ;
// Query edges by label / source / target
const edges = await ;
// Graph traversal (BFS or DFS)
const traversal = await ;
// Node degree
const degree = await ;
// { nodeId: 100, inDegree: 5, outDegree: 3 }
Event System
import from '@tauri-apps/api/event';
await ;
await ;
await ;
await ;
await ;
Accessing VelesDbState from custom Tauri commands
use ;
use VelesDbState;
use ;
use Arc;
async
API Reference
Commands
| Command | Description |
|---|---|
create_collection |
Create a vector collection |
create_metadata_collection |
Create a metadata-only collection (no vectors) |
delete_collection |
Delete a collection and all its data |
list_collections |
List all collections with metadata |
get_collection |
Get info about a specific collection |
upsert |
Insert or update vectors with payloads |
upsert_metadata |
Insert or update metadata-only points |
get_points |
Retrieve points by IDs |
delete_points |
Delete points by IDs |
search |
Vector similarity search |
batch_search |
Parallel batch vector search (multiple queries) |
multi_query_search |
Multi-query fusion search (RRF / Weighted / Average) |
text_search |
BM25 full-text search |
hybrid_search |
Combined vector + text search with RRF fusion |
query |
Execute a VelesQL query |
is_empty |
Check if a collection has no points |
flush |
Flush pending writes to disk |
add_edge |
Add a directed edge to the knowledge graph |
get_edges |
Query edges by label / source / target |
traverse_graph |
BFS / DFS graph traversal from a node |
get_node_degree |
Get in-degree and out-degree of a node |
semantic_store |
Store a knowledge fact (Agent Memory SDK) |
semantic_query |
Retrieve semantically similar facts |
Events
| Event | Payload | Description |
|---|---|---|
velesdb://collection-created |
{ collection, operation } |
Collection created |
velesdb://collection-deleted |
{ collection, operation } |
Collection deleted |
velesdb://collection-updated |
{ collection, operation, count } |
Data modified |
velesdb://operation-progress |
{ operationId, progress, total, processed } |
Progress update |
velesdb://operation-complete |
{ operationId, success, error?, durationMs? } |
Operation done |
Storage Modes
| Mode | Compression | Best For |
|---|---|---|
full |
1× (f32) | Maximum accuracy |
sq8 |
4× | Good accuracy / memory balance |
binary |
32× | Edge / IoT, massive scale |
pq |
Variable | Product quantization, ultra-compact |
Distance Metrics
| Metric | Best For |
|---|---|
cosine |
Text embeddings (default) |
euclidean |
Spatial / geographic data |
dot |
Pre-normalized vectors, max inner product |
hamming |
Binary vectors |
jaccard |
Set similarity |
Permissions
Add to your capabilities/default.json:
Or for granular control:
Example App
See demos/tauri-rag-app for a complete desktop RAG application using this plugin with:
fastembed(AllMiniLML6V2, 384D) for local ML embeddings- Full persistent
VectorCollection(text stored in Point payload) - Chunk ingestion, vector search, and statistics UI
Performance
| Operation | Latency |
|---|---|
| Vector search (10k vectors) | < 1ms |
| Text search (BM25) | < 5ms |
| Hybrid search | < 10ms |
| Insert (batch 100) | < 10ms |
License
Elastic License 2.0 (ELv2)
See LICENSE for details.