brainy/src/patterns/additional-patterns.json

638 lines
20 KiB
JSON
Raw Normal View History

🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ MAJOR RELEASE: Complete evolution of Brainy with groundbreaking features and performance. 🎯 KEY FEATURES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ✨ Triple Intelligence™ Engine - Unified Vector + Metadata + Graph search - O(log n) performance on all operations - 3ms average search latency at any scale ✨ API Consolidation - 15+ search methods → 2 clean APIs - search() for vector similarity - find() for natural language queries ✨ Natural Language Processing - 220+ pre-computed NLP patterns - Instant context understanding - "Show me recent React components with tests" ✨ Zero Configuration - Works instantly, no setup required - Built-in embedding models (no API keys) - Smart defaults for everything - Automatic optimization ✨ Enterprise Features (Free for Everyone) - Scales to 10M+ items - Write-Ahead Logging (WAL) for durability - Distributed architecture with sharding - Read/write separation - Connection pooling & request deduplication - Built-in monitoring & health checks ✨ Universal Compatibility - Node.js, Browser, Edge Workers - 4 Storage Adapters (Memory, FileSystem, OPFS, S3) - TypeScript with full type safety - Worker-based embeddings 📦 WHAT'S INCLUDED: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Core AI Database with HNSW indexing • 19 Production-ready augmentations • Universal Memory Manager • Complete CLI with all commands • Brain Cloud integration (soulcraft.com) • Comprehensive documentation • 52 test files with 400+ tests • Migration guide from 1.x 📊 PERFORMANCE: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Initialize: 450ms (24MB memory) • Search: 3ms average (up to 10M items) • Metadata Filter: 0.8ms (O(log n)) • Bulk Import: 2.3s per 1000 items • Production Scale: 5.8ms at 10M items 🔧 TECHNICAL IMPROVEMENTS: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • TypeScript compilation: 153 errors → 0 • Memory usage: 200MB → 24MB baseline • Circular dependencies resolved • Worker thread communication fixed • Storage adapter consistency • Request coalescing for 3x performance 🛠️ CLI FEATURES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • brainy add - Smart data ingestion • brainy find - Natural language search • brainy search - Vector similarity • brainy chat - AI conversation mode • brainy cloud - Brain Cloud integration • brainy augment - Manage extensions • 100% API compatibility 📚 DOCUMENTATION: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Professional README with examples • Quick Start guide (5 minutes) • Enterprise Features guide • Migration guide from 1.x • API reference • Architecture documentation 🌟 USE CASES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • AI memory layer for chatbots • Semantic document search • Code intelligence platforms • Knowledge management systems • Real-time recommendation engines • Customer support automation MIT License - Enterprise features included free for everyone. No premium tiers, no paywalls, no limits. Built with ❤️ by the Brainy community. Visit https://soulcraft.com for Brain Cloud integration.
2025-08-26 12:32:21 -07:00
{
"version": "2.0.0",
"description": "Additional patterns to improve coverage to 90%+",
"patterns": [
{
"id": "synonym_find",
"category": "navigational",
"examples": ["find machine learning papers", "locate AI research", "get neural network docs"],
"pattern": "(?:find|locate|get|fetch|retrieve)\\s+(.+)",
"template": { "like": "${1}" },
"confidence": 0.9
},
{
"id": "synonym_show",
"category": "navigational",
"examples": ["show me recent papers", "display all results", "list available options"],
"pattern": "(?:show\\s+me|display|list|view)\\s+(.+)",
"template": { "like": "${1}" },
"confidence": 0.88
},
{
"id": "who_created",
"category": "relational",
"examples": ["who created React", "who wrote this paper", "who invented the internet"],
"pattern": "who\\s+(?:created|wrote|invented|developed|made)\\s+(.+)",
"template": {
"like": "${1}",
"connected": { "relationship": "creator" }
},
"confidence": 0.92
},
{
"id": "when_temporal",
"category": "temporal",
"examples": ["when was Python created", "when did AI start"],
"pattern": "when\\s+(?:was|did|were)\\s+(.+?)\\s+(?:created|started|invented|published)",
"template": {
"like": "${1}",
"where": { "date": { "exists": true } }
},
"confidence": 0.85
},
{
"id": "where_location",
"category": "spatial",
"examples": ["where is Stanford University", "where can I find documentation"],
"pattern": "where\\s+(?:is|are|can\\s+I\\s+find)\\s+(.+)",
"template": {
"like": "${1}",
"where": { "location": { "exists": true } }
},
"confidence": 0.83
},
{
"id": "comparison_vs",
"category": "comparative",
"examples": ["Python vs JavaScript", "React vs Vue", "TensorFlow vs PyTorch"],
"pattern": "(.+?)\\s+vs\\.?\\s+(.+)",
"template": {
"like": "${1} ${2}",
"boost": "comparison"
},
"confidence": 0.9
},
{
"id": "difference_between",
"category": "comparative",
"examples": ["difference between AI and ML", "what's the difference between React and Angular"],
"pattern": "(?:difference|differences)\\s+between\\s+(.+?)\\s+and\\s+(.+)",
"template": {
"like": "${1} ${2} comparison",
"boost": "comparison"
},
"confidence": 0.88
},
{
"id": "similar_to",
"category": "relational",
"examples": ["similar to Python", "papers like this one", "alternatives to React"],
"pattern": "(?:similar\\s+to|like|alternatives?\\s+to)\\s+(.+)",
"template": {
"like": "${1}",
"boost": "similarity"
},
"confidence": 0.87
},
{
"id": "action_download",
"category": "transactional",
"examples": ["download Python", "download the dataset", "get the PDF"],
"pattern": "(?:download|get|fetch)\\s+(?:the\\s+)?(.+?)\\s*(?:pdf|file|document|dataset)?",
"template": {
"like": "${1}",
"where": { "downloadable": true }
},
"confidence": 0.85
},
{
"id": "action_create",
"category": "transactional",
"examples": ["create new project", "make a new document", "generate report"],
"pattern": "(?:create|make|generate|build)\\s+(?:new\\s+)?(.+)",
"template": {
"like": "${1} template",
"boost": "tutorial"
},
"confidence": 0.82
},
{
"id": "how_many",
"category": "aggregation",
"examples": ["how many papers about AI", "count of documents"],
"pattern": "(?:how\\s+many|count\\s+of|number\\s+of)\\s+(.+)",
"template": {
"like": "${1}",
"aggregate": "count"
},
"confidence": 0.9
},
{
"id": "average_of",
"category": "aggregation",
"examples": ["average citations", "mean score", "median value"],
"pattern": "(?:average|mean|median)\\s+(?:of\\s+)?(.+)",
"template": {
"like": "${1}",
"aggregate": "average"
},
"confidence": 0.85
},
{
"id": "tutorial_howto",
"category": "informational",
"examples": ["tutorial on machine learning", "guide to Python", "how to use React"],
"pattern": "(?:tutorial|guide|how\\s+to\\s+use)\\s+(?:on|to|for)?\\s*(.+)",
"template": {
"like": "${1} tutorial",
"boost": "educational"
},
"confidence": 0.92
},
{
"id": "documentation_for",
"category": "informational",
"examples": ["documentation for React", "docs on Python", "API reference"],
"pattern": "(?:documentation|docs|reference|manual)\\s+(?:for|on|about)?\\s*(.+)",
"template": {
"like": "${1} documentation",
"where": { "type": "documentation" }
},
"confidence": 0.93
},
{
"id": "research_on",
"category": "academic",
"examples": ["research on AI safety", "papers about climate change", "studies on COVID"],
"pattern": "(?:research|papers?|studies)\\s+(?:on|about)\\s+(.+)",
"template": {
"like": "${1}",
"where": { "type": "academic" }
},
"confidence": 0.91
},
{
"id": "latest_newest",
"category": "temporal",
"examples": ["latest research", "newest papers", "most recent updates"],
"pattern": "(?:latest|newest|most\\s+recent|current)\\s+(.+)",
"template": {
"like": "${1}",
"boost": "recent"
},
"confidence": 0.89
},
{
"id": "last_period",
"category": "temporal",
"examples": ["last week", "past month", "previous year"],
"pattern": "(?:last|past|previous)\\s+(week|month|year|day)",
"template": {
"where": {
"date": {
"after": "${1}_ago"
}
}
},
"confidence": 0.87
},
{
"id": "between_dates",
"category": "temporal",
"examples": ["between 2020 and 2023", "from January to March"],
"pattern": "between\\s+(\\d{4}|\\w+)\\s+(?:and|to)\\s+(\\d{4}|\\w+)",
"template": {
"where": {
"date": {
"between": ["${1}", "${2}"]
}
}
},
"confidence": 0.86
},
{
"id": "conversational_need",
"category": "conversational",
"examples": ["I need help with Python", "I want to learn React", "I'm looking for AI papers"],
"pattern": "(?:I\\s+need|I\\s+want|I'm\\s+looking\\s+for)\\s+(.+)",
"template": {
"like": "${1}"
},
"confidence": 0.85
},
{
"id": "conversational_can_you",
"category": "conversational",
"examples": ["can you find papers", "could you show me", "would you search for"],
"pattern": "(?:can|could|would)\\s+you\\s+(?:find|show|search|get)\\s+(?:me\\s+)?(.+)",
"template": {
"like": "${1}"
},
"confidence": 0.84
},
{
"id": "tell_me_about",
"category": "informational",
"examples": ["tell me about machine learning", "explain neural networks"],
"pattern": "(?:tell\\s+me\\s+about|explain|describe)\\s+(.+)",
"template": {
"like": "${1}",
"boost": "educational"
},
"confidence": 0.88
},
{
"id": "is_there_any",
"category": "existence",
"examples": ["is there any research on", "are there any papers about"],
"pattern": "(?:is|are)\\s+there\\s+(?:any\\s+)?(.+?)\\s+(?:on|about|for)\\s+(.+)",
"template": {
"like": "${2} ${1}"
},
"confidence": 0.83
},
{
"id": "with_without",
"category": "filtering",
"examples": ["papers with citations", "results without errors", "documents with images"],
"pattern": "(.+?)\\s+(with|without)\\s+(.+)",
"template": {
"like": "${1}",
"where": {
"${3}": { "exists": true }
}
},
"confidence": 0.85
},
{
"id": "and_but_not",
"category": "combined",
"examples": ["AI and ML but not deep learning", "Python and Django but not Flask"],
"pattern": "(.+?)\\s+and\\s+(.+?)\\s+but\\s+not\\s+(.+)",
"template": {
"like": "${1} ${2}",
"where": {
"not": "${3}"
}
},
"confidence": 0.82
},
{
"id": "all_that_have",
"category": "filtering",
"examples": ["all papers that have citations", "all documents that contain"],
"pattern": "all\\s+(.+?)\\s+that\\s+(?:have|contain|include)\\s+(.+)",
"template": {
"like": "${1}",
"where": {
"${2}": { "exists": true }
}
},
"confidence": 0.86
},
{
"id": "starting_with",
"category": "filtering",
"examples": ["starting with A", "beginning with chapter", "ending with PDF"],
"pattern": "(.+?)\\s+(?:starting|beginning|ending)\\s+with\\s+(.+)",
"template": {
"like": "${1}",
"where": {
"pattern": "${2}"
}
},
"confidence": 0.84
},
{
"id": "source_code",
"category": "technical",
"examples": ["source code for React", "GitHub repository", "code examples"],
"pattern": "(?:source\\s+code|github|repository|code\\s+examples?)\\s+(?:for|of)?\\s*(.+)",
"template": {
"like": "${1} code",
"where": { "type": "code" }
},
"confidence": 0.87
},
{
"id": "api_endpoint",
"category": "technical",
"examples": ["API endpoint for users", "REST API documentation", "GraphQL schema"],
"pattern": "(?:API|REST|GraphQL)\\s+(?:endpoint|documentation|schema)\\s+(?:for)?\\s*(.+)",
"template": {
"like": "${1} API",
"where": { "type": "api" }
},
"confidence": 0.89
},
{
"id": "example_of",
"category": "informational",
"examples": ["example of machine learning", "sample code", "demo application"],
"pattern": "(?:example|sample|demo)\\s+(?:of|for)?\\s*(.+)",
"template": {
"like": "${1} example",
"boost": "educational"
},
"confidence": 0.86
},
{
"id": "definition_of",
"category": "informational",
"examples": ["definition of AI", "what does ML mean", "meaning of neural network"],
"pattern": "(?:definition\\s+of|what\\s+does\\s+(.+?)\\s+mean|meaning\\s+of)\\s*(.+)",
"template": {
"like": "${1}${2} definition",
"boost": "educational"
},
"confidence": 0.91
},
{
"id": "benchmark_performance",
"category": "comparative",
"examples": ["benchmark results", "performance comparison", "speed test"],
"pattern": "(?:benchmark|performance|speed\\s+test)\\s+(?:results?|comparison)?\\s*(?:for|of)?\\s*(.+)",
"template": {
"like": "${1} benchmark",
"where": { "type": "benchmark" }
},
"confidence": 0.85
},
{
"id": "price_cost",
"category": "commercial",
"examples": ["price of AWS", "cost of hosting", "pricing for services"],
"pattern": "(?:price|cost|pricing)\\s+(?:of|for)\\s+(.+)",
"template": {
"like": "${1} pricing",
"where": { "type": "commercial" }
},
"confidence": 0.88
},
{
"id": "free_open_source",
"category": "commercial",
"examples": ["free alternatives to", "open source version", "free tools for"],
"pattern": "(?:free|open\\s+source)\\s+(?:alternatives?\\s+to|version\\s+of|tools?\\s+for)\\s+(.+)",
"template": {
"like": "${1}",
"where": { "license": "free" }
},
"confidence": 0.87
},
{
"id": "step_by_step",
"category": "informational",
"examples": ["step by step guide", "walkthrough", "detailed instructions"],
"pattern": "(?:step\\s+by\\s+step|walkthrough|detailed\\s+instructions)\\s+(?:for|on)?\\s*(.+)",
"template": {
"like": "${1} tutorial detailed",
"boost": "educational"
},
"confidence": 0.9
},
{
"id": "pros_cons",
"category": "comparative",
"examples": ["pros and cons of React", "advantages of Python", "benefits of AI"],
"pattern": "(?:pros\\s+and\\s+cons|advantages?|benefits?|disadvantages?)\\s+(?:of|for)\\s+(.+)",
"template": {
"like": "${1} analysis",
"boost": "comparison"
},
"confidence": 0.86
},
{
"id": "use_cases",
"category": "informational",
"examples": ["use cases for blockchain", "applications of AI", "when to use React"],
"pattern": "(?:use\\s+cases?|applications?|when\\s+to\\s+use)\\s+(?:for|of)?\\s*(.+)",
"template": {
"like": "${1} applications",
"boost": "practical"
},
"confidence": 0.88
},
{
"id": "troubleshoot_fix",
"category": "technical",
"examples": ["troubleshoot Python error", "fix React issue", "solve problem with"],
"pattern": "(?:troubleshoot|fix|solve|debug|resolve)\\s+(.+?)\\s*(?:error|issue|problem|bug)?",
"template": {
"like": "${1} solution",
"where": { "type": "troubleshooting" }
},
"confidence": 0.87
},
{
"id": "compatible_with",
"category": "technical",
"examples": ["compatible with Python 3", "works with React", "supports Windows"],
"pattern": "(?:compatible\\s+with|works\\s+with|supports)\\s+(.+)",
"template": {
"like": "${1} compatibility",
"where": { "compatibility": "${1}" }
},
"confidence": 0.85
},
{
"id": "version_specific",
"category": "technical",
"examples": ["React version 18", "Python 3.11", "Node.js v20"],
"pattern": "(.+?)\\s+version\\s+(\\d+(?:\\.\\d+)*)",
"template": {
"like": "${1}",
"where": { "version": "${2}" }
},
"confidence": 0.9
},
{
"id": "cheat_sheet",
"category": "informational",
"examples": ["cheat sheet for Python", "quick reference", "cheatsheet React"],
"pattern": "(?:cheat\\s*sheet|quick\\s+reference|reference\\s+card)\\s+(?:for)?\\s*(.+)",
"template": {
"like": "${1} cheatsheet",
"boost": "educational"
},
"confidence": 0.91
},
{
"id": "getting_started",
"category": "informational",
"examples": ["getting started with React", "introduction to Python", "beginner guide"],
"pattern": "(?:getting\\s+started|introduction|beginner'?s?\\s+guide)\\s+(?:with|to|for)?\\s*(.+)",
"template": {
"like": "${1} beginner",
"boost": "educational"
},
"confidence": 0.92
},
{
"id": "advanced_expert",
"category": "informational",
"examples": ["advanced Python techniques", "expert guide", "pro tips for"],
"pattern": "(?:advanced|expert|pro\\s+tips?)\\s+(?:techniques?|guide)?\\s*(?:for|on)?\\s*(.+)",
"template": {
"like": "${1} advanced",
"boost": "expert"
},
"confidence": 0.87
},
{
"id": "list_of_all",
"category": "aggregation",
"examples": ["list of all features", "all available options", "complete list"],
"pattern": "(?:list\\s+of\\s+all|all\\s+available|complete\\s+list)\\s+(.+)",
"template": {
"like": "${1}",
"limit": 1000
},
"confidence": 0.88
},
{
"id": "trending_popular",
"category": "temporal",
"examples": ["trending topics", "popular papers", "hot discussions"],
"pattern": "(?:trending|popular|hot|viral)\\s+(.+)",
"template": {
"like": "${1}",
"boost": "popular"
},
"confidence": 0.86
},
{
"id": "under_development",
"category": "temporal",
"examples": ["under development", "coming soon", "in progress"],
"pattern": "(?:under\\s+development|coming\\s+soon|in\\s+progress|upcoming)\\s*(.+)?",
"template": {
"like": "${1}",
"where": { "status": "development" }
},
"confidence": 0.84
},
{
"id": "deprecated_obsolete",
"category": "temporal",
"examples": ["deprecated features", "obsolete methods", "legacy code"],
"pattern": "(?:deprecated|obsolete|legacy|outdated)\\s+(.+)",
"template": {
"like": "${1}",
"where": { "status": "deprecated" }
},
"confidence": 0.85
},
{
"id": "migration_upgrade",
"category": "technical",
"examples": ["migrate from React 17 to 18", "upgrade guide", "migration path"],
"pattern": "(?:migrate|upgrade|migration\\s+path)\\s+(?:from\\s+)?(.+?)\\s+(?:to\\s+(.+))?",
"template": {
"like": "${1} ${2} migration",
"where": { "type": "migration" }
},
"confidence": 0.86
},
{
"id": "industry_sector",
"category": "domain",
"examples": ["fintech applications", "healthcare AI", "education technology"],
"pattern": "(?:fintech|healthcare|education|finance|medical|legal|retail)\\s+(.+)",
"template": {
"like": "${1}",
"where": { "industry": "${0}" }
},
"confidence": 0.85
},
{
"id": "security_vulnerability",
"category": "technical",
"examples": ["security issues", "vulnerability in", "CVE for"],
"pattern": "(?:security|vulnerability|CVE)\\s+(?:issues?|in|for)?\\s*(.+)",
"template": {
"like": "${1} security",
"where": { "type": "security" }
},
"confidence": 0.89
},
{
"id": "performance_optimization",
"category": "technical",
"examples": ["optimize React performance", "speed up Python", "improve efficiency"],
"pattern": "(?:optimize|speed\\s+up|improve\\s+efficiency)\\s+(?:of)?\\s*(.+?)\\s*(?:performance)?",
"template": {
"like": "${1} optimization",
"boost": "performance"
},
"confidence": 0.87
},
{
"id": "integration_with",
"category": "technical",
"examples": ["integrate React with Redux", "connect Python to database"],
"pattern": "(?:integrate|connect|interface)\\s+(.+?)\\s+(?:with|to)\\s+(.+)",
"template": {
"like": "${1} ${2} integration",
"where": { "type": "integration" }
},
"confidence": 0.86
},
{
"id": "alternative_instead",
"category": "comparative",
"examples": ["instead of React", "alternative to Python", "replacement for"],
"pattern": "(?:instead\\s+of|alternative\\s+to|replacement\\s+for|substitute\\s+for)\\s+(.+)",
"template": {
"like": "${1} alternative",
"boost": "comparison"
},
"confidence": 0.88
},
{
"id": "based_on",
"category": "relational",
"examples": ["based on React", "built with Python", "powered by"],
"pattern": "(?:based\\s+on|built\\s+with|powered\\s+by|using)\\s+(.+)",
"template": {
"like": "${1}",
"connected": { "technology": "${1}" }
},
"confidence": 0.85
},
{
"id": "requires_needs",
"category": "technical",
"examples": ["requires Python 3", "needs Node.js", "dependencies for"],
"pattern": "(?:requires?|needs?|dependencies\\s+for)\\s+(.+)",
"template": {
"like": "${1} requirements",
"where": { "requirements": "${1}" }
},
"confidence": 0.86
},
{
"id": "official_docs",
"category": "navigational",
"examples": ["official React documentation", "official Python site"],
"pattern": "official\\s+(.+?)\\s*(?:documentation|docs|site|website)?",
"template": {
"like": "${1} official",
"where": { "official": true }
},
"confidence": 0.93
},
{
"id": "community_forum",
"category": "navigational",
"examples": ["React community", "Python forum", "Discord server for"],
"pattern": "(?:community|forum|discord|slack|discussion)\\s+(?:for)?\\s*(.+)",
"template": {
"like": "${1} community",
"where": { "type": "community" }
},
"confidence": 0.84
},
{
"id": "roadmap_timeline",
"category": "temporal",
"examples": ["roadmap for React", "timeline of AI development", "history of Python"],
"pattern": "(?:roadmap|timeline|history)\\s+(?:for|of)\\s+(.+)",
"template": {
"like": "${1} roadmap",
"boost": "timeline"
},
"confidence": 0.85
}
]
}