When to Use
UseFileStorageAdapter when:
- Running on a single server
- You have writable disk access
- Embeddings should persist across restarts
Configuration
src/storage/file-adapter.ts
Options
| Option | Type | Default | Description |
|---|---|---|---|
cacheDir | string | ./.cache/vectoriadb | Directory for cache files |
namespace | string | 'default' | Namespace for isolation |
fileName | string | 'embeddings.json' | Cache file name |
File Structure
The adapter creates this structure:Directory Permissions
Ensure the cache directory is writable:src/directory-setup.ts
Error Handling
src/file-error-handling.ts
Security Considerations
The adapter includes path traversal protection:src/security.ts
Docker Volumes
When using Docker, mount the cache directory as a volume:docker-compose.yml
Related
Storage Overview
Storage fundamentals
Redis Adapter
Multi-pod storage
Cache Invalidation
Cache control