ruflo

📦 Pattern Store & Export

/docs/intelligence--learning/pattern-store--export

Share learned patterns across projects, teams, and the community via the decentralized pattern marketplace.

What You Can Share

Asset TypeDescriptionUse Case
PatternsLearned strategies from ReasoningBankShare what works across projects
Agent ConfigsOptimized YAML configurationsPre-tuned agents for specific domains
WorkflowsMulti-step task templatesReusable automation sequences
EmbeddingsPre-computed vector indexesSkip bootstrap time on new projects
HooksCustom hook implementationsExtend system behavior

Export Commands

bash
# Export learned patterns to file
npx ruflo@latest memory export --format json --output ./patterns.json

# Export specific namespace
npx ruflo@latest memory export --namespace "security" --output ./security-patterns.json

# Export with embeddings (larger file, faster import)
npx ruflo@latest memory export --include-embeddings --output ./full-export.json

# Export agent configurations
npx ruflo@latest config export --scope project --output ./agent-configs.json

# Export session state
npx ruflo@latest session export --session-id "my-session" --output ./session.json

Import Commands

bash
# Import patterns from file
npx ruflo@latest memory import --input ./patterns.json

# Import and merge with existing (don't overwrite)
npx ruflo@latest memory import --input ./patterns.json --merge

# Import from another project
npx ruflo@latest hooks transfer --source-path ../other-project

# Import agent configurations
npx ruflo@latest config import --input ./agent-configs.json --scope project

# Restore session
npx ruflo@latest session restore --session-id "my-session"

Pattern Store (IPFS Marketplace)

Decentralized pattern marketplace for sharing and discovering community patterns.

CommandDescription
transfer-store searchSearch patterns by keyword, category, or rating
transfer-store infoGet detailed info about a pattern
transfer-store downloadDownload pattern with integrity verification
transfer-store publishPublish your patterns to the store
transfer-store featuredBrowse featured/curated patterns
transfer-store trendingSee what's popular
bash
# Search for authentication patterns
npx ruflo@latest transfer-store search --query "authentication" --min-rating 4.0

# Download a pattern
npx ruflo@latest transfer-store download --id "auth-jwt-patterns-v2" --verify

# Publish your patterns
npx ruflo@latest transfer-store publish --input ./my-patterns.json --category "security"

Plugin Store

Discover and install community plugins from the live IPFS registry with 19 official plugins and live ratings via Cloud Function.

CommandDescription
plugins listList available plugins with live ratings
plugins rateRate a plugin (1-5 stars)
transfer plugin-searchSearch plugins by type or category
transfer plugin-infoGet plugin details and dependencies
transfer plugin-featuredBrowse featured plugins
transfer plugin-officialList official/verified plugins
bash
# List plugins with live ratings from Cloud Function
npx ruflo@latest plugins list

# Filter by type
npx ruflo@latest plugins list --type integration

# Rate a plugin
npx ruflo@latest plugins rate --name @claude-flow/embeddings --rating 5

# Search for MCP tool plugins
npx ruflo@latest transfer plugin-search --type "mcp-tool" --verified

# Get plugin info
npx ruflo@latest transfer plugin-info --name "semantic-code-search"

# List official plugins
npx ruflo@latest transfer plugin-official

Live IPFS Plugin Registry

The official plugin registry is hosted on IPFS with Ed25519 signature verification:

PropertyValue
Live CIDbafkreiahw4ufxwycbwwswt7rgbx6hkgnvg3rophhocatgec4bu5e7tzk2a
Plugins19 official plugins
VerificationEd25519 signed registry
GatewaysPinata, ipfs.io, dweb.link, Cloudflare
bash
# Fetch live registry directly
curl -s "https://gateway.pinata.cloud/ipfs/bafkreiahw4ufxwycbwwswt7rgbx6hkgnvg3rophhocatgec4bu5e7tzk2a"

IPFS Integration

Patterns and models are distributed via IPFS for decentralization and integrity.

FeatureBenefit
Content AddressingPatterns identified by hash, tamper-proof
DecentralizedNo single point of failure
Ed25519 SignaturesCryptographic registry verification
Multi-GatewayAutomatic failover (Pinata, ipfs.io, dweb.link)
PII DetectionAutomatic scanning before publish
bash
# Resolve IPNS name to CID
npx ruflo@latest transfer ipfs-resolve --name "/ipns/patterns.ruflo.io"

# Detect PII before publishing
npx ruflo@latest transfer detect-pii --content "$(cat ./patterns.json)"

Model & Learning Pattern Import/Export

Share trained neural patterns and learning models via IPFS.

OperationDescription
ExportPin learning patterns to IPFS, get shareable CID
ImportFetch patterns from any IPFS CID
AnalyticsTrack downloads and sharing metrics
bash
# Export a learning pattern to IPFS
curl -X POST "https://api.pinata.cloud/pinning/pinJSONToIPFS" \
  -H "Authorization: Bearer $PINATA_JWT" \
  -d '{
    "pinataContent": {
      "type": "learning-pattern",
      "name": "my-patterns",
      "patterns": [...]
    },
    "pinataMetadata": {"name": "ruflo-learning-pattern"}
  }'

# Import a pattern from IPFS CID
curl -s "https://gateway.pinata.cloud/ipfs/QmYourCIDHere"

# Via Cloud Function (when deployed)
curl "https://publish-registry-xxx.cloudfunctions.net?action=export-model" -d @model.json
curl "https://publish-registry-xxx.cloudfunctions.net?action=import-model&cid=QmXxx"

Supported Model Types

TypeDescriptionUse Case
learning-patternAgent learning patternsCode review, security analysis
neural-weightsTrained neural weightsSONA, MoE routing
reasoning-bankReasoning trajectoriesFew-shot learning
agent-configAgent configurationsSwarm templates

Pre-trained Model Registry

Import pre-defined rule-based patterns for common tasks. 40 patterns across 8 categories (trigger-action rules, not ML-trained models).

ModelCategoryPatternsAccuracyUse Case
security-review-patternssecurity594%SQL injection, XSS, path traversal
code-review-patternsquality590%SRP, error handling, type safety
performance-optimization-patternsperformance589%N+1 queries, memory leaks, caching
testing-patternstesting591%Edge cases, mocking, contracts
api-development-patternsapi592%REST conventions, validation, pagination
bug-fixing-patternsdebugging589%Null tracing, race conditions, regressions
refactoring-patternsrefactoring589%Extract methods, DRY, value objects
documentation-patternsdocumentation590%JSDoc, OpenAPI, ADRs

Registry CID: QmNr1yYMKi7YBaL8JSztQyuB5ZUaTdRMLxJC1pBpGbjsTc

bash
# Browse available models
curl -s "https://gateway.pinata.cloud/ipfs/QmNr1yYMKi7YBaL8JSztQyuB5ZUaTdRMLxJC1pBpGbjsTc" | jq '.models[].name'

# Import all models
npx ruflo@latest transfer import --cid QmNr1yYMKi7YBaL8JSztQyuB5ZUaTdRMLxJC1pBpGbjsTc

# Import specific category
npx ruflo@latest neural import --model security-review-patterns --source ipfs

# Use patterns in routing
npx ruflo@latest hooks route --task "review authentication code" --use-patterns

Benefits vs Fresh Install

MetricFresh InstallWith Pre-trained
Patterns Available040
Detection Patterns~50-60%40 rule-based patterns
Pattern Categories08 categories
Issue Detection Rate~60-70%~90-95%
Time to First InsightDiscovery neededImmediate

Pre-Built Pattern Packs

PackPatternsBest For
security-essentials45Auth, validation, CVE patterns
testing-patterns32TDD, mocking, fixture strategies
performance-optimization28Caching, query optimization
api-development38REST, GraphQL, error handling
devops-automation25CI/CD, deployment, monitoring
bash
# Install a pattern pack
npx ruflo@latest transfer-store download --id "security-essentials" --apply

RuVector WASM Neural Training

Real WASM-accelerated neural training using @ruvector/learning-wasm and @ruvector/attention packages for state-of-the-art performance.

ComponentPerformanceDescription
MicroLoRA<3μs adaptationRank-2 LoRA with 105x faster than 100μs target
ScopedLoRA17 operatorsPer-task-type learning (coordination, security, testing)
FlashAttention9,127 ops/secMemory-efficient attention mechanism
TrajectoryBuffer10k capacitySuccess/failure learning from patterns
InfoNCE LossContrastiveTemperature-scaled contrastive learning
AdamW Optimizerβ1=0.9, β2=0.999Weight decay training optimization
bash
# List available pre-trained models from IPFS registry
npx ruflo@latest neural list

# List models by category
npx ruflo@latest neural list --category security

# Train with WASM acceleration
npx ruflo@latest neural train -p coordination -e 100 --wasm --flash --contrastive

# Train security patterns
npx ruflo@latest neural train -p security --wasm --contrastive

# Benchmark WASM performance
npx ruflo@latest neural benchmark -d 256 -i 1000

# Import pre-trained models
npx ruflo@latest neural import --cid QmNr1yYMKi7YBaL8JSztQyuB5ZUaTdRMLxJC1pBpGbjsTc

# Export trained patterns to IPFS
npx ruflo@latest neural export --ipfs --sign

Benchmark Results

+---------------------+---------------+-------------+
| Mechanism           | Avg Time (ms) | Ops/sec     |
+---------------------+---------------+-------------+
| DotProduct          | 0.1063        | 9,410       |
| FlashAttention      | 0.1096        | 9,127       |
| MultiHead (4 heads) | 0.1661        | 6,020       |
| MicroLoRA           | 0.0026        | 383,901     |
+---------------------+---------------+-------------+
MicroLoRA Target (<100μs): ✓ PASS (2.60μs actual)

Training Options

FlagDescriptionDefault
--wasmEnable RuVector WASM accelerationtrue
--flashUse Flash Attentiontrue
--moeEnable Mixture of Experts routingfalse
--hyperbolicHyperbolic attention for hierarchical patternsfalse
--contrastiveInfoNCE contrastive learningtrue
--curriculumProgressive difficulty curriculumfalse
-e, --epochsNumber of training epochs50
-d, --dimEmbedding dimension (max 256)256
-l, --learning-rateLearning rate0.01