Skip to main content
Initialize the vector database. Must be called before any other operations.

Signature

Description

Initializes the database by:
  1. Loading and initializing the embedding model
  2. Initializing the storage adapter
  3. Attempting to load cached embeddings from storage

Example

Behavior

  • Idempotent: Safe to call multiple times. Subsequent calls are no-ops if already initialized.
  • Async: Downloads model on first run (~22 MB).
  • Auto-loads cache: Automatically loads from storage if valid cache exists.

Error Handling

Example: Startup Pattern

Constructor

Create instance

add()

Add documents

Storage

Storage operations