CRITICAL CHECKPOINT - DO NOT PUSH TO GITHUB Recovery Status: - Successfully recovered brainy.ts from compiled JavaScript - All core v3.0 API methods functional (add, get, update, delete, relate, find, etc.) - Neural subsystem intact (562KB embedded patterns, NLP working) - Augmentation pipeline operational (20+ augmentations) - HNSW clustering system complete - Triple Intelligence compiled (needs constructor fix) - Test suite validates functionality Changes preserved: - 898 files with changes from last 3 days - 144,475 insertions - All augmentation improvements - All test coverage enhancements - Complete v3.0 feature set This is a LOCAL checkpoint only - contains recovered work after corruption incident. Created backup in .backups/brainy-full-20250910-151314.tar.gz Branch: recovery-checkpoint-20250910-151433 Date: Wed Sep 10 03:18:04 PM PDT 2025
35 lines
1.2 KiB
TypeScript
35 lines
1.2 KiB
TypeScript
/**
|
|
* Static Pattern Matcher - NO runtime initialization, NO Brainy needed
|
|
*
|
|
* All patterns and embeddings are pre-computed at build time
|
|
* This is pure pattern matching with zero dependencies
|
|
*/
|
|
import { EMBEDDED_PATTERNS } from './embeddedPatterns.js';
|
|
import type { Vector } from '../coreTypes.js';
|
|
import type { TripleQuery } from '../triple/TripleIntelligence.js';
|
|
/**
|
|
* Match query against all patterns using embeddings
|
|
*/
|
|
export declare function findBestPatterns(queryEmbedding: Vector, k?: number): Array<{
|
|
pattern: typeof EMBEDDED_PATTERNS[0];
|
|
similarity: number;
|
|
}>;
|
|
/**
|
|
* Match query against patterns using regex
|
|
*/
|
|
export declare function matchPatternByRegex(query: string): {
|
|
pattern: typeof EMBEDDED_PATTERNS[0];
|
|
slots: Record<string, string>;
|
|
query: TripleQuery;
|
|
} | null;
|
|
/**
|
|
* Convert natural language to structured query using STATIC patterns
|
|
* NO initialization needed, NO Brainy required
|
|
*/
|
|
export declare function patternMatchQuery(query: string, queryEmbedding?: Vector): TripleQuery;
|
|
export declare const PATTERN_STATS: {
|
|
totalPatterns: number;
|
|
categories: string[];
|
|
domains: string[];
|
|
hasEmbeddings: boolean;
|
|
};
|