Files
memory-os/.env.example
T
ClaudioDrews ff781f9824 feat: add EMBEDDING_API_KEY for authenticated non-OpenRouter endpoints (fixes #8)
embedding.py:
- Add EMBEDDING_API_KEY env var (no fallback — explicit per-branch)
- OpenRouter branch: uses OPENROUTER_API_KEY + vendor headers
- Generic branch: sends Authorization: Bearer <EMBEDDING_API_KEY> if set
- Unauth fallback: no header (localhost, no auth needed)
- Credential isolation: no cross-branch key leakage

.env.example + setup/install.md:
- Document EMBEDDING_API_KEY as optional for non-OpenRouter
  authenticated endpoints (vLLM --api-key, custom hosted services)
2026-06-03 09:37:38 -03:00

111 lines
3.9 KiB
Bash

# Memory OS — Environment Variables
# Copy this file to .env and fill in your values:
# cp .env.example .env
# ── Required ──────────────────────────────────────────
# OpenRouter API key — REQUIRED only when EMBEDDING_API_BASE points to OpenRouter.
# For local providers (Ollama, vLLM, llama.cpp) leave unset or comment out.
OPENROUTER_API_KEY=sk-or-...
# Redis password (generate with: openssl rand -hex 16)
REDIS_PASSWORD=change-me
# ── Paths ─────────────────────────────────────────────
# Where Icarus writes fabric entries (absolute path required — systemd does not expand ~)
FABRIC_DIR=/home/your-user/vault/fabric
# Vault root for Vault Curator, wiki, and backfill scripts
VAULT_PATH=/home/your-user/vault
# Wiki directory for Qdrant ingestion
WIKI_ROOT=/home/your-user/vault/wiki
# Hermes home (usually ~/.hermes)
HERMES_HOME=/home/your-user/.hermes
# State database path (SQLite with FTS5 for session search)
STATE_DB_PATH=/home/your-user/.hermes/state.db
# Logs directory
HERMES_LOGS_DIR=/home/your-user/.hermes/logs
# DLQ (Dead Letter Queue) state file
HERMES_DLQ_PATH=/home/your-user/.hermes/wiki_ingest_failures.json
# DLQ report output (used by dlq_manager.py)
HERMES_DLQ_REPORT_LOG=/home/your-user/.hermes/cron/output/dlq-report.log
HERMES_DLQ_REPORT_DIR=/home/your-user/.hermes/cron/output
# Telemetry log for context_enhancer.py query tracking
TELEMETRY_LOG_PATH=/home/your-user/.hermes/logs/query-telemetry.jsonl
# Reflection trigger log path
REFLECTION_LOG_PATH=/home/your-user/.hermes/logs/reflection_trigger.log
# MaaS env path (reflection_trigger.py loads env from this location)
MAA_ENV_PATH=/home/your-user/.env
# ── Embedding Backend ─────────────────────────────────
# Default: OpenRouter with Qwen3-Embedding-8B.
# Recommended model: multilingual (excellent for non-English content),
# high-quality 4096d embeddings, fast inference, affordable pricing.
# To use a local model (Ollama, vLLM, llama.cpp), set both vars:
# EMBEDDING_API_BASE=http://host.docker.internal:11434/v1
# EMBEDDING_MODEL=nomic-embed-text
# EMBEDDING_API_BASE=https://openrouter.ai/api/v1
# EMBEDDING_MODEL=qwen/qwen3-embedding-8b
# API key for non-OpenRouter authenticated endpoints (vLLM with --api-key,
# custom hosted embedding services). Not needed for OpenRouter (uses
# OPENROUTER_API_KEY) or local unauthenticated providers.
# EMBEDDING_API_KEY=your-key-here
# ── Strongly Recommended ──────────────────────────────
# LLM extraction token limit — 1024 is too small, causes fabric truncation
ICARUS_EXTRACTION_MAX_TOKENS=4096
# LLM extraction model (any OpenRouter chat model)
ICARUS_EXTRACTION_MODEL=deepseek/deepseek-v4-flash
# Embedding dimensions — must match Qdrant collection schema
EMBEDDING_DIMS=4096
# Qdrant collection name
COLLECTION_NAME=knowledge_base
# ── Optional ──────────────────────────────────────────
# Obsidian integration
# ICARUS_OBSIDIAN=1
# OBSIDIAN_VAULT_PATH=/home/your-user/vault
# Fallback truncation limits (only used when LLM extraction fails)
# ICARUS_RESULT_MAX_CHARS=500
# ICARUS_TASK_MAX_CHARS=300
# Training/eval (Together AI)
# TOGETHER_API_KEY=tok-...
# Alternative OpenRouter keys (tried in order by context_enhancer.py)
# OPENROUTER_FULL_API_KEY=sk-or-...
# OPENROUTER_DS_API_KEY=sk-or-...
# Docker: wiki mount path inside worker container
# WIKI_PATH=/wiki
# Logging
# LOG_LEVEL=INFO
# CURATOR_LOG_LEVEL=INFO
# ARQ worker tuning
# ARQ_MAX_JOBS=10
# ARQ_JOB_TIMEOUT=300
# ARQ_KEEP_RESULT=3600
# Micro-reflection budget
# MICRO_REFLECTION_MAX_PER_HOUR=5