forked from langchain-ai/deepagents
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
373 lines (306 loc) · 13.6 KB
/
.env.example
File metadata and controls
373 lines (306 loc) · 13.6 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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
# =============================================================================
# Memory Backend Agent — unified config template
# =============================================================================
# Copy to .env and edit: cp .env.powermem.example .env
# Includes: Deep Agent model, PowerMem (DB / embedding / optional LLM) and options
# =============================================================================
# -----------------------------------------------------------------------------
# Deep Agent model (choose one; used by agent.py / agent_powermem.py)
# -----------------------------------------------------------------------------
# Option A: Qwen (OpenAI-compatible API, e.g. DashScope)
OPENAI_API_BASE=https://dashscope.aliyuncs.com/compatible-mode/v1
OPENAI_API_KEY=your_dashscope_api_key_here
OPENAI_MODEL=qwen-plus
# Option B: Claude (use when OPENAI_API_BASE is commented out)
# ANTHROPIC_API_KEY=your_anthropic_api_key_here
# LangSmith tracing (optional)
# LANGCHAIN_TRACING_V2=true
# LANGSMITH_ENDPOINT=https://api.smith.langchain.com
# LANGCHAIN_API_KEY=your_langsmith_api_key_here
# LANGCHAIN_PROJECT=memory-backend-agent
# -----------------------------------------------------------------------------
# PowerMem (required for agent_powermem.py or persistent memory)
# -----------------------------------------------------------------------------
# For a complete list of timezones, see: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
TIMEZONE=Asia/Shanghai
# =============================================================================
# 1. Database Configuration (Required)
# =============================================================================
# Choose your database provider: sqlite, oceanbase, postgres
DATABASE_PROVIDER=sqlite
# -----------------------------------------------------------------------------
# SQLite Configuration (Default - Recommended for development)
# -----------------------------------------------------------------------------
SQLITE_PATH=./data/powermem_dev.db
SQLITE_ENABLE_WAL=true
SQLITE_TIMEOUT=30
SQLITE_COLLECTION=memories
# -----------------------------------------------------------------------------
# OceanBase Configuration
# -----------------------------------------------------------------------------
OCEANBASE_HOST=127.0.0.1
OCEANBASE_PORT=2881
OCEANBASE_USER=root@sys
OCEANBASE_PASSWORD=your_password
OCEANBASE_DATABASE=powermem
OCEANBASE_COLLECTION=memories
## Keep the default settings, as modifications are generally not needed.
OCEANBASE_INDEX_TYPE=IVF_FLAT
OCEANBASE_VECTOR_METRIC_TYPE=cosine
OCEANBASE_TEXT_FIELD=document
OCEANBASE_VECTOR_FIELD=embedding
OCEANBASE_EMBEDDING_MODEL_DIMS=1536
OCEANBASE_PRIMARY_FIELD=id
OCEANBASE_METADATA_FIELD=metadata
OCEANBASE_VIDX_NAME=memories_vidx
# -----------------------------------------------------------------------------
# PostgreSQL Configuration
# -----------------------------------------------------------------------------
POSTGRES_HOST=127.0.0.1
POSTGRES_PORT=5432
POSTGRES_USER=postgres
POSTGRES_PASSWORD=your_password
POSTGRES_DATABASE=powermem
POSTGRES_COLLECTION=memories
## Keep the default settings, as modifications are generally not needed.
POSTGRES_EMBEDDING_MODEL_DIMS=1536
POSTGRES_DISKANN=true
POSTGRES_HNSW=true
# DATABASE_SSLMODE=prefer
# DATABASE_POOL_SIZE=10
# DATABASE_MAX_OVERFLOW=20
# =============================================================================
# 2. LLM Configuration (Required)
# =============================================================================
# Choose your LLM provider: qwen, openai, siliconflow, ollama, vllm, anthropic, deepseek
LLM_PROVIDER=qwen
LLM_API_KEY=your_api_key_here
# Adjust the model according to your provider, gpt-4 advised to use when provider is openai
LLM_MODEL=qwen-plus
## Keep the default settings, as modifications are generally not needed.
LLM_TEMPERATURE=0.7
LLM_MAX_TOKENS=1000
LLM_TOP_P=0.8
LLM_TOP_K=50
# Only supported by qwen provider
LLM_ENABLE_SEARCH=false
# Default Base URLs for LLM providers, you can adjust if necessary
QWEN_LLM_BASE_URL=https://dashscope.aliyuncs.com/api/v1
OPENAI_LLM_BASE_URL=https://api.openai.com/v1
SILICONFLOW_LLM_BASE_URL=https://api.siliconflow.cn/v1
OLLAMA_LLM_BASE_URL=
VLLM_LLM_BASE_URL=
ANTHROPIC_LLM_BASE_URL=https://api.anthropic.com
DEEPSEEK_LLM_BASE_URL=https://api.deepseek.com
# =============================================================================
# 3. Embedding Configuration (Required)
# =============================================================================
# Choose your embedding provider: qwen, openai, siliconflow, huggingface, lmstudio, ollama
EMBEDDING_PROVIDER=qwen
EMBEDDING_API_KEY=your_api_key_here
# Adjust the model according to your provider, text-embedding-ada-002 advised to use when provider is openai
EMBEDDING_MODEL=text-embedding-v4
EMBEDDING_DIMS=1536
# Default Base URLs for embedding providers, you can adjust if necessary
QWEN_EMBEDDING_BASE_URL=https://dashscope.aliyuncs.com/api/v1
OPENAI_EMBEDDING_BASE_URL=https://api.openai.com/v1
SILICONFLOW_EMBEDDING_BASE_URL=https://api.siliconflow.cn/v1
HUGGINFACE_EMBEDDING_BASE_URL=
LMSTUDIO_EMBEDDING_BASE_URL=
OLLAMA_EMBEDDING_BASE_URL=
# =============================================================================
# 4. Rerank Configuration (Optional)
# =============================================================================
# Rerank configuration for reordering search results
RERANKER_ENABLED=false
RERANKER_PROVIDER=qwen
RERANKER_MODEL=qwen3-rerank
RERANKER_API_KEY=your_api_key_here
# RERANKER_API_BASE_URL=
# Provider-specific configurations
# For Qwen: Uses DASHSCOPE_API_KEY and DASHSCOPE_BASE_URL if RERANKER_* not set
# For Jina: Uses JINA_API_KEY and JINA_API_BASE_URL if RERANKER_* not set
# For Zhipu AI: Uses ZAI_API_KEY and ZAI_API_BASE_URL if RERANKER_* not set
# =============================================================================
# 5. Agent Configuration (Optional)
# =============================================================================
# Agent memory management settings
AGENT_ENABLED=true
AGENT_DEFAULT_SCOPE=AGENT
AGENT_DEFAULT_PRIVACY_LEVEL=PRIVATE
AGENT_DEFAULT_COLLABORATION_LEVEL=READ_ONLY
AGENT_DEFAULT_ACCESS_PERMISSION=OWNER_ONLY
# Agent Memory Mode (auto, multi_agent, multi_user, hybrid)
AGENT_MEMORY_MODE=auto
# =============================================================================
# 6. Intelligent Memory Configuration (Optional)
# =============================================================================
# Ebbinghaus forgetting curve settings
INTELLIGENT_MEMORY_ENABLED=true
INTELLIGENT_MEMORY_INITIAL_RETENTION=1.0
INTELLIGENT_MEMORY_DECAY_RATE=0.1
INTELLIGENT_MEMORY_REINFORCEMENT_FACTOR=0.3
INTELLIGENT_MEMORY_WORKING_THRESHOLD=0.3
INTELLIGENT_MEMORY_SHORT_TERM_THRESHOLD=0.6
INTELLIGENT_MEMORY_LONG_TERM_THRESHOLD=0.8
# Memory decay calculation settings
MEMORY_DECAY_ENABLED=true
MEMORY_DECAY_ALGORITHM=ebbinghaus
MEMORY_DECAY_BASE_RETENTION=1.0
MEMORY_DECAY_FORGETTING_RATE=0.1
MEMORY_DECAY_REINFORCEMENT_FACTOR=0.3
INTELLIGENT_MEMORY_FALLBACK_TO_SIMPLE_ADD=false
# =============================================================================
# 7. Performance Configuration (Optional)
# =============================================================================
# Memory management settings
MEMORY_BATCH_SIZE=100
MEMORY_CACHE_SIZE=1000
MEMORY_CACHE_TTL=3600
MEMORY_SEARCH_LIMIT=10
MEMORY_SEARCH_THRESHOLD=0.7
# Vector store settings
VECTOR_STORE_BATCH_SIZE=50
VECTOR_STORE_CACHE_SIZE=500
VECTOR_STORE_INDEX_REBUILD_INTERVAL=86400
# =============================================================================
# 8. Security Configuration (Optional)
# =============================================================================
# Encryption settings
ENCRYPTION_ENABLED=false
ENCRYPTION_KEY=
ENCRYPTION_ALGORITHM=AES-256-GCM
# Access control settings
ACCESS_CONTROL_ENABLED=true
ACCESS_CONTROL_DEFAULT_PERMISSION=READ_ONLY
ACCESS_CONTROL_ADMIN_USERS=admin,root
# =============================================================================
# 9. Telemetry Configuration (Optional)
# =============================================================================
# Usage analytics and monitoring
TELEMETRY_ENABLED=false
TELEMETRY_ENDPOINT=https://telemetry.powermem.ai
TELEMETRY_API_KEY=
TELEMETRY_BATCH_SIZE=100
TELEMETRY_FLUSH_INTERVAL=30
TELEMETRY_RETENTION_DAYS=30
# =============================================================================
# 10. Audit Configuration (Optional)
# =============================================================================
# Audit logging settings
AUDIT_ENABLED=true
AUDIT_LOG_FILE=./logs/audit.log
AUDIT_LOG_LEVEL=INFO
AUDIT_RETENTION_DAYS=90
AUDIT_COMPRESS_LOGS=true
AUDIT_LOG_ROTATION_SIZE=100MB
# =============================================================================
# 11. Logging Configuration (Optional)
# =============================================================================
# General logging settings
LOGGING_LEVEL=DEBUG
LOGGING_FORMAT=%(asctime)s - %(name)s - %(levelname)s - %(message)s
LOGGING_FILE=./logs/powermem.log
LOGGING_MAX_SIZE=100MB
LOGGING_BACKUP_COUNT=5
LOGGING_COMPRESS_BACKUPS=true
# Console logging
LOGGING_CONSOLE_ENABLED=true
LOGGING_CONSOLE_LEVEL=INFO
LOGGING_CONSOLE_FORMAT=%(levelname)s - %(message)s
# =============================================================================
# 12. Graph Store Configuration (Optional)
# =============================================================================
# Graph store for knowledge graph storage and retrieval
# Enable graph store functionality
GRAPH_STORE_ENABLED=false
# Graph store provider (currently supports: oceanbase)
GRAPH_STORE_PROVIDER=oceanbase
# OceanBase Graph Configuration
GRAPH_STORE_HOST=127.0.0.1
GRAPH_STORE_PORT=2881
GRAPH_STORE_USER=root@sys
GRAPH_STORE_PASSWORD=your_password
GRAPH_STORE_DB_NAME=powermem
# Optional: Graph traversal settings
GRAPH_STORE_MAX_HOPS=3
# Optional: Graph store vector and index settings
# GRAPH_STORE_VECTOR_METRIC_TYPE=l2
# GRAPH_STORE_INDEX_TYPE=HNSW
# Optional: Custom prompts for graph operations
# GRAPH_STORE_CUSTOM_PROMPT=
# GRAPH_STORE_CUSTOM_EXTRACT_RELATIONS_PROMPT=
# GRAPH_STORE_CUSTOM_UPDATE_GRAPH_PROMPT=
# GRAPH_STORE_CUSTOM_DELETE_RELATIONS_PROMPT=
# =============================================================================
# 13. Sparse Embedding Configuration (Optional)
# =============================================================================
# Choose your sparse embedding provider: qwen, openai
SPARSE_VECTOR_ENABLE=false
SPARSE_EMBEDDER_PROVIDER=qwen
SPARSE_EMBEDDER_API_KEY=your_api_key_here
SPARSE_EMBEDDER_MODEL=text-embedding-v4
SPARSE_EMBEDDING_BASE_URL=https://dashscope.aliyuncs.com/api/v1
# =============================================================================
# 14. Query Rewrite Configuration (Optional)
# =============================================================================
# Custom query rewritten prompt & he model used, keeping it from the same manufacturer as llm
QUERY_REWRITE_ENABLED=false
# QUERY_REWRITE_PROMPT=
# QUERY_REWRITE_MODEL_OVERRIDE=
# =============================================================================
# 15. PowerMem HTTP API Server Configuration
# =============================================================================
# Configuration for the PowerMem HTTP API Server
# =============================================================================
# -----------------------------------------------------------------------------
# Server Settings
# -----------------------------------------------------------------------------
# Server host address (0.0.0.0 to listen on all interfaces)
POWERMEM_SERVER_HOST=0.0.0.0
# Server port number
POWERMEM_SERVER_PORT=8000
# Number of worker processes (only used when reload=false)
POWERMEM_SERVER_WORKERS=4
# Enable auto-reload for development (true/false)
POWERMEM_SERVER_RELOAD=false
# -----------------------------------------------------------------------------
# Authentication Settings
# -----------------------------------------------------------------------------
# Enable API key authentication (true/false)
POWERMEM_SERVER_AUTH_ENABLED=false
# API keys (comma-separated list)
# Example: POWERMEM_SERVER_API_KEYS=key1,key2,key3
POWERMEM_SERVER_API_KEYS=
# -----------------------------------------------------------------------------
# Rate Limiting Settings
# -----------------------------------------------------------------------------
# Enable rate limiting (true/false)
POWERMEM_SERVER_RATE_LIMIT_ENABLED=true
# Rate limit per minute per IP address
POWERMEM_SERVER_RATE_LIMIT_PER_MINUTE=100
# -----------------------------------------------------------------------------
# Logging Settings
# -----------------------------------------------------------------------------
POWERMEM_SERVER_LOG_FILE=server.log
# Log level: DEBUG, INFO, WARNING, ERROR, CRITICAL
POWERMEM_SERVER_LOG_LEVEL=INFO
# Log format: json or text
POWERMEM_SERVER_LOG_FORMAT=text
# -----------------------------------------------------------------------------
# API Settings
# -----------------------------------------------------------------------------
# API title (shown in Swagger UI)
POWERMEM_SERVER_API_TITLE=PowerMem API
# API version
POWERMEM_SERVER_API_VERSION=v1
# API description (shown in Swagger UI)
POWERMEM_SERVER_API_DESCRIPTION=PowerMem HTTP API Server - Intelligent Memory System
# -----------------------------------------------------------------------------
# CORS Settings
# -----------------------------------------------------------------------------
# Enable CORS (true/false)
POWERMEM_SERVER_CORS_ENABLED=true
# CORS allowed origins (comma-separated, use * for all origins)
# Example: POWERMEM_SERVER_CORS_ORIGINS=http://localhost:3000,https://example.com
POWERMEM_SERVER_CORS_ORIGINS=*