Skip to content

Commit c6214f3

Browse files
author
hbao
committed
ElasticSearch storage impelemented
1 parent 733adb4 commit c6214f3

File tree

3 files changed

+1133
-0
lines changed

3 files changed

+1133
-0
lines changed

env.example

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,11 @@ EMBEDDING_BINDING_API_KEY=your_api_key
187187
# LIGHTRAG_GRAPH_STORAGE=MongoGraphStorage
188188
# LIGHTRAG_VECTOR_STORAGE=MongoVectorDBStorage
189189

190+
### ElasticSearch
191+
# LIGHTRAG_KV_STORAGE=ESKVStorage
192+
# LIGHTRAG_VECTOR_STORAGE=ESVectorDBStorage
193+
# LIGHTRAG_DOC_STATUS_STORAGE=ESDocStatusStorage
194+
190195
### PostgreSQL Configuration
191196
POSTGRES_HOST=localhost
192197
POSTGRES_PORT=5432
@@ -240,6 +245,11 @@ REDIS_MAX_CONNECTIONS=100
240245
REDIS_RETRY_ATTEMPTS=3
241246
# REDIS_WORKSPACE=forced_workspace_name
242247

248+
### ElasticSearch Configuration
249+
ES_HOST=http://localhost:9200
250+
# ES_USERNAME=elastic
251+
# ES_PASSWORD='corilead'
252+
243253
### Memgraph Configuration
244254
MEMGRAPH_URI=bolt://localhost:7687
245255
MEMGRAPH_USERNAME=

lightrag/kg/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"RedisKVStorage",
66
"PGKVStorage",
77
"MongoKVStorage",
8+
"ESKVStorage",
89
# "TiDBKVStorage",
910
],
1011
"required_methods": ["get_by_id", "upsert"],
@@ -30,6 +31,7 @@
3031
"FaissVectorDBStorage",
3132
"QdrantVectorDBStorage",
3233
"MongoVectorDBStorage",
34+
"ESVectorDBStorage",
3335
# "ChromaVectorDBStorage",
3436
# "TiDBVectorDBStorage",
3537
],
@@ -41,6 +43,7 @@
4143
"RedisDocStatusStorage",
4244
"PGDocStatusStorage",
4345
"MongoDocStatusStorage",
46+
"ESDocStatusStorage",
4447
],
4548
"required_methods": ["get_docs_by_status"],
4649
},
@@ -52,6 +55,7 @@
5255
"JsonKVStorage": [],
5356
"MongoKVStorage": [],
5457
"RedisKVStorage": ["REDIS_URI"],
58+
"ESKVStorage": ["ES_HOST"],
5559
# "TiDBKVStorage": ["TIDB_USER", "TIDB_PASSWORD", "TIDB_DATABASE"],
5660
"PGKVStorage": ["POSTGRES_USER", "POSTGRES_PASSWORD", "POSTGRES_DATABASE"],
5761
# Graph Storage Implementations
@@ -85,6 +89,7 @@
8589
"RedisDocStatusStorage": ["REDIS_URI"],
8690
"PGDocStatusStorage": ["POSTGRES_USER", "POSTGRES_PASSWORD", "POSTGRES_DATABASE"],
8791
"MongoDocStatusStorage": [],
92+
"ESDocStatusStorage": ["ES_HOST"],
8893
}
8994

9095
# Storage implementation module mapping
@@ -114,6 +119,9 @@
114119
"FaissVectorDBStorage": ".kg.faiss_impl",
115120
"QdrantVectorDBStorage": ".kg.qdrant_impl",
116121
"MemgraphStorage": ".kg.memgraph_impl",
122+
"ESKVStorage": ".kg.es_impl",
123+
"ESDocStatusStorage": ".kg.es_impl",
124+
"ESVectorDBStorage": ".kg.es_impl",
117125
}
118126

119127

0 commit comments

Comments
 (0)