KEYOKU_PORT
HTTP server port. The engine listens on this port for all API requests.
All configuration is done through environment variables. The engine reads them on startup — no config files needed. Set them in your shell, a .env file, or your container orchestrator.
Only KEYOKU_SESSION_TOKEN is required. Everything else has sensible defaults.
HTTP server port. The engine listens on this port for all API requests.
Path to the SQLite database file.
Created automatically on first run. WAL mode is enabled by default for concurrent read access.
Comma-separated list of additional allowed CORS origins.
Default allowlist includes localhost on ports 3000, 5173, 8080 and 127.0.0.1 equivalents. Add your own domains in production.
Bearer token for API authentication. All requests must include this token.
Generate with: openssl rand -hex 16. This is the only required configuration variable.
LLM provider for memory extraction.
Options: gemini, openai, anthropic, ollama. Determines which API is called to analyze conversation exchanges.
Specific model to use for extraction.
Examples: gemini-2.5-flash, gpt-5-mini, claude-haiku-4-5-20251001, llama3.2. Falls back to provider default if unset.
Provider for generating embedding vectors.
Options: gemini, openai, anthropic, ollama. Defaults to the extraction provider if unset.
Specific model for embeddings.
Examples: gemini-embedding-001, text-embedding-3-small. Falls back to provider default if unset.
Base URL for the Ollama server. Only used when provider is ollama.
Embedding vector dimensions for Ollama models.
Must match the model output. Common values: 768, 1024, 1536.
OpenAI API key. Required when using openai as extraction or embedding provider.
Google Gemini API key. Required when using gemini as extraction or embedding provider.
Anthropic API key. Required when using anthropic as extraction or embedding provider.
Ollama API key. Optional — only needed if your Ollama instance requires authentication.
Enable quiet hours suppression.
When active, non-critical heartbeat signals are suppressed during the quiet window. Disabled by default.
Hour (0-23) when quiet hours begin. Signals below Immediate urgency are suppressed.
Hour (0-23) when quiet hours end. Normal signal processing resumes.
IANA timezone string for quiet hours and time-period calculations.
Examples: America/New_York, Europe/London, Asia/Tokyo.
Automatically start the heartbeat watcher when the engine boots.
If false, call POST /api/v1/watcher/start manually.
Comma-separated entity IDs to watch on startup. Only used when auto_start is true.
Base interval between heartbeat checks in milliseconds.
Adaptive multipliers adjust this based on context — time of day, signal density, memory velocity, and recent action.
Minimum interval floor in milliseconds.
Even with aggressive multipliers, the watcher never checks faster than this.
Maximum interval ceiling in milliseconds.
Even in quiet periods, the watcher checks at least this often.
Cosine similarity threshold for semantic deduplication.
Memories above this threshold are considered duplicates and skipped during ingest.
Threshold for near-duplicate detection.
Memories between this and SemanticDuplicateThresh (0.95) are candidates for merging.
Retention score below which a memory transitions from ACTIVE to STALE.
Stale memories are deprioritized in search results but still retrievable.
Days after which STALE memories are moved to ARCHIVED state.
Archived memories are excluded from default searches but accessible via explicit ID lookup or archive queries.
Days after which DELETED memories are permanently purged from the database.
Number of memories held in the LRU hot cache. Cache hits bypass HNSW search entirely.
Maximum entries in the HNSW index before automatic consolidation triggers.
Keeps vector search performant by rebuilding the index when it grows beyond this limit.
Example
# Required
KEYOKU_SESSION_TOKEN=a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6
# LLM provider
KEYOKU_EXTRACTION_PROVIDER=gemini
GEMINI_API_KEY=your-gemini-api-key
# Optional overrides
KEYOKU_PORT=18900
KEYOKU_DB_PATH=./data/keyoku.db
KEYOKU_QUIET_HOURS_TIMEZONE=America/New_York