Where to Find Ruflo Usage Examples: Complete Guide to Claude Flow Demos
Ruflo (Claude Flow) usage examples are located in v3/@claude-flow/**/examples/ for modern TypeScript demos and v2/examples/ for legacy CLI scenarios, runnable via npx ts-node after installing dependencies with npm ci.
The ruvnet/ruflo repository, also known as Claude Flow, provides a comprehensive collection of runnable ruflo usage examples demonstrating its plugin SDK, memory services, and neural learning capabilities. Whether you are integrating the RuVector PostgreSQL bridge or benchmarking flash-attention kernels, these examples provide production-ready code patterns located throughout the v3/ and v2/ directory trees.
Ruflo Example Directory Structure
The repository organizes runnable demos by functional area. Each directory contains self-contained TypeScript scripts illustrating specific Claude Flow capabilities:
v3/@claude-flow/plugins/examples/ruvector/– RuVector PostgreSQL bridge plugin demonstrations, including vector insertion and similarity searchv3/@claude-flow/memory/examples/– AgentDB hybrid-memory API showcasing search, storage, and vector indexingv3/@claude-flow/performance/src/examples/– High-throughput primitives including flash-attention benchmarksv3/@claude-flow/neural/examples/– End-to-end SONA learning engine usagev3/@claude-flow/deployment/examples/– CI/CD-friendly release automation scriptsv2/examples/– Legacy quick-start demos, swarm applications, and testing suites for the original CLI
Running Plugin SDK Examples
The RuVector plugin examples demonstrate how to bridge PostgreSQL with vector operations. Located in v3/@claude-flow/plugins/examples/ruvector/, these scripts require TypeScript execution via ts-node.
First, install workspace dependencies:
npm ci
Navigate to the RuVector demo folder and execute the basic usage script:
cd v3/@claude-flow/plugins/examples/ruvector
npx ts-node basic-usage.ts
The basic-usage.ts script performs the following operations:
- Creates a temporary PostgreSQL container
- Registers the RuVector plugin with Claude Flow
- Inserts sample vectors into the database
- Executes a similarity search query
Additional plugin demonstrations in the same directory include:
semantic-search.ts– Advanced vector similarity with filteringattention-patterns.ts– Attention mechanism visualization with vector storage
Hybrid Memory and AgentDB Examples
The AgentDB hybrid memory service combines SQLite storage with HNSW vector indexing for agent-based applications. The primary example resides at v3/@claude-flow/memory/examples/agentdb-example.ts.
Run the memory demonstration:
cd v3/@claude-flow/memory/examples
npx ts-node agentdb-example.ts
This script illustrates:
- Initializing an AgentDB instance with SQLite and HNSW vector index backends
- Storing documents with associated embedding vectors
- Performing fast K-nearest neighbor (K-NN) lookups for retrieval-augmented generation
Performance and Neural Network Demos
Flash-Attention Benchmarks
The performance benchmarks demonstrate Claude Flow's optimized attention kernels. Located in v3/@claude-flow/performance/src/examples/flash-attention-demo.ts, this example validates the 2.5-7× speed-up claims documented in the repository README.
Execute the benchmark using tsx for TypeScript execution:
cd v3/@claude-flow/performance/src/examples
npx tsx flash-attention-demo.ts
The script runs synthetic transformer-style attention workloads and outputs latency metrics comparing standard attention against the optimized flash-attention implementation.
SONA Neural Learning Engine
The SONA (Self-Optimizing Neural Architecture) examples demonstrate end-to-end machine learning workflows. The primary entry point is v3/@claude-flow/neural/examples/sona-usage.ts.
Run the neural learning demonstration:
cd v3/@claude-flow/neural/examples
npx tsx sona-usage.ts
This example covers:
- Defining reasoning patterns using prompts and few-shot examples
- Training the SONA model on minimal example data (single-shot learning)
- Query-time inference with automatic context-window management
Deployment and Legacy Examples
CI/CD Deployment Scripts
For production pipelines, Claude Flow provides deployment helpers in v3/@claude-flow/deployment/examples/. The basic-release.ts script performs dry-runs, git tagging, and package publishing.
Execute the release automation:
cd v3/@claude-flow/deployment/examples
npx ts-node basic-release.ts
Legacy v2 Quick-Start Demos
The v2/examples/ directory contains the original CLI demonstrations for users maintaining legacy Claude Flow implementations:
v2/examples/03-demos/quick/README.md– Hello-world configuration and basic agent setupv2/examples/05-swarm-apps/rest-api/README.md– Full-stack REST API swarm applicationv2/examples/04-testing/unit/README.md– Unit testing patterns for Claude Flow agents
Each legacy README contains exact npx claude-flow commands for spinning up the respective demonstration.
Summary
- Ruflo usage examples are organized under
v3/@claude-flow/**/examples/for modern TypeScript implementations andv2/examples/for legacy CLI demos. - Plugin examples in
v3/@claude-flow/plugins/examples/ruvector/demonstrate PostgreSQL vector operations viabasic-usage.ts,semantic-search.ts, andattention-patterns.ts. - Memory services are showcased in
v3/@claude-flow/memory/examples/agentdb-example.ts, illustrating SQLite and HNSW vector indexing. - Performance benchmarks reside in
v3/@claude-flow/performance/src/examples/flash-attention-demo.ts, validating flash-attention speed-ups. - Neural learning workflows are demonstrated in
v3/@claude-flow/neural/examples/sona-usage.tscovering the SONA engine. - All examples execute with
npx ts-nodeornpx tsxafter runningnpm cito install dependencies.
Frequently Asked Questions
Where are the main ruflo usage examples located?
The primary ruflo usage examples are located in the v3/@claude-flow/ directory tree, specifically within plugins/examples/, memory/examples/, performance/src/examples/, neural/examples/, and deployment/examples/. Legacy examples for the original CLI remain available in the v2/examples/ directory.
How do I run the RuVector plugin examples?
First, install dependencies with npm ci, then navigate to v3/@claude-flow/plugins/examples/ruvector/ and execute npx ts-node basic-usage.ts. This script creates a temporary PostgreSQL container, registers the RuVector plugin, inserts sample vectors, and performs a similarity search query.
What is the difference between v2 and v3 examples?
The v3 examples located under v3/@claude-flow/ represent the modern TypeScript SDK architecture, featuring modular plugins, hybrid memory services, and neural learning engines. The v2 examples in v2/examples/ target the original CLI interface and are maintained for backward compatibility with legacy Claude Flow deployments.
Which example demonstrates the flash-attention performance benchmarks?
The flash-attention performance demonstration is located at v3/@claude-flow/performance/src/examples/flash-attention-demo.ts. Run this script with npx tsx flash-attention-demo.ts to execute synthetic transformer-style attention workloads and verify the 2.5-7× speed-up metrics documented in the repository.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →