UNPKG

@codai/cbd

Version:

Codai Better Database - High-Performance Vector Memory System with HPKV-inspired architecture and MCP server

100 lines 2.88 kB
/** * Enterprise CBD Engine TypeScript Wrapper * * This module provides a TypeScript interface to the high-performance Rust CBD engine. * It maintains compatibility with existing TypeScript code while leveraging Rust performance. */ export interface EnterpriseConfig { useRustEngine?: boolean; storageBackend?: 'typescript' | 'rust-rocksdb'; vectorBackend?: 'typescript' | 'rust-hnsw'; enableTransactions?: boolean; enableClustering?: boolean; enableMetrics?: boolean; } export interface VectorSearchResult { key: string; score: number; metadata?: any; } export interface EngineStats { storage: any; vector_index: any; metrics: any; timestamp: string; } export interface HealthStatus { status: 'healthy' | 'unhealthy'; storage: any; vector_index: any; timestamp: string; } /** * Enterprise CBD Engine - Hybrid TypeScript/Rust Implementation * * This class provides enterprise-grade database capabilities by combining * the existing TypeScript implementation with high-performance Rust core. */ export declare class EnterpriseCBDEngine { private config; private tsEngine; private logger; private initialized; constructor(config?: EnterpriseConfig); /** * Initialize the enterprise engine */ initialize(): Promise<void>; /** * Store a key-value pair */ store(key: string, value: Buffer): Promise<void>; /** * Retrieve a value by key */ retrieve(key: string): Promise<Buffer | null>; /** * Store a vector with metadata */ storeVector(key: string, vector: number[], metadata?: any): Promise<void>; /** * Search for similar vectors */ searchVectors(query: number[], k?: number, threshold?: number): Promise<VectorSearchResult[]>; /** * Get engine health status */ healthCheck(): Promise<HealthStatus>; /** * Get engine statistics */ getStats(): Promise<EngineStats>; /** * Search memory (compatibility with existing TypeScript API) */ searchMemory(query: string, limit?: number): Promise<any[]>; /** * Get memory by key (compatibility with existing TypeScript API) */ getMemory(key: string): Promise<any>; /** * Store memory (compatibility with existing TypeScript API) */ storeMemory(key: string, content: string, metadata?: any): Promise<void>; /** * Check if engine is using Rust backend */ isUsingRustEngine(): boolean; /** * Get engine configuration */ getConfig(): EnterpriseConfig; /** * Ensure engine is initialized */ private ensureInitialized; } export declare const enterpriseEngine: EnterpriseCBDEngine; export { CBDMemoryEngine } from './memory/MemoryEngine.js'; export * from './types/index.js'; //# sourceMappingURL=enterprise.d.ts.map