Improve storage config validation and add config.ini fallback support
• Add MongoDB env requirements
• Support config.ini fallback
• Warn on missing env vars
• Check available storage count
• Show config source info
(cherry picked from commit 1a91bcdb5f)
This commit is contained in:
parent
45c10d7f22
commit
5a5e583b9c
2 changed files with 1493 additions and 6 deletions
|
|
@ -45,13 +45,19 @@ STORAGE_IMPLEMENTATIONS = {
|
||||||
STORAGE_ENV_REQUIREMENTS: dict[str, list[str]] = {
|
STORAGE_ENV_REQUIREMENTS: dict[str, list[str]] = {
|
||||||
# KV Storage Implementations
|
# KV Storage Implementations
|
||||||
"JsonKVStorage": [],
|
"JsonKVStorage": [],
|
||||||
"MongoKVStorage": [],
|
"MongoKVStorage": [
|
||||||
|
"MONGO_URI",
|
||||||
|
"MONGO_DATABASE",
|
||||||
|
],
|
||||||
"RedisKVStorage": ["REDIS_URI"],
|
"RedisKVStorage": ["REDIS_URI"],
|
||||||
"PGKVStorage": ["POSTGRES_USER", "POSTGRES_PASSWORD", "POSTGRES_DATABASE"],
|
"PGKVStorage": ["POSTGRES_USER", "POSTGRES_PASSWORD", "POSTGRES_DATABASE"],
|
||||||
# Graph Storage Implementations
|
# Graph Storage Implementations
|
||||||
"NetworkXStorage": [],
|
"NetworkXStorage": [],
|
||||||
"Neo4JStorage": ["NEO4J_URI", "NEO4J_USERNAME", "NEO4J_PASSWORD"],
|
"Neo4JStorage": ["NEO4J_URI", "NEO4J_USERNAME", "NEO4J_PASSWORD"],
|
||||||
"MongoGraphStorage": [],
|
"MongoGraphStorage": [
|
||||||
|
"MONGO_URI",
|
||||||
|
"MONGO_DATABASE",
|
||||||
|
],
|
||||||
"MemgraphStorage": ["MEMGRAPH_URI"],
|
"MemgraphStorage": ["MEMGRAPH_URI"],
|
||||||
"AGEStorage": [
|
"AGEStorage": [
|
||||||
"AGE_POSTGRES_DB",
|
"AGE_POSTGRES_DB",
|
||||||
|
|
@ -65,17 +71,26 @@ STORAGE_ENV_REQUIREMENTS: dict[str, list[str]] = {
|
||||||
],
|
],
|
||||||
# Vector Storage Implementations
|
# Vector Storage Implementations
|
||||||
"NanoVectorDBStorage": [],
|
"NanoVectorDBStorage": [],
|
||||||
"MilvusVectorDBStorage": [],
|
"MilvusVectorDBStorage": [
|
||||||
"ChromaVectorDBStorage": [],
|
"MILVUS_URI",
|
||||||
|
"MILVUS_DB_NAME",
|
||||||
|
],
|
||||||
|
# "ChromaVectorDBStorage": [],
|
||||||
"PGVectorStorage": ["POSTGRES_USER", "POSTGRES_PASSWORD", "POSTGRES_DATABASE"],
|
"PGVectorStorage": ["POSTGRES_USER", "POSTGRES_PASSWORD", "POSTGRES_DATABASE"],
|
||||||
"FaissVectorDBStorage": [],
|
"FaissVectorDBStorage": [],
|
||||||
"QdrantVectorDBStorage": ["QDRANT_URL"], # QDRANT_API_KEY has default value None
|
"QdrantVectorDBStorage": ["QDRANT_URL"], # QDRANT_API_KEY has default value None
|
||||||
"MongoVectorDBStorage": [],
|
"MongoVectorDBStorage": [
|
||||||
|
"MONGO_URI",
|
||||||
|
"MONGO_DATABASE",
|
||||||
|
],
|
||||||
# Document Status Storage Implementations
|
# Document Status Storage Implementations
|
||||||
"JsonDocStatusStorage": [],
|
"JsonDocStatusStorage": [],
|
||||||
"RedisDocStatusStorage": ["REDIS_URI"],
|
"RedisDocStatusStorage": ["REDIS_URI"],
|
||||||
"PGDocStatusStorage": ["POSTGRES_USER", "POSTGRES_PASSWORD", "POSTGRES_DATABASE"],
|
"PGDocStatusStorage": ["POSTGRES_USER", "POSTGRES_PASSWORD", "POSTGRES_DATABASE"],
|
||||||
"MongoDocStatusStorage": [],
|
"MongoDocStatusStorage": [
|
||||||
|
"MONGO_URI",
|
||||||
|
"MONGO_DATABASE",
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
# Storage implementation module mapping
|
# Storage implementation module mapping
|
||||||
|
|
|
||||||
1472
lightrag/tools/migrate_llm_cache.py
Normal file
1472
lightrag/tools/migrate_llm_cache.py
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue