VectoriaConfig
Main configuration interface for VectoriaDB constructor.interface VectoriaConfig {
/**
* Name of the embedding model to use
* @default 'Xenova/all-MiniLM-L6-v2'
*/
modelName?: string;
/**
* Directory to cache downloaded models
* @default './.cache/transformers'
*/
cacheDir?: string;
/**
* Vector dimensions (auto-detected from model if not provided)
*/
dimensions?: number;
/**
* Default similarity threshold for search results
* @default 0.3
*/
defaultSimilarityThreshold?: number;
/**
* Maximum number of results to return by default
* @default 10
*/
defaultTopK?: number;
/**
* Enable HNSW index for faster search
* @default false
*/
useHNSW?: boolean;
/**
* HNSW index configuration
*/
hnsw?: HNSWConfig;
/**
* Storage adapter for persisting embeddings
* @default MemoryStorageAdapter
*/
storageAdapter?: StorageAdapter;
/**
* Tools hash for cache invalidation
*/
toolsHash?: string;
/**
* Version string for cache compatibility
* @default '1.0.0'
*/
version?: string;
/**
* Maximum number of documents allowed
* @default 100000
*/
maxDocuments?: number;
/**
* Maximum size of a single document text (in characters)
* @default 1000000
*/
maxDocumentSize?: number;
/**
* Maximum number of documents in a single batch
* @default 1000
*/
maxBatchSize?: number;
/**
* Enable verbose error messages
* @default true
*/
verboseErrors?: boolean;
}
HNSWConfig
Configuration for HNSW indexing.interface HNSWConfig {
/**
* Maximum connections per node in layer > 0
* @default 16
*/
M?: number;
/**
* Maximum connections for layer 0
* @default 32
*/
M0?: number;
/**
* Candidate list size during construction
* @default 200
*/
efConstruction?: number;
/**
* Candidate list size during search
* @default 50
*/
efSearch?: number;
}
StorageAdapterConfig
Base configuration for storage adapters.interface StorageAdapterConfig {
/**
* Namespace for storage keys
*/
namespace?: string;
/**
* Whether to automatically save on changes
* @default false
*/
autoSave?: boolean;
/**
* Interval for auto-save in milliseconds
* @default 60000
*/
autoSaveInterval?: number;
}
Related
Constructor
Using config
Documents
Document interfaces
Search
Search interfaces