# Where to Find Ruflo Usage Examples: Complete Guide to Claude Flow Demos

> Discover Ruflo usage examples in the ruvnet/ruflo repository. Find modern TypeScript demos in v3 and legacy CLI examples in v2. Run them easily with npm ci and npx ts-node.

- Repository: [rUv/ruflo](https://github.com/ruvnet/ruflo)
- Tags: getting-started
- Published: 2026-03-09

---

**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 search
- **`v3/@claude-flow/memory/examples/`** – AgentDB hybrid-memory API showcasing search, storage, and vector indexing
- **`v3/@claude-flow/performance/src/examples/`** – High-throughput primitives including flash-attention benchmarks
- **`v3/@claude-flow/neural/examples/`** – End-to-end SONA learning engine usage
- **`v3/@claude-flow/deployment/examples/`** – CI/CD-friendly release automation scripts
- **`v2/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:

```bash
npm ci

```

Navigate to the RuVector demo folder and execute the basic usage script:

```bash
cd v3/@claude-flow/plugins/examples/ruvector
npx ts-node basic-usage.ts

```

The [`basic-usage.ts`](https://github.com/ruvnet/ruflo/blob/main/basic-usage.ts) script performs the following operations:
1. Creates a temporary PostgreSQL container
2. Registers the RuVector plugin with Claude Flow
3. Inserts sample vectors into the database
4. Executes a similarity search query

Additional plugin demonstrations in the same directory include:
- [`semantic-search.ts`](https://github.com/ruvnet/ruflo/blob/main/semantic-search.ts) – Advanced vector similarity with filtering
- [`attention-patterns.ts`](https://github.com/ruvnet/ruflo/blob/main/attention-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:

```bash
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:

```bash
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:

```bash
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`](https://github.com/ruvnet/ruflo/blob/main/basic-release.ts) script performs dry-runs, git tagging, and package publishing.

Execute the release automation:

```bash
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`](https://github.com/ruvnet/ruflo/blob/main/v2/examples/03-demos/quick/README.md) – Hello-world configuration and basic agent setup
- [`v2/examples/05-swarm-apps/rest-api/README.md`](https://github.com/ruvnet/ruflo/blob/main/v2/examples/05-swarm-apps/rest-api/README.md) – Full-stack REST API swarm application
- [`v2/examples/04-testing/unit/README.md`](https://github.com/ruvnet/ruflo/blob/main/v2/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 and `v2/examples/` for legacy CLI demos.
- **Plugin examples** in `v3/@claude-flow/plugins/examples/ruvector/` demonstrate PostgreSQL vector operations via [`basic-usage.ts`](https://github.com/ruvnet/ruflo/blob/main/basic-usage.ts), [`semantic-search.ts`](https://github.com/ruvnet/ruflo/blob/main/semantic-search.ts), and [`attention-patterns.ts`](https://github.com/ruvnet/ruflo/blob/main/attention-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.ts` covering the SONA engine.
- All examples execute with `npx ts-node` or `npx tsx` after running `npm ci` to 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.