Skip to main content
Learn how to use the File Storage Adapter for single-server deployments.

When to Use

Use FileStorageAdapter when:
  • Running on a single server
  • You have writable disk access
  • Embeddings should persist across restarts

Configuration

src/storage/file-adapter.ts

Options

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
Never pass untrusted user input directly to the namespace option. Always sanitize external input.

Docker Volumes

When using Docker, mount the cache directory as a volume:
docker-compose.yml

Storage Overview

Storage fundamentals

Redis Adapter

Multi-pod storage

Cache Invalidation

Cache control