v0.7.0

Configuration

Last updated

This page covers where ToriiDB reads settings from: the data directory argument and the environment variables.

Configuration Surfaces

Surface How it is set Required
Data directory dir argument to store.New or daemon.New Yes
OpenAI API key apiKey argument, OPENAI_API_KEY, or OS keychain Only for vector operations
Embedding dimension TORIIDB_EMBED_DIM No

There is no config file. The Go code never loads .env; the repository Makefile does include .env + export for its own targets.

Data Directory

torii, err := store.New("/var/lib/myapp/toriidb")
d, err := daemon.New("/var/lib/myapp/toriidb")

The process needs permission to create files, fsync them, rename them, and fsync the directory.

Environment Variables

Variable Default Effect
OPENAI_API_KEY none Enables embeddings (see lookup order above)
TORIIDB_EMBED_DIM 256 Requested embedding dimension; values <= 0 fall back to 256

The embedding dimension is part of the cache key and must match the returned vector length. Changing it on an existing dataset leaves old vectors with a different length, and search skips them.

中文