Repository navigation
Expand file tree
/
Copy pathenv.example
More file actions
105 lines (86 loc) · 5.61 KB
/
Copy pathenv.example
File metadata and controls
105 lines (86 loc) · 5.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# ─────────────────────────────────────────────────────────────────
# Engram — Environment Variables
# Copy to .env and fill in your values. Never commit .env to git.
# ─────────────────────────────────────────────────────────────────
# ── LLM Provider ──────────────────────────────────────────────────
# Choose one: gemini | openai | anthropic | deepseek
LLM_PROVIDER=gemini
# LLM_MODEL= # optional model override
# API keys — only the one for your chosen provider is required
GEMINI_API_KEY=your_gemini_api_key_here
# OPENAI_API_KEY=your_openai_key
# ANTHROPIC_API_KEY=your_anthropic_key
# DEEPSEEK_API_KEY=your_deepseek_key
# ── Auth ──────────────────────────────────────────────────────────
# Change this to any long random string — used to sign JWT tokens.
# Access tokens expire in 15 minutes. Refresh tokens expire in 30 days
# and are stored in Postgres so they can be individually revoked.
AUTH_SECRET=change-this-to-a-long-random-secret
# ── CORS ──────────────────────────────────────────────────────────
# Comma-separated list of origins allowed to call the API.
# Local dev default works out of the box.
# Production: set this to your actual frontend domain.
# CORS_ORIGINS=https://yourdomain.com,https://www.yourdomain.com
CORS_ORIGINS=http://localhost:3000,http://127.0.0.1:3000
# ── Rate limiting ─────────────────────────────────────────────────
# Format: "N/period" — period is second, minute, or hour
# Auth limits (register/login) are hardcoded tighter in auth.py
RATE_LIMIT_STORE=30/minute
RATE_LIMIT_CHAT=20/minute
RATE_LIMIT_RECALL=60/minute
# ── PostgreSQL ────────────────────────────────────────────────────
# Option A — Local Docker (default)
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_DB=engram
POSTGRES_USER=engram
POSTGRES_PASSWORD=engram_secret
# Option B — Hosted (Neon, Supabase, Railway) — overrides Option A
# DATABASE_URL=postgresql://user:pass@host/db?sslmode=require
# ── Qdrant ────────────────────────────────────────────────────────
# Option A — Local Docker (default)
QDRANT_HOST=localhost
QDRANT_PORT=6333
QDRANT_COLLECTION=memories
# Option B — Qdrant Cloud — overrides Option A
# QDRANT_URL=https://xyz.cloud.qdrant.io
# QDRANT_API_KEY=your_qdrant_api_key
# ── Redis ─────────────────────────────────────────────────────────
# Option A — Local Docker (default)
REDIS_HOST=localhost
REDIS_PORT=6379
# Option B — Upstash — overrides Option A
# REDIS_URL=rediss://default:[email protected]:6379
# ── FalkorDB ──────────────────────────────────────────────────────
# Local Docker only (no free hosted option)
FALKORDB_HOST=localhost
FALKORDB_PORT=6380
# ── Embeddings (local, no API cost) ───────────────────────────────
EMBEDDING_MODEL=all-MiniLM-L6-v2
EMBEDDING_DIM=384
# ── Reranker (local, no API cost) ─────────────────────────────────
RERANKER_MODEL=BAAI/bge-reranker-base
# ── Memory Tuning ─────────────────────────────────────────────────
DUPLICATE_THRESHOLD=0.80
GRAPH_CONFIDENCE_THRESHOLD=0.85
TOP_K_RETRIEVAL=20
TOP_K_RERANKED=5
MAX_CONTEXT_TOKENS=2000
# ── Sliding Window Coreference ────────────────────────────────────
# Number of prior turns to look back when resolving pronouns before
# fact extraction. 0 = disabled. 5 = recommended.
SLIDING_WINDOW_LOOKBACK=5
# ── Bio-Mimetic Memory Decay ──────────────────────────────────────
# R(m,t) = salience * e^(-decay_rate * days) + access_boost * access_count
# forget_threshold: memories below this score filtered from recall.
# 0.0 = disabled (default). Try 0.2 to enable soft forgetting.
RETENTION_DECAY_RATE=0.01
RETENTION_ACCESS_BOOST=0.1
RETENTION_FORGET_THRESHOLD=0.0
RETENTION_SALIENCE_HIGH=1.0
RETENTION_SALIENCE_LOW=0.5
# ── App ───────────────────────────────────────────────────────────
APP_PORT=8000
# ── Frontend ──────────────────────────────────────────────────────
# URL where the FastAPI backend is running
NEXT_PUBLIC_API_URL=http://localhost:8000