# ============================================================================ # Company Brain v2 — configuration. Copy to .env and edit. NEVER commit .env. # ============================================================================ # --- Authentication (REQUIRED) --------------------------------------------- # Comma-separated "key:agent" pairs. Each AI/client gets its own key so the # brain knows who wrote/searched what. Generate strong keys with: # python scripts/gen_key.py # BRAIN_API_KEYS=Kf3...:claude-code,Qz9...:cursor BRAIN_API_KEYS= # --- Projects -------------------------------------------------------------- # Each project is isolated (own vault folder + own vector collection). Requests # without a project use this default. Clients can target any project per call. BRAIN_DEFAULT_PROJECT=default # --- Embeddings (local, CPU, no data leaves the box) ----------------------- # Default is a lighter multilingual model that fits small (2GB) droplets. # Balanced : sentence-transformers/paraphrase-multilingual-mpnet-base-v2 (768) # Best : intfloat/multilingual-e5-large (1024, heavier on CPU) # NOTE: changing this changes the vector size; the brain auto-rebuilds the # affected collection and re-indexes the vault on next start. EMBED_MODEL=sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 # --- Vector store ---------------------------------------------------------- # docker-compose sets this to the private qdrant service automatically. # Leave blank to use an embedded on-disk Qdrant (no separate service). # QDRANT_URL=http://qdrant:6333 # QDRANT_API_KEY= QDRANT_COLLECTION=company_brain # --- Storage --------------------------------------------------------------- BRAIN_DATA_DIR=./data # --- Self-optimization / safe learning ------------------------------------- # Skip storing a near-identical memory (cosine >= threshold). SAFE_SAVE=true DEDUP_THRESHOLD=0.96 # Search re-ranking: how strongly usefulness / access frequency boost rank. FEEDBACK_WEIGHT=0.15 ACCESS_WEIGHT=0.10 SEARCH_OVERFETCH=3 # --- Multi-layer recall ---------------------------------------------------- # Token budget for the assembled recall context bundle. RECALL_TOKEN_BUDGET=1500 # --- Dreaming (reflection) ------------------------------------------------- # Cluster notes whose similarity is in [relate, dedup) into digest notes. DREAM_RELATE_THRESHOLD=0.6 DREAM_MAX_DIGESTS=10 # --- Heartbeat + autonomous learning --------------------------------------- # Background maintenance interval in seconds (0 = disabled; trigger manually). HEARTBEAT_INTERVAL=0 # How much unused memories lose per heartbeat (use-it-or-lose-it). DECAY_STEP=1 # --- Optional LLM summarization for /ingest (OFF by default) --------------- # When true AND an API key is set, long ingested text is summarized before # storing. Off keeps everything local/private. BRAIN_SUMMARIZE=false # ANTHROPIC_API_KEY= # BRAIN_LLM_MODEL=claude-3-5-haiku-latest # --- Behaviour ------------------------------------------------------------- LOG_SEARCHES=true CHUNK_SIZE=1000 CHUNK_OVERLAP=150 # --- Retrieval (v0.0.1.3) -------------------------------------------------- # Hybrid search fuses dense (vector) + BM25 (keyword) results with RRF. HYBRID_SEARCH=true RRF_K=60 # --- Core memory blocks (v0.0.1.3) ----------------------------------------- # Max characters per named memory block (e.g. the "human" block). BLOCK_CHAR_LIMIT=2000 # --- Safety: secret / PII redaction (v0.0.1.3) ----------------------------- # When true, detected secrets/PII are scrubbed from content before storing. # When false (default), they are only reported back in `pii_findings`. REDACT_ON_SAVE=false # --- Sleep cycle (v0.0.1.3) ------------------------------------------------ # When true, the sleep cycle archives stale, low-value, never-read memories. SLEEP_ARCHIVE=false # --- API server ------------------------------------------------------------ API_HOST=0.0.0.0 API_PORT=8000 RATE_LIMIT=120/minute MAX_BODY_BYTES=4000000 CORS_ORIGINS= # --- Optional HTTPS overlay (docker-compose.tls.yml) ----------------------- # For a domain: set both, then use the tls overlay (auto Let's Encrypt). # BRAIN_DOMAIN=brain.example.com # ACME_EMAIL=you@example.com