tauri-plugin-velesdb
A Tauri plugin for VelesDB - Vector search in desktop applications.
Features
- π Fast Vector Search - Microsecond latency similarity search
- π Text Search - BM25 full-text search across payloads
- π Hybrid Search - Combined vector + text with RRF fusion
- π Multi-Query Fusion - MQG support with RRF/Weighted strategies
- ποΈ Collection Management - Create, list, and delete collections
- π VelesQL - SQL-like query language
- πΈοΈ Knowledge Graph - Add edges, traverse, get node degrees β NEW
- π‘ Event System - Real-time notifications for data changes β NEW
- π Local-First - All data stays on the user's device
Installation
Rust (Cargo.toml)
[]
= "0.1"
JavaScript (package.json)
# pnpm add @wiscale/tauri-plugin-velesdb
# yarn add @wiscale/tauri-plugin-velesdb
Usage
Rust - Plugin Registration
JavaScript - Frontend API
import from '@tauri-apps/api/core';
// Create a collection
await ;
// List collections
const collections = await ;
console.log;
// [{ name: 'documents', dimension: 768, metric: 'cosine', count: 0 }]
// Insert vectors
await ;
// Vector similarity search
const results = await ;
console.log;
// { results: [{ id: 1, score: 0.98, payload: {...} }], timingMs: 0.5 }
// Text search (BM25)
const textResults = await ;
// Hybrid search (vector + text)
const hybridResults = await ;
// Multi-query fusion search (MQG) β NEW
const mqResults = await ;
// Weighted fusion (like SearchXP scoring)
const weightedResults = await ;
// VelesQL query
const queryResults = await ;
// Delete collection
await ;
// ============================================
// Knowledge Graph API β NEW
// ============================================
// Add an edge to the knowledge graph
await ;
// Get edges (by label, source, or target)
const edges = await ;
// Traverse the graph (BFS or DFS)
const traversal = await ;
// Get node degree (in/out connections)
const degree = await ;
console.log;
// { nodeId: 100, inDegree: 5, outDegree: 3 }
Event System β NEW
Listen to real-time database changes:
import from '@tauri-apps/api/event';
// Collection created
await ;
// Collection updated (upsert/delete)
await ;
// Collection deleted
await ;
// Operation progress (for long operations)
await ;
API Reference
Commands
| Command | Description |
|---|---|
create_collection |
Create a new vector collection |
delete_collection |
Delete a collection |
list_collections |
List all collections |
get_collection |
Get info about a collection |
upsert |
Insert or update vectors |
get_points |
Retrieve points by IDs |
delete_points |
Delete points by IDs |
search |
Vector similarity search |
batch_search |
Batch vector search (multiple queries) |
multi_query_search |
Multi-query fusion search |
text_search |
BM25 full-text search |
hybrid_search |
Combined vector + text search |
query |
Execute VelesQL query |
add_edge |
Add edge to knowledge graph β NEW |
get_edges |
Get edges by label/source/target β NEW |
traverse_graph |
BFS/DFS graph traversal β NEW |
get_node_degree |
Get node in/out degree β NEW |
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 |
1x | Maximum accuracy |
sq8 |
4x | Good accuracy/memory balance |
binary |
32x | Edge/IoT, massive scale |
Distance Metrics
| Metric | Best For |
|---|---|
cosine |
Text embeddings (default) |
euclidean |
Spatial/geographic data |
dot |
Pre-normalized vectors |
hamming |
Binary vectors |
jaccard |
Set similarity |
Permissions
Add to your capabilities/default.json:
Or for granular control:
Example App
See the examples/basic-app directory for a complete Tauri app using this plugin.
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.