v3/@claude-flow/plugins/examples/ruvector/README.md
Comprehensive examples demonstrating the RuVector PostgreSQL Bridge plugin features.
cd examples/ruvector
docker compose up -d
This starts:
# From the plugins root directory
npm install
npm run build
# Basic vector operations
npx ts-node examples/ruvector/basic-usage.ts
# Semantic code search
npx ts-node examples/ruvector/semantic-search.ts
# Attention mechanisms
npx ts-node examples/ruvector/attention-patterns.ts
# Graph neural networks
npx ts-node examples/ruvector/gnn-analysis.ts
# Hyperbolic embeddings
npx ts-node examples/ruvector/hyperbolic-hierarchies.ts
# Self-learning optimization
npx ts-node examples/ruvector/self-learning.ts
# Large-scale streaming
npx ts-node examples/ruvector/streaming-large-data.ts
# Quantization methods
npx ts-node examples/ruvector/quantization.ts
# Transaction patterns
npx ts-node examples/ruvector/transactions.ts
Getting started with RuVector PostgreSQL Bridge:
Expected output:
RuVector PostgreSQL Bridge - Basic Usage Example
================================================
1. Connecting to PostgreSQL...
Connected successfully!
2. Creating collection "documents"...
Collection created!
3. Inserting vectors...
Inserted: doc-1
...
Semantic code search implementation:
Key concepts:
Using attention mechanisms:
Key concepts:
Graph Neural Network analysis:
Key concepts:
Hyperbolic embeddings for hierarchies:
Key concepts:
Self-optimization features:
Key concepts:
Handling large datasets:
Key concepts:
Memory optimization:
Key concepts:
ACID operations:
Key concepts:
# PostgreSQL connection
export POSTGRES_HOST=localhost
export POSTGRES_PORT=5432
export POSTGRES_DB=vectors
export POSTGRES_USER=postgres
export POSTGRES_PASSWORD=postgres
| Service | Port | Description |
|---|---|---|
| postgres | 5432 | PostgreSQL 16 with pgvector |
| adminer | 8080 | Database management UI |
Access Adminer at http://localhost:8080:
Ensure PostgreSQL is running:
docker compose ps
docker compose logs postgres
The pgvector extension should be auto-created. Verify:
SELECT * FROM pg_extension WHERE extname = 'vector';
For large datasets, adjust PostgreSQL memory settings in docker-compose.yml:
command: >
postgres
-c shared_buffers=512MB
-c work_mem=32MB
Ensure HNSW index exists:
SELECT indexname FROM pg_indexes WHERE tablename = 'your_table';
Tune search parameters:
SET hnsw.ef_search = 100; -- Increase for better recall
Stop and remove containers:
docker compose down
# Remove data volumes too:
docker compose down -v