feat: add plugin system for cortex and storage adapters
Simple plugin architecture with two use cases: 1. Native acceleration (@soulcraft/brainy-cortex) — auto-detected 2. Custom storage adapters (e.g., Redis, DynamoDB) Plugins implement BrainyPlugin interface with activate/deactivate lifecycle. Auto-detection tries dynamic import of known packages during init(). Manual registration via brain.use(plugin) before init(). Provider keys: metadataIndex, graphIndex, entityIdMapper, cache, hnsw, roaring, embeddings, distance, msgpack, storage:<name>
This commit is contained in:
parent
35cb674157
commit
cc50ac3776
3 changed files with 246 additions and 1 deletions
|
|
@ -109,6 +109,10 @@ export {
|
|||
// Export version utilities
|
||||
export { getBrainyVersion } from './utils/version.js'
|
||||
|
||||
// Export plugin system
|
||||
export type { BrainyPlugin, BrainyPluginContext, StorageAdapterFactory } from './plugin.js'
|
||||
export { PluginRegistry } from './plugin.js'
|
||||
|
||||
// Export embedding functionality
|
||||
import {
|
||||
UniversalSentenceEncoder,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue