ruflo

๐Ÿ˜ RuVector PostgreSQL Bridge

/docs/core-features/ruvector-postgresql-bridge

Full PostgreSQL integration with advanced vector operations, attention mechanisms, GNN layers, and self-learning optimization.

FeatureDescriptionPerformance
Vector SearchHNSW/IVF indexing with 12+ distance metrics52,000+ inserts/sec, sub-ms queries
39 Attention MechanismsMulti-head, Flash, Sparse, Linear, Graph, TemporalGPU-accelerated SQL functions
15 GNN Layer TypesGCN, GAT, GraphSAGE, MPNN, Transformer, PNAGraph-aware vector queries
Hyperbolic EmbeddingsPoincare, Lorentz, Klein models for hierarchical dataNative manifold operations
Self-LearningQuery optimizer, index tuner with EWC++Continuous improvement

MCP Tools (8 tools):

ToolDescription
ruvector_searchVector similarity search (cosine, euclidean, dot, etc.)
ruvector_insertInsert vectors with batch support and upsert
ruvector_updateUpdate existing vectors and metadata
ruvector_deleteDelete vectors by ID or batch
ruvector_create_indexCreate HNSW/IVF indices with tuning
ruvector_index_statsGet index statistics and health
ruvector_batch_searchBatch vector searches with parallelism
ruvector_healthConnection pool health check

Configuration:

typescript
import { createRuVectorBridge } from '@claude-flow/plugins';

const bridge = createRuVectorBridge({
  host: 'localhost',
  port: 5432,
  database: 'vectors',
  user: 'postgres',
  password: 'secret',
  pool: { min: 2, max: 10 },
  ssl: true
});

// Enable the plugin
await registry.register(bridge);
await registry.loadAll();

Attention Mechanisms (39 types):

CategoryMechanisms
Coremulti_head, self_attention, cross_attention, causal, bidirectional
Efficientflash_attention, flash_attention_v2, memory_efficient, chunk_attention
Sparsesparse_attention, block_sparse, bigbird, longformer, local, global
Linearlinear_attention, performer, linformer, nystrom, reformer
Positionalrelative_position, rotary_position, alibi, axial
Graphgraph_attention, hyperbolic_attention, spherical_attention
Temporaltemporal_attention, recurrent_attention, state_space
Multimodalcross_modal, perceiver, flamingo
Retrievalretrieval_attention, knn_attention, memory_augmented

GNN Layers (15 types):

LayerUse Case
gcnGeneral graph convolution
gat / gatv2Attention-weighted aggregation
sageInductive learning on large graphs
ginMaximally expressive GNN
mpnnMessage passing with edge features
edge_convPoint cloud processing
transformerFull attention on graphs
pnaPrincipal neighborhood aggregation
rgcn / hgt / hanHeterogeneous graphs

Hyperbolic Operations:

typescript
import { createHyperbolicSpace } from '@claude-flow/plugins';

const space = createHyperbolicSpace('poincare', { curvature: -1.0 });

// Embed hierarchical data (trees, taxonomies)
const embedding = await space.embed(vector);
const distance = await space.distance(v1, v2);  // Geodesic distance
const midpoint = await space.geodesicMidpoint(v1, v2);

Self-Learning System:

typescript
import { createSelfLearningSystem } from '@claude-flow/plugins';

const learning = createSelfLearningSystem(bridge);

// Automatic optimization
await learning.startLearningLoop();  // Runs in background

// Manual optimization
const suggestions = await learning.queryOptimizer.analyze(query);
await learning.indexTuner.tune('my_index');

Hooks (auto-triggered):

HookEventPurpose
ruvector-learn-patternPostMemoryStoreLearn from memory operations
ruvector-collect-statsPostToolUseCollect query statistics