Learn how to persist embeddings between restarts using storage adapters.Documentation Index
Fetch the complete documentation index at: https://docs.agentfront.dev/llms.txt
Use this file to discover all available pages before exploring further.
By default, VectoriaDB stores embeddings in memory. Use a storage adapter to persist them between server restarts.
Storage Adapters
| Adapter | Use Case | Persistence |
|---|---|---|
MemoryStorageAdapter | Development, testing | None (default) |
FileStorageAdapter | Single-server deployment | Local disk |
RedisStorageAdapter | Multi-pod deployment | Shared cache |
Quick Start
src/storage-quickstart.ts
How Persistence Works
- Initialize: VectoriaDB checks for cached data
- Validate: Cache is validated against
toolsHash,version, andmodelName - Load or Index: Valid cache is loaded; otherwise re-indexing occurs
- Save: Call
saveToStorage()to persist changes
Cache Invalidation
VectoriaDB automatically invalidates the cache when documents change:src/cache-invalidation.ts
Validation Checks
Oninitialize(), VectoriaDB checks:
- Does the cache file/key exist?
- Does
toolsHashmatch? - Does
versionmatch? - Does
modelNamematch?
Manual Storage Operations
src/manual-storage.ts
Multi-Tenant Isolation
Use namespaces to isolate different indexes:src/multi-tenant.ts
Choosing an Adapter
File Adapter
Single-server deployments
Redis Adapter
Multi-pod environments
Memory Adapter
Development and testing
Related
Cache Invalidation
Advanced cache control
Deployment
Production configuration