v2/docs/reasoningbank/models/README.md
Welcome to the ReasoningBank model zoo! This directory contains 5 production-ready, pre-trained models with thousands of optimized patterns for immediate use.
# Choose a model
cd safla # or google-research, code-reasoning, problem-solving, domain-expert
# Install it
cp memory.db ~/.swarm/memory.db
# Try it!
npx claude-flow@alpha memory query "your question here" --reasoningbank
That's it! You now have expert-level patterns ready to use.
Best for: Self-learning systems that improve from experience
Use when: Building agents that learn automatically, no retraining needed
cp safla/memory.db ~/.swarm/memory.db
Best for: Following latest AI research best practices
Use when: Implementing cutting-edge AI research
cp google-research/memory.db ~/.swarm/memory.db
Best for: Software development and code generation
Use when: Code generation, review, or refactoring
cp code-reasoning/.swarm/memory.db ~/.swarm/memory.db
Best for: General reasoning and problem analysis
Use when: Complex problems requiring multiple reasoning approaches
cp problem-solving/memory.db ~/.swarm/memory.db
Best for: Specialized technical domains
Use when: Domain-specific expertise needed
cp domain-expert/memory.db ~/.swarm/memory.db
| Model | Patterns | Size | Avg Confidence | Use Case |
|---|---|---|---|---|
| SAFLA | 2,000 | 10.35 MB | 83.8% | Self-learning systems |
| Google Research | 3,000 | 8.92 MB | 88.0% | Research best practices |
| Code Reasoning | 2,500 | 2.66 MB | 91.5% | Software development |
| Problem Solving | 2,000 | 5.85 MB | 83.7% | General reasoning |
| Domain Expert | 1,500 | 2.39 MB | 89.4% | Technical expertise |
I want to...
My project is...
Each model directory contains:
General Guides:
Technical Documentation:
# Combine patterns from multiple models
cp safla/memory.db ~/.swarm/memory.db
# Merge Google Research patterns
sqlite3 ~/.swarm/memory.db << SQL
ATTACH DATABASE 'google-research/memory.db' AS source;
INSERT OR IGNORE INTO patterns SELECT * FROM source.patterns;
INSERT OR IGNORE INTO pattern_embeddings SELECT * FROM source.pattern_embeddings;
DETACH DATABASE source;
SQL
# Use different models per project
mkdir ./my-project/.swarm
cp code-reasoning/.swarm/memory.db ./my-project/.swarm/
# Set environment variable
export CLAUDE_FLOW_DB_PATH=./my-project/.swarm/memory.db
# Or use --db-path flag
npx claude-flow@alpha memory query "test" --db-path ./my-project/.swarm/memory.db
# Find patterns by domain
npx claude-flow@alpha memory query "API authentication" --namespace security
# High confidence only
npx claude-flow@alpha memory query "database optimization" --min-confidence 0.8
# Specific domain
sqlite3 ~/.swarm/memory.db "SELECT * FROM patterns WHERE domain = 'api-development' LIMIT 5"
Want to create custom models? See HOW-TO-TRAIN.md for:
Training Scripts Provided:
safla/train-safla.js - 2,000 self-learning patternsgoogle-research/train-google.js - 3,000 strategy patternscode-reasoning/train-code.js - 2,500 programming patternsproblem-solving/train-problem.js - 2,000 reasoning patternsdomain-expert/train-domain.js - 1,500 domain patternsAll models have been:
Run validation yourself:
cd safla # or any model directory
node ../_scripts/validation-suite.cjs . safla
import { AgenticFlow } from 'agentic-flow';
const agent = new AgenticFlow('coder', {
reasoningBank: {
enabled: true,
dbPath: process.env.HOME + '/.swarm/memory.db',
minConfidence: 0.7
}
});
// Agent automatically uses ReasoningBank patterns
await agent.execute({ task: 'Implement JWT auth' });
# Load patterns as context
npx claude-flow@alpha memory query "authentication patterns" > context.json
# Use in Claude Code
claude code --context context.json "Implement auth"
const Database = require('better-sqlite3');
const db = new Database(process.env.HOME + '/.swarm/memory.db');
const patterns = db.prepare(`
SELECT * FROM patterns
WHERE domain = ? AND confidence > 0.8
ORDER BY success_rate DESC
LIMIT 10
`).all('api-development');
All models meet or exceed these criteria:
| Metric | Target | All Models |
|---|---|---|
| Query Latency | <5ms | ā 0.05-2ms |
| Storage | <10 KB/pattern | ā 2-6 KB/pattern |
| Confidence | >70% | ā 83-91% |
| Embedding Coverage | 100% | ā 100% |
All models are MIT licensed and free to use in commercial and non-commercial projects.
Want to contribute a model? See HOW-TO-TRAIN.md and submit a PR!
Model submission requirements:
70% average confidence
Happy reasoning! š§ āØ
"The best AI doesn't just answer questions - it learns from experience."