Storage Adapters
| Adapter | Use Case | Persistence |
|---|---|---|
MemoryStorageAdapter | Development, testing | None (default) |
FileStorageAdapter | Single-server deployment | Local disk |
RedisStorageAdapter | Multi-pod deployment | Shared cache |
- File Adapter
- Redis Adapter
- Memory Adapter
Persist embeddings to local disk:
File Adapter Options
| Option | Type | Default | Description |
|---|---|---|---|
cacheDir | string | ./.cache/vectoriadb | Directory for cache files |
namespace | string | 'default' | Namespace for isolation |
Cache Invalidation
VectoriaDB automatically invalidates the cache when documents change. UsetoolsHash and version to control invalidation:
How Invalidation Works
Oninitialize(), VectoriaDB checks:
- Does the cache file/key exist?
- Does
toolsHashmatch? - Does
versionmatch? - Does
modelNamematch?
Warm-up Pattern
Common pattern for production deployments:Manual Storage Operations
Multi-Tenant Isolation
Use namespaces to isolate different indexes:Error Handling
Related
Overview
Getting started
HNSW
Scaling with HNSW index
Indexing
Adding documents