feat: modernize API architecture and deprecation handling

- Modernize BrainyInterface to only contain current API methods (add, relate, find, get)
- Update all interface consumers to use modern API patterns
- Make Brainy class implement clean modernized interface
- Update CLI commands to use add() and relate() instead of deprecated methods
- Update all source code components to use modern API consistently
- Update examples and integration tests to modern patterns
- Improve architectural consistency across the entire codebase

BREAKING: BrainyInterface no longer contains deprecated methods
Migration: Use add() instead of addNoun(), relate() instead of addVerb()
This commit is contained in:
David Snelling 2025-09-17 11:54:20 -07:00
parent 2128ef5607
commit 1b32870e43
11 changed files with 89 additions and 84 deletions

View file

@ -41,12 +41,15 @@ import {
BrainyConfig
} from './types/brainy.types.js'
import { NounType, VerbType } from './types/graphTypes.js'
import { BrainyInterface } from './types/brainyDataInterface.js'
/**
* The main Brainy class - Clean, Beautiful, Powerful
* REAL IMPLEMENTATION - No stubs, no mocks
*
* Implements BrainyInterface to ensure consistency across integrations
*/
export class Brainy<T = any> {
export class Brainy<T = any> implements BrainyInterface<T> {
// Core components
private index!: HNSWIndex | HNSWIndexOptimized
private storage!: StorageAdapter
@ -1707,7 +1710,7 @@ export class Brainy<T = any> {
/**
* Embed data into vector
*/
private async embed(data: any): Promise<Vector> {
async embed(data: any): Promise<Vector> {
return this.embedder(data)
}