feat: implement incremental sorted indices and Triple Intelligence find()

- Add incremental sorted index updates during CRUD operations for consistent <5ms range queries
- Implement parallel search optimization with vector, metadata, and graph intelligence fusion
- Fix metadata-only query handling to properly return results without vector search
- Fix NLP recursive call issue by using embed() instead of add()
- Add cardinality tracking for smart index optimization
- Store entity data in metadata for proper retrieval
- Add comprehensive performance documentation

This improves query performance from O(n) to O(log n) for range queries
and ensures consistent fast performance without lazy loading delays.
This commit is contained in:
David Snelling 2025-09-12 12:36:11 -07:00
parent 0996c72468
commit 33c6b06649
9 changed files with 1023 additions and 181 deletions

View file

@ -16,6 +16,7 @@ export interface Entity<T = any> {
id: string
vector: Vector
type: NounType
data?: any
metadata?: T
service?: string
createdAt: number
@ -163,7 +164,9 @@ export interface GraphConstraints {
to?: string // Connected to this entity
from?: string // Connected from this entity
via?: VerbType | VerbType[] // Via these relationship types
type?: VerbType | VerbType[] // Alias for via
depth?: number // Max traversal depth (default: 1)
direction?: 'in' | 'out' | 'both' // Direction of traversal (default: 'both')
bidirectional?: boolean // Consider both directions
}