LightRAG/env.example

205 lines
6.7 KiB
Plaintext
Raw Normal View History

### This is sample file of .env
### Server Configuration
2025-05-14 13:22:03 +08:00
HOST=0.0.0.0
PORT=9621
WEBUI_TITLE='My Graph KB'
WEBUI_DESCRIPTION="Simple and Fast Graph Based RAG System"
OLLAMA_EMULATING_MODEL_TAG=latest
# WORKERS=2
# CORS_ORIGINS=http://localhost:3000,http://localhost:8080
2025-05-14 13:22:03 +08:00
### Login Configuration
# AUTH_ACCOUNTS='admin:admin123,user1:pass456'
# TOKEN_SECRET=Your-Key-For-LightRAG-API-Server
# TOKEN_EXPIRE_HOURS=48
# GUEST_TOKEN_EXPIRE_HOURS=24
# JWT_ALGORITHM=HS256
### API-Key to access LightRAG Server API
# LIGHTRAG_API_KEY=your-secure-api-key-here
# WHITELIST_PATHS=/health,/api/*
2025-01-16 22:28:28 +01:00
### Optional SSL Configuration
# SSL=true
# SSL_CERTFILE=/path/to/cert.pem
# SSL_KEYFILE=/path/to/key.pem
### Directory Configuration (defaults to current working directory)
2025-05-14 13:33:33 +08:00
### Should not be set if deploy by docker (Set by Dockerfile instead of .env)
2025-05-14 13:25:05 +08:00
### Default value is ./inputs and ./rag_storage
# INPUT_DIR=<absolute_path_for_doc_input_dir>
2025-05-14 13:22:03 +08:00
# WORKING_DIR=<absolute_path_for_working_dir>
2025-04-04 21:43:52 +08:00
### Max nodes return from grap retrieval
# MAX_GRAPH_NODES=1000
2025-02-23 13:26:38 +08:00
### Logging level
# LOG_LEVEL=INFO
# VERBOSE=False
# LOG_MAX_BYTES=10485760
# LOG_BACKUP_COUNT=5
### Logfile location (defaults to current working directory)
# LOG_DIR=/path/to/log/directory
2025-02-23 13:26:38 +08:00
2025-07-09 04:37:04 +08:00
### RAG Configuration
### Chunk size for document splitting, 500~1500 is recommended
# CHUNK_SIZE=1200
# CHUNK_OVERLAP_SIZE=100
# MAX_TOKEN_SUMMARY=500
### RAG Query Configuration
2025-02-23 13:26:38 +08:00
# HISTORY_TURNS=3
2025-07-09 04:37:04 +08:00
# MAX_TOKEN_TEXT_CHUNK=6000
# MAX_TOKEN_RELATION_DESC=4000
# MAX_TOKEN_ENTITY_DESC=4000
2025-02-23 13:26:38 +08:00
# COSINE_THRESHOLD=0.2
2025-07-09 04:37:04 +08:00
### Number of entities or relations to retrieve from KG
2025-02-23 13:26:38 +08:00
# TOP_K=60
2025-07-08 21:44:20 +08:00
### Number of text chunks to retrieve initially from vector search
2025-07-08 13:31:05 +08:00
# CHUNK_TOP_K=5
2025-07-08 21:44:20 +08:00
### Rerank Configuration
# ENABLE_RERANK=False
### Number of text chunks to keep after reranking (should be <= CHUNK_TOP_K)
2025-07-08 13:31:05 +08:00
# CHUNK_RERANK_TOP_K=5
2025-07-08 21:44:20 +08:00
### Rerank model configuration (required when ENABLE_RERANK=True)
# RERANK_MODEL=BAAI/bge-reranker-v2-m3
# RERANK_BINDING_HOST=https://api.your-rerank-provider.com/v1/rerank
# RERANK_BINDING_API_KEY=your_rerank_api_key_here
2025-07-07 17:49:33 +08:00
### Entity and relation summarization configuration
2025-05-14 13:22:03 +08:00
### Language: English, Chinese, French, German ...
2025-03-24 02:02:34 +08:00
SUMMARY_LANGUAGE=English
2025-05-14 13:22:03 +08:00
### Number of duplicated entities/edges to trigger LLM re-summary on merge ( at least 3 is recommented)
# FORCE_LLM_SUMMARY_ON_MERGE=6
2025-04-10 17:29:07 +08:00
### Max tokens for entity/relations description after merge
# MAX_TOKEN_SUMMARY=500
2025-07-01 17:13:33 +08:00
### Maximum number of entity extraction attempts for ambiguous content
2025-07-01 17:14:02 +08:00
# MAX_GLEANING=1
2025-04-10 17:29:07 +08:00
2025-05-14 13:22:03 +08:00
### Number of parallel processing documents(Less than MAX_ASYNC/2 is recommended)
# MAX_PARALLEL_INSERT=2
2025-02-23 13:26:38 +08:00
### LLM Configuration
2025-05-14 13:22:03 +08:00
ENABLE_LLM_CACHE=true
ENABLE_LLM_CACHE_FOR_EXTRACT=true
### Time out in seconds for LLM, None for infinite timeout
2025-05-14 13:22:03 +08:00
TIMEOUT=240
### Some models like o1-mini require temperature to be set to 1
2025-05-14 13:22:03 +08:00
TEMPERATURE=0
### Max concurrency requests of LLM
MAX_ASYNC=4
2025-05-14 21:51:49 +08:00
### MAX_TOKENS: max tokens send to LLM for entity relation summaries (less than context size of the model)
### MAX_TOKENS: set as num_ctx option for Ollama by API Server
MAX_TOKENS=32768
2025-05-16 11:46:38 +08:00
### LLM Binding type: openai, ollama, lollms, azure_openai
2025-05-14 13:22:03 +08:00
LLM_BINDING=openai
LLM_MODEL=gpt-4o
LLM_BINDING_HOST=https://api.openai.com/v1
2025-02-23 13:26:38 +08:00
LLM_BINDING_API_KEY=your_api_key
2025-05-16 11:46:38 +08:00
### Optional for Azure
# AZURE_OPENAI_API_VERSION=2024-08-01-preview
# AZURE_OPENAI_DEPLOYMENT=gpt-4o
2025-05-14 13:22:03 +08:00
### Embedding Configuration
2025-05-16 11:46:38 +08:00
### Embedding Binding type: openai, ollama, lollms, azure_openai
2025-05-14 13:22:03 +08:00
EMBEDDING_BINDING=ollama
EMBEDDING_MODEL=bge-m3:latest
2025-02-23 13:26:38 +08:00
EMBEDDING_DIM=1024
2025-05-14 13:22:03 +08:00
EMBEDDING_BINDING_API_KEY=your_api_key
# If the embedding service is deployed within the same Docker stack, use host.docker.internal instead of localhost
2025-02-23 13:26:38 +08:00
EMBEDDING_BINDING_HOST=http://localhost:11434
2025-05-14 13:22:03 +08:00
### Num of chunks send to Embedding in single request
# EMBEDDING_BATCH_NUM=10
2025-05-14 13:22:03 +08:00
### Max concurrency requests for Embedding
# EMBEDDING_FUNC_MAX_ASYNC=16
### Maximum tokens sent to Embedding for each chunk (no longer in use?)
# MAX_EMBED_TOKENS=8192
2025-05-16 11:46:38 +08:00
### Optional for Azure
# AZURE_EMBEDDING_DEPLOYMENT=text-embedding-3-large
# AZURE_EMBEDDING_API_VERSION=2023-05-15
# AZURE_EMBEDDING_ENDPOINT=your_endpoint
# AZURE_EMBEDDING_API_KEY=your_api_key
2025-07-05 08:04:59 +08:00
###########################
### Data storage selection
2025-07-05 08:04:59 +08:00
###########################
2025-07-07 17:49:33 +08:00
### In-memory database with local file persistence(Recommended for small scale deployment)
# LIGHTRAG_KV_STORAGE=JsonKVStorage
# LIGHTRAG_DOC_STATUS_STORAGE=JsonDocStatusStorage
# LIGHTRAG_GRAPH_STORAGE=NetworkXStorage
# LIGHTRAG_VECTOR_STORAGE=NanoVectorDBStorage
# LIGHTRAG_VECTOR_STORAGE=FaissVectorDBStorage
2025-07-05 08:04:59 +08:00
### PostgreSQL
2025-05-14 13:22:03 +08:00
# LIGHTRAG_KV_STORAGE=PGKVStorage
# LIGHTRAG_DOC_STATUS_STORAGE=PGDocStatusStorage
2025-07-05 08:04:59 +08:00
# LIGHTRAG_GRAPH_STORAGE=PGGraphStorage
# LIGHTRAG_VECTOR_STORAGE=PGVectorStorage
2025-07-07 17:49:33 +08:00
### MongoDB (Vector storage only available on Atlas Cloud)
2025-07-05 08:04:59 +08:00
# LIGHTRAG_KV_STORAGE=MongoKVStorage
# LIGHTRAG_DOC_STATUS_STORAGE=MongoDocStatusStorage
# LIGHTRAG_GRAPH_STORAGE=MongoGraphStorage
# LIGHTRAG_VECTOR_STORAGE=MongoVectorDBStorage
2025-07-07 17:49:33 +08:00
### Redis Storage (Recommended for production deployment)
2025-07-05 08:04:59 +08:00
# LIGHTRAG_KV_STORAGE=RedisKVStorage
# LIGHTRAG_DOC_STATUS_STORAGE=RedisDocStatusStorage
2025-07-07 17:49:33 +08:00
### Vector Storage (Recommended for production deployment)
2025-07-05 08:04:59 +08:00
# LIGHTRAG_VECTOR_STORAGE=MilvusVectorDBStorage
# LIGHTRAG_VECTOR_STORAGE=QdrantVectorDBStorage
2025-07-07 17:49:33 +08:00
### Graph Storage (Recommended for production deployment)
2025-05-14 13:22:03 +08:00
# LIGHTRAG_GRAPH_STORAGE=Neo4JStorage
2025-07-09 03:36:17 +08:00
# LIGHTRAG_GRAPH_STORAGE=MemgraphStorage
####################################################################
### Default workspace for all storage types
### For the purpose of isolation of data for each LightRAG instance
### Valid characters: a-z, A-Z, 0-9, and _
####################################################################
2025-07-09 03:36:17 +08:00
# WORKSPACE=space1
2025-02-11 14:57:37 +08:00
### PostgreSQL Configuration
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_USER=your_username
2025-02-11 14:57:37 +08:00
POSTGRES_PASSWORD='your_password'
POSTGRES_DATABASE=your_database
2025-05-09 14:19:42 +08:00
POSTGRES_MAX_CONNECTIONS=12
# POSTGRES_WORKSPACE=forced_workspace_name
2025-05-14 13:22:03 +08:00
### Neo4j Configuration
NEO4J_URI=neo4j+s://xxxxxxxx.databases.neo4j.io
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD='your_password'
# NEO4J_WORKSPACE=forced_workspace_name
2025-05-14 13:22:03 +08:00
### MongoDB Configuration
2025-03-20 03:19:43 +08:00
MONGO_URI=mongodb://root:root@localhost:27017/
2025-07-08 03:06:19 +08:00
#MONGO_URI=mongodb+srv://xxxx
2025-03-20 03:19:43 +08:00
MONGO_DATABASE=LightRAG
# MONGODB_WORKSPACE=forced_workspace_name
2025-03-20 03:19:43 +08:00
### Milvus Configuration
MILVUS_URI=http://localhost:19530
MILVUS_DB_NAME=lightrag
# MILVUS_USER=root
# MILVUS_PASSWORD=your_password
# MILVUS_TOKEN=your_token
# MILVUS_WORKSPACE=forced_workspace_name
2025-03-20 03:19:43 +08:00
### Qdrant
QDRANT_URL=http://localhost:6333
2025-02-23 13:26:38 +08:00
# QDRANT_API_KEY=your-api-key
# QDRANT_WORKSPACE=forced_workspace_name
### Redis
2025-02-26 18:11:16 +08:00
REDIS_URI=redis://localhost:6379
# REDIS_WORKSPACE=forced_workspace_name
2025-07-08 16:27:38 +02:00
### Memgraph Configuration
MEMGRAPH_URI=bolt://localhost:7687
MEMGRAPH_USERNAME=
MEMGRAPH_PASSWORD=
MEMGRAPH_DATABASE=memgraph
# MEMGRAPH_WORKSPACE=forced_workspace_name