2025-03-02 19:12:11 +08:00
|
|
|
### This is sample file of .env
|
|
|
|
|
2025-02-12 21:48:48 +08:00
|
|
|
### Server Configuration
|
2025-02-15 11:39:10 +08:00
|
|
|
# HOST=0.0.0.0
|
|
|
|
# PORT=9621
|
2025-02-25 10:47:27 +08:00
|
|
|
# WORKERS=1
|
2025-02-15 11:39:10 +08:00
|
|
|
# NAMESPACE_PREFIX=lightrag # separating data from difference Lightrag instances
|
2025-03-02 12:52:25 +08:00
|
|
|
# MAX_GRAPH_NODES=1000 # Max nodes return from grap retrieval
|
2025-02-15 11:39:10 +08:00
|
|
|
# CORS_ORIGINS=http://localhost:3000,http://localhost:8080
|
2025-01-16 22:28:28 +01:00
|
|
|
|
2025-02-12 21:48:48 +08:00
|
|
|
### Optional SSL Configuration
|
2025-02-15 11:39:10 +08:00
|
|
|
# SSL=true
|
|
|
|
# SSL_CERTFILE=/path/to/cert.pem
|
|
|
|
# SSL_KEYFILE=/path/to/key.pem
|
2025-02-12 21:48:48 +08:00
|
|
|
|
|
|
|
### Security (empty for no api-key is needed)
|
|
|
|
# LIGHTRAG_API_KEY=your-secure-api-key-here
|
|
|
|
|
|
|
|
### Directory Configuration
|
2025-02-14 13:26:19 +08:00
|
|
|
# WORKING_DIR=<absolute_path_for_working_dir>
|
|
|
|
# INPUT_DIR=<absolute_path_for_doc_input_dir>
|
2025-02-12 21:48:48 +08:00
|
|
|
|
2025-02-23 13:26:38 +08:00
|
|
|
### Ollama Emulating Model Tag
|
2025-02-12 21:48:48 +08:00
|
|
|
# OLLAMA_EMULATING_MODEL_TAG=latest
|
|
|
|
|
2025-02-23 13:26:38 +08:00
|
|
|
### Logging level
|
|
|
|
# LOG_LEVEL=INFO
|
|
|
|
# VERBOSE=False
|
2025-02-28 23:21:14 +08:00
|
|
|
# LOG_DIR=/path/to/log/directory # Log file directory path, defaults to current working directory
|
|
|
|
# LOG_MAX_BYTES=10485760 # Log file max size in bytes, defaults to 10MB
|
|
|
|
# LOG_BACKUP_COUNT=5 # Number of backup files to keep, defaults to 5
|
2025-02-23 13:26:38 +08:00
|
|
|
|
|
|
|
### Max async calls for LLM
|
|
|
|
# MAX_ASYNC=4
|
|
|
|
### Optional Timeout for LLM
|
2025-02-23 17:03:35 +08:00
|
|
|
# TIMEOUT=150 # Time out in seconds, None for infinite timeout
|
2025-02-23 13:26:38 +08:00
|
|
|
|
|
|
|
### Settings for RAG query
|
|
|
|
# HISTORY_TURNS=3
|
|
|
|
# COSINE_THRESHOLD=0.2
|
|
|
|
# TOP_K=60
|
|
|
|
# MAX_TOKEN_TEXT_CHUNK=4000
|
|
|
|
# MAX_TOKEN_RELATION_DESC=4000
|
|
|
|
# MAX_TOKEN_ENTITY_DESC=4000
|
|
|
|
|
|
|
|
### Settings for document indexing
|
|
|
|
# CHUNK_SIZE=1200
|
|
|
|
# CHUNK_OVERLAP_SIZE=100
|
|
|
|
# MAX_TOKENS=32768 # Max tokens send to LLM for summarization
|
|
|
|
# MAX_TOKEN_SUMMARY=500 # Max tokens for entity or relations summary
|
2025-03-05 16:26:28 +08:00
|
|
|
# SUMMARY_LANGUAGE=English
|
2025-02-23 13:26:38 +08:00
|
|
|
# MAX_EMBED_TOKENS=8192
|
2025-03-16 23:56:34 +08:00
|
|
|
# ENABLE_LLM_CACHE_FOR_EXTRACT=true # Enable LLM cache for entity extraction
|
|
|
|
# MAX_PARALLEL_INSERT=2 # Maximum number of parallel processing documents in pipeline
|
2025-02-23 13:26:38 +08:00
|
|
|
|
|
|
|
### LLM Configuration (Use valid host. For local services installed with docker, you can use host.docker.internal)
|
2025-02-23 16:52:41 +08:00
|
|
|
LLM_BINDING=ollama
|
2025-02-23 13:26:38 +08:00
|
|
|
LLM_MODEL=mistral-nemo:latest
|
|
|
|
LLM_BINDING_API_KEY=your_api_key
|
2025-02-12 21:48:48 +08:00
|
|
|
### Ollama example
|
2025-02-23 13:26:38 +08:00
|
|
|
LLM_BINDING_HOST=http://localhost:11434
|
2025-02-12 21:48:48 +08:00
|
|
|
### OpenAI alike example
|
2025-01-20 14:50:06 +08:00
|
|
|
# LLM_BINDING=openai
|
2025-02-23 16:52:41 +08:00
|
|
|
# LLM_MODEL=gpt-4o
|
2025-02-23 13:26:38 +08:00
|
|
|
# LLM_BINDING_HOST=https://api.openai.com/v1
|
2025-02-23 16:52:41 +08:00
|
|
|
# LLM_BINDING_API_KEY=your_api_key
|
2025-02-23 13:26:38 +08:00
|
|
|
### lollms example
|
2025-01-19 14:04:03 +08:00
|
|
|
# LLM_BINDING=lollms
|
2025-02-23 16:52:41 +08:00
|
|
|
# LLM_MODEL=mistral-nemo:latest
|
2025-02-23 13:26:38 +08:00
|
|
|
# LLM_BINDING_HOST=http://localhost:9600
|
2025-02-23 16:52:41 +08:00
|
|
|
# LLM_BINDING_API_KEY=your_api_key
|
2025-01-17 01:18:28 +01:00
|
|
|
|
2025-02-23 13:26:38 +08:00
|
|
|
### Embedding Configuration (Use valid host. For local services installed with docker, you can use host.docker.internal)
|
2025-01-17 01:18:28 +01:00
|
|
|
EMBEDDING_MODEL=bge-m3:latest
|
2025-02-23 13:26:38 +08:00
|
|
|
EMBEDDING_DIM=1024
|
2025-03-21 13:49:13 +08:00
|
|
|
EMBEDDING_BATCH_NUM=32
|
|
|
|
EMBEDDING_FUNC_MAX_ASYNC=16
|
2025-02-23 13:26:38 +08:00
|
|
|
# EMBEDDING_BINDING_API_KEY=your_api_key
|
|
|
|
### ollama example
|
|
|
|
EMBEDDING_BINDING=ollama
|
|
|
|
EMBEDDING_BINDING_HOST=http://localhost:11434
|
|
|
|
### OpenAI alike example
|
|
|
|
# EMBEDDING_BINDING=openai
|
|
|
|
# LLM_BINDING_HOST=https://api.openai.com/v1
|
2025-02-12 21:48:48 +08:00
|
|
|
### Lollms example
|
2025-01-19 04:44:30 +08:00
|
|
|
# EMBEDDING_BINDING=lollms
|
2025-02-23 13:26:38 +08:00
|
|
|
# EMBEDDING_BINDING_HOST=http://localhost:9600
|
2025-01-16 22:28:28 +01:00
|
|
|
|
2025-02-12 21:48:48 +08:00
|
|
|
### Optional for Azure (LLM_BINDING_HOST, LLM_BINDING_API_KEY take priority)
|
2025-01-17 00:54:24 +01:00
|
|
|
# AZURE_OPENAI_API_VERSION=2024-08-01-preview
|
|
|
|
# AZURE_OPENAI_DEPLOYMENT=gpt-4o
|
2025-02-23 13:26:38 +08:00
|
|
|
# AZURE_OPENAI_API_KEY=your_api_key
|
2025-01-17 00:54:24 +01:00
|
|
|
# AZURE_OPENAI_ENDPOINT=https://myendpoint.openai.azure.com
|
|
|
|
|
|
|
|
# AZURE_EMBEDDING_DEPLOYMENT=text-embedding-3-large
|
2025-01-17 01:36:16 +01:00
|
|
|
# AZURE_EMBEDDING_API_VERSION=2023-05-15
|
2025-01-21 03:31:50 +08:00
|
|
|
|
2025-02-12 21:48:48 +08:00
|
|
|
### Data storage selection
|
2025-02-23 17:56:10 +08:00
|
|
|
LIGHTRAG_KV_STORAGE=JsonKVStorage
|
|
|
|
LIGHTRAG_VECTOR_STORAGE=NanoVectorDBStorage
|
|
|
|
LIGHTRAG_GRAPH_STORAGE=NetworkXStorage
|
|
|
|
LIGHTRAG_DOC_STATUS_STORAGE=JsonDocStatusStorage
|
2025-02-11 14:57:37 +08:00
|
|
|
|
2025-02-12 21:48:48 +08:00
|
|
|
### Oracle Database Configuration
|
2025-02-11 06:31:59 +08:00
|
|
|
ORACLE_DSN=localhost:1521/XEPDB1
|
|
|
|
ORACLE_USER=your_username
|
2025-02-11 14:57:37 +08:00
|
|
|
ORACLE_PASSWORD='your_password'
|
2025-02-11 06:31:59 +08:00
|
|
|
ORACLE_CONFIG_DIR=/path/to/oracle/config
|
2025-02-12 21:48:48 +08:00
|
|
|
#ORACLE_WALLET_LOCATION=/path/to/wallet # optional
|
|
|
|
#ORACLE_WALLET_PASSWORD='your_password' # optional
|
|
|
|
#ORACLE_WORKSPACE=default # separating all data from difference Lightrag instances(deprecated, use NAMESPACE_PREFIX in future)
|
2025-02-11 06:31:59 +08:00
|
|
|
|
2025-02-12 21:48:48 +08:00
|
|
|
### TiDB Configuration
|
2025-02-11 06:31:59 +08:00
|
|
|
TIDB_HOST=localhost
|
|
|
|
TIDB_PORT=4000
|
|
|
|
TIDB_USER=your_username
|
2025-02-11 14:57:37 +08:00
|
|
|
TIDB_PASSWORD='your_password'
|
2025-02-11 06:31:59 +08:00
|
|
|
TIDB_DATABASE=your_database
|
2025-02-12 21:48:48 +08:00
|
|
|
#TIDB_WORKSPACE=default # separating all data from difference Lightrag instances(deprecated, use NAMESPACE_PREFIX in future)
|
2025-02-11 06:31:59 +08:00
|
|
|
|
2025-02-12 21:48:48 +08:00
|
|
|
### PostgreSQL Configuration
|
2025-02-11 06:31:59 +08:00
|
|
|
POSTGRES_HOST=localhost
|
|
|
|
POSTGRES_PORT=5432
|
|
|
|
POSTGRES_USER=your_username
|
2025-02-11 14:57:37 +08:00
|
|
|
POSTGRES_PASSWORD='your_password'
|
2025-02-11 06:31:59 +08:00
|
|
|
POSTGRES_DATABASE=your_database
|
2025-02-12 21:48:48 +08:00
|
|
|
#POSTGRES_WORKSPACE=default # separating all data from difference Lightrag instances(deprecated, use NAMESPACE_PREFIX in future)
|
|
|
|
|
|
|
|
### Independent AGM Configuration(not for AMG embedded in PostreSQL)
|
|
|
|
AGE_POSTGRES_DB=
|
|
|
|
AGE_POSTGRES_USER=
|
|
|
|
AGE_POSTGRES_PASSWORD=
|
|
|
|
AGE_POSTGRES_HOST=
|
|
|
|
# AGE_POSTGRES_PORT=8529
|
|
|
|
|
|
|
|
# AGE Graph Name(apply to PostgreSQL and independent AGM)
|
|
|
|
# AGE_GRAPH_NAME=lightrag # deprecated, use NAME_SPACE_PREFIX instead
|
2025-02-11 06:31:59 +08:00
|
|
|
|
2025-02-12 21:48:48 +08:00
|
|
|
### Neo4j Configuration
|
2025-02-11 06:31:59 +08:00
|
|
|
NEO4J_URI=neo4j+s://xxxxxxxx.databases.neo4j.io
|
|
|
|
NEO4J_USERNAME=neo4j
|
2025-02-11 14:57:37 +08:00
|
|
|
NEO4J_PASSWORD='your_password'
|
2025-02-11 06:31:59 +08:00
|
|
|
|
2025-02-12 21:48:48 +08:00
|
|
|
### MongoDB Configuration
|
|
|
|
MONGODB_URI=mongodb://root:root@localhost:27017/
|
|
|
|
MONGODB_DATABASE=LightRAG
|
|
|
|
MONGODB_GRAPH=false # deprecated (keep for backward compatibility)
|
2025-02-11 06:31:59 +08:00
|
|
|
|
2025-02-12 21:48:48 +08:00
|
|
|
### Qdrant
|
2025-02-11 06:31:59 +08:00
|
|
|
QDRANT_URL=http://localhost:16333
|
2025-02-23 13:26:38 +08:00
|
|
|
# QDRANT_API_KEY=your-api-key
|
2025-02-25 10:47:27 +08:00
|
|
|
|
|
|
|
### Redis
|
2025-02-26 18:11:16 +08:00
|
|
|
REDIS_URI=redis://localhost:6379
|
2025-03-05 11:09:31 +08:00
|
|
|
|
2025-03-18 02:01:28 +08:00
|
|
|
### For JWTt Auth
|
|
|
|
AUTH_USERNAME=admin # login name
|
|
|
|
AUTH_PASSWORD=admin123 # password
|
|
|
|
TOKEN_SECRET=your-key-for-LightRAG-API-Server # JWT key
|
|
|
|
TOKEN_EXPIRE_HOURS=4 # expire duration
|
2025-03-05 11:09:31 +08:00
|
|
|
WHITELIST_PATHS=/login,/health # white list
|