File size: 2,936 Bytes
40d7073
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/**
 * ruvector - High-performance vector database for Node.js
 *
 * This package automatically detects and uses the best available implementation:
 * 1. Native (Rust-based, fastest) - if available for your platform
 * 2. RVF (persistent store) - if @ruvector/rvf is installed
 * 3. Stub (testing fallback) - limited functionality
 *
 * Also provides safe wrappers for GNN and Attention modules that handle
 * array type conversions automatically.
 */
export * from './types';
export * from './core';
export * from './services';
declare let implementation: any;
/**
 * Get the current implementation type
 */
export declare function getImplementationType(): 'native' | 'rvf' | 'wasm';
/**
 * Check if native implementation is being used
 */
export declare function isNative(): boolean;
/**
 * Check if RVF implementation is being used
 */
export declare function isRvf(): boolean;
/**
 * Check if stub/fallback implementation is being used
 */
export declare function isWasm(): boolean;
/**
 * Get version information
 */
export declare function getVersion(): {
    version: string;
    implementation: string;
};
/**
 * Wrapper class that automatically handles metadata JSON conversion
 */
declare class VectorDBWrapper {
    private db;
    constructor(options: {
        dimensions: number;
        storagePath?: string;
        distanceMetric?: string;
        hnswConfig?: any;
    });
    /**
     * Insert a vector with optional metadata (objects are auto-converted to JSON)
     */
    insert(entry: {
        id?: string;
        vector: Float32Array | number[];
        metadata?: Record<string, any>;
    }): Promise<string>;
    /**
     * Insert multiple vectors in batch
     */
    insertBatch(entries: Array<{
        id?: string;
        vector: Float32Array | number[];
        metadata?: Record<string, any>;
    }>): Promise<string[]>;
    /**
     * Search for similar vectors (metadata is auto-parsed from JSON)
     */
    search(query: {
        vector: Float32Array | number[];
        k: number;
        filter?: Record<string, any>;
        efSearch?: number;
    }): Promise<Array<{
        id: string;
        score: number;
        vector?: Float32Array;
        metadata?: Record<string, any>;
    }>>;
    /**
     * Get a vector by ID (metadata is auto-parsed from JSON)
     */
    get(id: string): Promise<{
        id?: string;
        vector: Float32Array;
        metadata?: Record<string, any>;
    } | null>;
    /**
     * Delete a vector by ID
     */
    delete(id: string): Promise<boolean>;
    /**
     * Get the number of vectors in the database
     */
    len(): Promise<number>;
    /**
     * Check if the database is empty
     */
    isEmpty(): Promise<boolean>;
}
export declare const VectorDb: typeof VectorDBWrapper;
export declare const VectorDB: typeof VectorDBWrapper;
export declare const NativeVectorDb: any;
export default implementation;
//# sourceMappingURL=index.d.ts.map