-
Notifications
You must be signed in to change notification settings - Fork 455
Expand file tree
/
Copy path.env.example
More file actions
241 lines (207 loc) · 9.1 KB
/
.env.example
File metadata and controls
241 lines (207 loc) · 9.1 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# ============================================
# OpenMemory - Environment Configuration
# ============================================
# --------------------------------------------
# Backend Server Settings
# --------------------------------------------
OM_PORT=8080
# API Authentication (IMPORTANT: Set a strong API key for production!)
# Generate a secure key: openssl rand -base64 32
# Leave empty to disable authentication (development only)
OM_API_KEY=your-secret-api-key-here
# Rate Limiting
# Enable rate limiting to prevent abuse
OM_RATE_LIMIT_ENABLED=true
# Time window in milliseconds (default: 60000 = 1 minute)
OM_RATE_LIMIT_WINDOW_MS=60000
# Maximum requests per window (default: 100 requests per minute)
OM_RATE_LIMIT_MAX_REQUESTS=100
# Optional: Log all authenticated requests (set to 'true' for debugging)
OM_LOG_AUTH=false
# Telemetry (true by default, set to false to opt out of anonymous ping)
OM_TELEMETRY=true
# Server Mode
OM_MODE=standard # standard | langgraph
# --------------------------------------------
# Metadata Store
# --------------------------------------------
# sqlite (default) | postgres
OM_METADATA_BACKEND=sqlite
OM_DB_PATH=/data/openmemory.sqlite
# PostgreSQL Settings (used when OM_METADATA_BACKEND=postgres)
OM_PG_HOST=localhost
OM_PG_PORT=5432
OM_PG_DB=openmemory
OM_PG_USER=postgres
OM_PG_PASSWORD=postgres
OM_PG_SCHEMA=public
OM_PG_TABLE=openmemory_memories
OM_PG_SSL=disable # disable | require
# --------------------------------------------
# Vector Store Backend
# --------------------------------------------
# Vector storage follows OM_METADATA_BACKEND (sqlite/postgres) unless set to 'valkey'
# Options: valkey (Redis-compatible), or leave unset to follow OM_METADATA_BACKEND
# Note: When using postgres metadata backend, vectors are stored in the same database
OM_VECTOR_BACKEND=sqlite
# Table name for vectors (configurable, will be created if it doesn't exist)
OM_VECTOR_TABLE=vectors
OM_WEAVIATE_URL=
OM_WEAVIATE_API_KEY=
OM_WEAVIATE_CLASS=OpenMemory
# --------------------------------------------
# Embeddings Configuration
# --------------------------------------------
# Available providers: openai, gemini, aws, ollama, local, synthetic
# Embedding models per sector can be configured in models.yaml
#
# NOTE: Your selected TIER (fast/smart/deep) affects how embeddings work:
# • FAST tier: Uses synthetic embeddings regardless of OM_EMBEDDINGS setting
# • SMART tier: Combines synthetic + compressed semantic from your chosen provider
# • DEEP tier: Uses full embeddings from your chosen provider
#
# For SMART/DEEP tiers, set your preferred provider:
OM_EMBEDDINGS=openai
# Fallback chain: comma-separated list of providers to try if primary fails
# Each provider exhausts its own retry logic before moving to the next
# Example: OM_EMBEDDING_FALLBACK=ollama,synthetic
# Default: synthetic (always works as final fallback)
OM_EMBEDDING_FALLBACK=synthetic
# Vector dimension (auto-adjusted by tier, but can be overridden)
# • FAST: 256-dim • SMART: 384-dim • DEEP: 1536-dim
# OM_VEC_DIM=1536
# Embedding Mode
# simple = 1 unified batch call for all sectors (faster, rate-limit safe, recommended)
# advanced = 5 separate calls, one per sector (higher precision, more API calls)
OM_EMBED_MODE=simple
# Advanced Mode Options (only used when OM_EMBED_MODE=advanced)
# Enable parallel embedding (not recommended for Gemini due to rate limits)
OM_ADV_EMBED_PARALLEL=false
# Delay between embeddings in milliseconds
OM_EMBED_DELAY_MS=200
# OpenAI-compatible Embeddings Provider
# OM_OPENAI_BASE_URL=https://api.openai.com/v1
# Model override for all sector embeddings (leave empty to use defaults)
# OM_OPENAI_MODEL=text-embedding-qwen3-embedding-4b
# API Configuration
# Max request body size in bytes (default: 1MB)
OM_MAX_PAYLOAD_SIZE=1000000
# --------------------------------------------
# Embedding Provider API Keys
# --------------------------------------------
# OpenAI Embeddings
OPENAI_API_KEY=your-openai-api-key-here
# Google Gemini Embeddings
GEMINI_API_KEY=your-gemini-api-key-here
# AWS Titan Text Embeddings V2
AWS_ACCESS_KEY_ID=YOUR_ACCESS_KEY
AWS_SECRET_ACCESS_KEY=YOUR_SECRET_KEY
AWS_REGION=us-east-1
# Ollama Local Embeddings
OLLAMA_URL=http://localhost:11434
# Local Model Path (for custom embedding models)
LOCAL_MODEL_PATH=/path/to/your/local/model
# --------------------------------------------
# Memory System Settings
# --------------------------------------------
# ============================================
# PERFORMANCE TIER (Manual Configuration Required)
# ============================================
# OpenMemory requires you to manually set the performance tier.
# Set OM_TIER to one of: hybrid, fast, smart, or deep
#
# Available Tiers:
#
# HYBRID - Keyword + Synthetic embeddings (256-dim) with BM25 ranking
# • Recall: ~100% (exact keyword matching) • QPS: 800-1000 • RAM: 0.5GB/10k memories
# • Best for: Exact searches, documentation, code search, personal knowledge
# • Features: Exact phrase matching, BM25 scoring, n-gram matching, 100% accuracy
# • Use when: You need guaranteed exact matches and keyword-based retrieval
#
# FAST - Synthetic embeddings only (256-dim)
# • Recall: ~70-75% • QPS: 700-850 • RAM: 0.6GB/10k memories
# • Best for: Local apps, VS Code extensions, low-end hardware
# • Use when: < 4 CPU cores or < 8GB RAM
#
# SMART - Hybrid embeddings (256-dim synthetic + 128-dim compressed semantic = 384-dim)
# • Recall: ~85% • QPS: 500-600 • RAM: 0.9GB/10k memories
# • Best for: Production servers, AI copilots, mid-range hardware
# • Use when: 4-7 CPU cores and 8-15GB RAM
#
# DEEP - Full AI embeddings (1536-dim OpenAI/Gemini)
# • Recall: ~95-100% • QPS: 350-400 • RAM: 1.6GB/10k memories
# • Best for: Cloud deployments, high-accuracy systems, semantic research
# • Use when: 8+ CPU cores and 16+ GB RAM
#
# REQUIRED: Set your tier (no auto-detection):
OM_TIER=hybrid
# Keyword Matching Settings (HYBRID tier only)
# Boost multiplier for keyword matches (default: 2.5)
OM_KEYWORD_BOOST=2.5
# Minimum keyword length for matching (default: 3)
OM_KEYWORD_MIN_LENGTH=3
OM_MIN_SCORE=0.3
# ============================================
# Smart Decay Settings (Time-Based Algorithm)
# ============================================
# Decay interval in minutes - how often the decay cycle runs
# The new algorithm uses time-based decay with daily lambda rates (hot=0.005/day, warm=0.02/day, cold=0.05/day)
# Unlike batch-based systems, running more frequently doesn't increase decay speed
# Decay is calculated from: decay_factor = exp(-lambda * days_since_access / (salience + 0.1))
#
# Recommended intervals:
# • Testing: 30 minutes (for rapid validation)
# • Development: 60-120 minutes (balanced testing)
# • Production: 120-180 minutes (optimal - captures meaningful decay deltas while minimizing overhead)
#
# At 2-3 hours: hot tier decays ~0.04-0.06%, warm ~0.16-0.24%, cold ~0.4-0.6% per cycle
OM_DECAY_INTERVAL_MINUTES=120
# Number of parallel decay worker threads (default: 3)
OM_DECAY_THREADS=3
# Cold tier threshold - memories below this salience get fingerprinted (default: 0.25)
OM_DECAY_COLD_THRESHOLD=0.25
# Reinforce memory salience when queried (default: true)
OM_DECAY_REINFORCE_ON_QUERY=true
# Enable regeneration of cold memories on query hits (default: true)
OM_REGENERATION_ENABLED=true
# Maximum vector dimensions (default: 1536)
OM_MAX_VECTOR_DIM=1536
# Minimum vector dimensions for compression (default: 64)
OM_MIN_VECTOR_DIM=64
# Number of summary compression layers 1-3 (default: 3)
OM_SUMMARY_LAYERS=3
# Full Semantic Graph MVP Settings
# Use summary-only storage (≤300 chars, intelligent extraction)
OM_USE_SUMMARY_ONLY=true
# Maximum summary length - smart extraction preserves dates, names, numbers, actions
OM_SUMMARY_MAX_LENGTH=300
# Memories per segment (10k recommended for optimal cache performance)
OM_SEG_SIZE=10000
# Cache segments (auto-tuned by tier, but can be overridden)
# • FAST: 2 segments • SMART: 3 segments • DEEP: 5 segments
# OM_CACHE_SEGMENTS=3
# Max active queries (auto-tuned by tier, but can be overridden)
# • FAST: 32 queries • SMART: 64 queries • DEEP: 128 queries
# OM_MAX_ACTIVE=64
# Brain Sector Configuration (auto-classified, but you can override)
# Sectors: episodic, semantic, procedural, emotional, reflective
# Auto-Reflection System
# Automatically creates reflective memories by clustering similar memories
OM_AUTO_REFLECT=false
# Reflection interval in minutes (default: 10)
OM_REFLECT_INTERVAL=10
# Minimum memories required before reflection runs (default: 20)
OM_REFLECT_MIN_MEMORIES=20
# Compression
# Enable automatic content compression for large memories
OM_COMPRESSION_ENABLED=false
# Minimum content length (characters) to trigger compression (default: 100)
OM_COMPRESSION_MIN_LENGTH=100
# Compression algorithm: semantic, syntactic, aggressive, auto (default: auto)
OM_COMPRESSION_ALGORITHM=auto
# --------------------------------------------
# LangGraph Integration Mode (LGM)
# --------------------------------------------
OM_LG_NAMESPACE=default
OM_LG_MAX_CONTEXT=50
OM_LG_REFLECTIVE=true