yangdx
commited on
Commit
·
c4d8067
1
Parent(s):
ee42ccf
Remove TiDB storage implementaion
Browse files- README-zh.md +2 -2
- README.md +2 -2
- config.ini.example +0 -8
- env.example +6 -6
- examples/lightrag_tidb_demo.py +4 -0
- lightrag/api/README-zh.md +0 -2
- lightrag/api/README.md +0 -2
- lightrag/kg/__init__.py +8 -8
README-zh.md
CHANGED
@@ -1036,8 +1036,8 @@ rag.clear_cache(modes=["local"])
|
|
1036 |
| **参数** | **类型** | **说明** | **默认值** |
|
1037 |
|--------------|----------|-----------------|-------------|
|
1038 |
| **working_dir** | `str` | 存储缓存的目录 | `lightrag_cache+timestamp` |
|
1039 |
-
| **kv_storage** | `str` | Storage type for documents and text chunks. Supported types: `JsonKVStorage`,`PGKVStorage`,`RedisKVStorage`,`MongoKVStorage
|
1040 |
-
| **vector_storage** | `str` | Storage type for embedding vectors. Supported types: `NanoVectorDBStorage`,`PGVectorStorage`,`MilvusVectorDBStorage`,`ChromaVectorDBStorage`,`FaissVectorDBStorage`,`
|
1041 |
| **graph_storage** | `str` | Storage type for graph edges and nodes. Supported types: `NetworkXStorage`,`Neo4JStorage`,`PGGraphStorage`,`AGEStorage`,`GremlinStorage` | `NetworkXStorage` |
|
1042 |
| **doc_status_storage** | `str` | Storage type for documents process status. Supported types: `JsonDocStatusStorage`,`PGDocStatusStorage`,`MongoDocStatusStorage` | `JsonDocStatusStorage` |
|
1043 |
| **chunk_token_size** | `int` | 拆分文档时每个块的最大令牌大小 | `1200` |
|
|
|
1036 |
| **参数** | **类型** | **说明** | **默认值** |
|
1037 |
|--------------|----------|-----------------|-------------|
|
1038 |
| **working_dir** | `str` | 存储缓存的目录 | `lightrag_cache+timestamp` |
|
1039 |
+
| **kv_storage** | `str` | Storage type for documents and text chunks. Supported types: `JsonKVStorage`,`PGKVStorage`,`RedisKVStorage`,`MongoKVStorage` | `JsonKVStorage` |
|
1040 |
+
| **vector_storage** | `str` | Storage type for embedding vectors. Supported types: `NanoVectorDBStorage`,`PGVectorStorage`,`MilvusVectorDBStorage`,`ChromaVectorDBStorage`,`FaissVectorDBStorage`,`MongoVectorDBStorage`,`QdrantVectorDBStorage` | `NanoVectorDBStorage` |
|
1041 |
| **graph_storage** | `str` | Storage type for graph edges and nodes. Supported types: `NetworkXStorage`,`Neo4JStorage`,`PGGraphStorage`,`AGEStorage`,`GremlinStorage` | `NetworkXStorage` |
|
1042 |
| **doc_status_storage** | `str` | Storage type for documents process status. Supported types: `JsonDocStatusStorage`,`PGDocStatusStorage`,`MongoDocStatusStorage` | `JsonDocStatusStorage` |
|
1043 |
| **chunk_token_size** | `int` | 拆分文档时每个块的最大令牌大小 | `1200` |
|
README.md
CHANGED
@@ -1064,8 +1064,8 @@ Valid modes are:
|
|
1064 |
| **Parameter** | **Type** | **Explanation** | **Default** |
|
1065 |
|--------------|----------|-----------------|-------------|
|
1066 |
| **working_dir** | `str` | Directory where the cache will be stored | `lightrag_cache+timestamp` |
|
1067 |
-
| **kv_storage** | `str` | Storage type for documents and text chunks. Supported types: `JsonKVStorage`,`PGKVStorage`,`RedisKVStorage`,`MongoKVStorage
|
1068 |
-
| **vector_storage** | `str` | Storage type for embedding vectors. Supported types: `NanoVectorDBStorage`,`PGVectorStorage`,`MilvusVectorDBStorage`,`ChromaVectorDBStorage`,`FaissVectorDBStorage`,`
|
1069 |
| **graph_storage** | `str` | Storage type for graph edges and nodes. Supported types: `NetworkXStorage`,`Neo4JStorage`,`PGGraphStorage`,`AGEStorage`,`GremlinStorage` | `NetworkXStorage` |
|
1070 |
| **doc_status_storage** | `str` | Storage type for documents process status. Supported types: `JsonDocStatusStorage`,`PGDocStatusStorage`,`MongoDocStatusStorage` | `JsonDocStatusStorage` |
|
1071 |
| **chunk_token_size** | `int` | Maximum token size per chunk when splitting documents | `1200` |
|
|
|
1064 |
| **Parameter** | **Type** | **Explanation** | **Default** |
|
1065 |
|--------------|----------|-----------------|-------------|
|
1066 |
| **working_dir** | `str` | Directory where the cache will be stored | `lightrag_cache+timestamp` |
|
1067 |
+
| **kv_storage** | `str` | Storage type for documents and text chunks. Supported types: `JsonKVStorage`,`PGKVStorage`,`RedisKVStorage`,`MongoKVStorage` | `JsonKVStorage` |
|
1068 |
+
| **vector_storage** | `str` | Storage type for embedding vectors. Supported types: `NanoVectorDBStorage`,`PGVectorStorage`,`MilvusVectorDBStorage`,`ChromaVectorDBStorage`,`FaissVectorDBStorage`,`MongoVectorDBStorage`,`QdrantVectorDBStorage` | `NanoVectorDBStorage` |
|
1069 |
| **graph_storage** | `str` | Storage type for graph edges and nodes. Supported types: `NetworkXStorage`,`Neo4JStorage`,`PGGraphStorage`,`AGEStorage`,`GremlinStorage` | `NetworkXStorage` |
|
1070 |
| **doc_status_storage** | `str` | Storage type for documents process status. Supported types: `JsonDocStatusStorage`,`PGDocStatusStorage`,`MongoDocStatusStorage` | `JsonDocStatusStorage` |
|
1071 |
| **chunk_token_size** | `int` | Maximum token size per chunk when splitting documents | `1200` |
|
config.ini.example
CHANGED
@@ -13,14 +13,6 @@ uri=redis://localhost:6379/1
|
|
13 |
[qdrant]
|
14 |
uri = http://localhost:16333
|
15 |
|
16 |
-
[tidb]
|
17 |
-
host = localhost
|
18 |
-
port = 4000
|
19 |
-
user = your_username
|
20 |
-
password = your_password
|
21 |
-
database = your_database
|
22 |
-
workspace = default # 可选,默认为default
|
23 |
-
|
24 |
[postgres]
|
25 |
host = localhost
|
26 |
port = 5432
|
|
|
13 |
[qdrant]
|
14 |
uri = http://localhost:16333
|
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
[postgres]
|
17 |
host = localhost
|
18 |
port = 5432
|
env.example
CHANGED
@@ -109,12 +109,12 @@ LIGHTRAG_VECTOR_STORAGE=NanoVectorDBStorage
|
|
109 |
LIGHTRAG_GRAPH_STORAGE=NetworkXStorage
|
110 |
LIGHTRAG_DOC_STATUS_STORAGE=JsonDocStatusStorage
|
111 |
|
112 |
-
### TiDB Configuration
|
113 |
-
TIDB_HOST=localhost
|
114 |
-
TIDB_PORT=4000
|
115 |
-
TIDB_USER=your_username
|
116 |
-
TIDB_PASSWORD='your_password'
|
117 |
-
TIDB_DATABASE=your_database
|
118 |
### separating all data from difference Lightrag instances(deprecating)
|
119 |
# TIDB_WORKSPACE=default
|
120 |
|
|
|
109 |
LIGHTRAG_GRAPH_STORAGE=NetworkXStorage
|
110 |
LIGHTRAG_DOC_STATUS_STORAGE=JsonDocStatusStorage
|
111 |
|
112 |
+
### TiDB Configuration (Deprecated)
|
113 |
+
# TIDB_HOST=localhost
|
114 |
+
# TIDB_PORT=4000
|
115 |
+
# TIDB_USER=your_username
|
116 |
+
# TIDB_PASSWORD='your_password'
|
117 |
+
# TIDB_DATABASE=your_database
|
118 |
### separating all data from difference Lightrag instances(deprecating)
|
119 |
# TIDB_WORKSPACE=default
|
120 |
|
examples/lightrag_tidb_demo.py
CHANGED
@@ -1,3 +1,7 @@
|
|
|
|
|
|
|
|
|
|
1 |
import asyncio
|
2 |
import os
|
3 |
|
|
|
1 |
+
###########################################
|
2 |
+
# TiDB storage implementation is deprecated
|
3 |
+
###########################################
|
4 |
+
|
5 |
import asyncio
|
6 |
import os
|
7 |
|
lightrag/api/README-zh.md
CHANGED
@@ -294,7 +294,6 @@ JsonKVStorage JsonFile(默认)
|
|
294 |
PGKVStorage Postgres
|
295 |
RedisKVStorage Redis
|
296 |
MongoKVStorage MogonDB
|
297 |
-
TiDBKVStorage TiDB
|
298 |
```
|
299 |
|
300 |
* GRAPH_STORAGE 支持的实现名称
|
@@ -316,7 +315,6 @@ MilvusVectorDBStorge Milvus
|
|
316 |
ChromaVectorDBStorage Chroma
|
317 |
FaissVectorDBStorage Faiss
|
318 |
QdrantVectorDBStorage Qdrant
|
319 |
-
TiDBVectorDBStorage TiDB
|
320 |
MongoVectorDBStorage MongoDB
|
321 |
```
|
322 |
|
|
|
294 |
PGKVStorage Postgres
|
295 |
RedisKVStorage Redis
|
296 |
MongoKVStorage MogonDB
|
|
|
297 |
```
|
298 |
|
299 |
* GRAPH_STORAGE 支持的实现名称
|
|
|
315 |
ChromaVectorDBStorage Chroma
|
316 |
FaissVectorDBStorage Faiss
|
317 |
QdrantVectorDBStorage Qdrant
|
|
|
318 |
MongoVectorDBStorage MongoDB
|
319 |
```
|
320 |
|
lightrag/api/README.md
CHANGED
@@ -305,7 +305,6 @@ JsonKVStorage JsonFile(default)
|
|
305 |
PGKVStorage Postgres
|
306 |
RedisKVStorage Redis
|
307 |
MongoKVStorage MogonDB
|
308 |
-
TiDBKVStorage TiDB
|
309 |
```
|
310 |
|
311 |
* GRAPH_STORAGE supported implement-name
|
@@ -327,7 +326,6 @@ MilvusVectorDBStorge Milvus
|
|
327 |
ChromaVectorDBStorage Chroma
|
328 |
FaissVectorDBStorage Faiss
|
329 |
QdrantVectorDBStorage Qdrant
|
330 |
-
TiDBVectorDBStorage TiDB
|
331 |
MongoVectorDBStorage MongoDB
|
332 |
```
|
333 |
|
|
|
305 |
PGKVStorage Postgres
|
306 |
RedisKVStorage Redis
|
307 |
MongoKVStorage MogonDB
|
|
|
308 |
```
|
309 |
|
310 |
* GRAPH_STORAGE supported implement-name
|
|
|
326 |
ChromaVectorDBStorage Chroma
|
327 |
FaissVectorDBStorage Faiss
|
328 |
QdrantVectorDBStorage Qdrant
|
|
|
329 |
MongoVectorDBStorage MongoDB
|
330 |
```
|
331 |
|
lightrag/kg/__init__.py
CHANGED
@@ -4,7 +4,7 @@ STORAGE_IMPLEMENTATIONS = {
|
|
4 |
"JsonKVStorage",
|
5 |
"MongoKVStorage",
|
6 |
"RedisKVStorage",
|
7 |
-
"TiDBKVStorage",
|
8 |
"PGKVStorage",
|
9 |
],
|
10 |
"required_methods": ["get_by_id", "upsert"],
|
@@ -26,7 +26,7 @@ STORAGE_IMPLEMENTATIONS = {
|
|
26 |
"NanoVectorDBStorage",
|
27 |
"MilvusVectorDBStorage",
|
28 |
"ChromaVectorDBStorage",
|
29 |
-
"TiDBVectorDBStorage",
|
30 |
"PGVectorStorage",
|
31 |
"FaissVectorDBStorage",
|
32 |
"QdrantVectorDBStorage",
|
@@ -50,13 +50,13 @@ STORAGE_ENV_REQUIREMENTS: dict[str, list[str]] = {
|
|
50 |
"JsonKVStorage": [],
|
51 |
"MongoKVStorage": [],
|
52 |
"RedisKVStorage": ["REDIS_URI"],
|
53 |
-
"TiDBKVStorage": ["TIDB_USER", "TIDB_PASSWORD", "TIDB_DATABASE"],
|
54 |
"PGKVStorage": ["POSTGRES_USER", "POSTGRES_PASSWORD", "POSTGRES_DATABASE"],
|
55 |
# Graph Storage Implementations
|
56 |
"NetworkXStorage": [],
|
57 |
"Neo4JStorage": ["NEO4J_URI", "NEO4J_USERNAME", "NEO4J_PASSWORD"],
|
58 |
"MongoGraphStorage": [],
|
59 |
-
"TiDBGraphStorage": ["TIDB_USER", "TIDB_PASSWORD", "TIDB_DATABASE"],
|
60 |
"AGEStorage": [
|
61 |
"AGE_POSTGRES_DB",
|
62 |
"AGE_POSTGRES_USER",
|
@@ -72,7 +72,7 @@ STORAGE_ENV_REQUIREMENTS: dict[str, list[str]] = {
|
|
72 |
"NanoVectorDBStorage": [],
|
73 |
"MilvusVectorDBStorage": [],
|
74 |
"ChromaVectorDBStorage": [],
|
75 |
-
"TiDBVectorDBStorage": ["TIDB_USER", "TIDB_PASSWORD", "TIDB_DATABASE"],
|
76 |
"PGVectorStorage": ["POSTGRES_USER", "POSTGRES_PASSWORD", "POSTGRES_DATABASE"],
|
77 |
"FaissVectorDBStorage": [],
|
78 |
"QdrantVectorDBStorage": ["QDRANT_URL"], # QDRANT_API_KEY has default value None
|
@@ -97,9 +97,9 @@ STORAGES = {
|
|
97 |
"MongoVectorDBStorage": ".kg.mongo_impl",
|
98 |
"RedisKVStorage": ".kg.redis_impl",
|
99 |
"ChromaVectorDBStorage": ".kg.chroma_impl",
|
100 |
-
"TiDBKVStorage": ".kg.tidb_impl",
|
101 |
-
"TiDBVectorDBStorage": ".kg.tidb_impl",
|
102 |
-
"TiDBGraphStorage": ".kg.tidb_impl",
|
103 |
"PGKVStorage": ".kg.postgres_impl",
|
104 |
"PGVectorStorage": ".kg.postgres_impl",
|
105 |
"AGEStorage": ".kg.age_impl",
|
|
|
4 |
"JsonKVStorage",
|
5 |
"MongoKVStorage",
|
6 |
"RedisKVStorage",
|
7 |
+
# "TiDBKVStorage",
|
8 |
"PGKVStorage",
|
9 |
],
|
10 |
"required_methods": ["get_by_id", "upsert"],
|
|
|
26 |
"NanoVectorDBStorage",
|
27 |
"MilvusVectorDBStorage",
|
28 |
"ChromaVectorDBStorage",
|
29 |
+
# "TiDBVectorDBStorage",
|
30 |
"PGVectorStorage",
|
31 |
"FaissVectorDBStorage",
|
32 |
"QdrantVectorDBStorage",
|
|
|
50 |
"JsonKVStorage": [],
|
51 |
"MongoKVStorage": [],
|
52 |
"RedisKVStorage": ["REDIS_URI"],
|
53 |
+
# "TiDBKVStorage": ["TIDB_USER", "TIDB_PASSWORD", "TIDB_DATABASE"],
|
54 |
"PGKVStorage": ["POSTGRES_USER", "POSTGRES_PASSWORD", "POSTGRES_DATABASE"],
|
55 |
# Graph Storage Implementations
|
56 |
"NetworkXStorage": [],
|
57 |
"Neo4JStorage": ["NEO4J_URI", "NEO4J_USERNAME", "NEO4J_PASSWORD"],
|
58 |
"MongoGraphStorage": [],
|
59 |
+
# "TiDBGraphStorage": ["TIDB_USER", "TIDB_PASSWORD", "TIDB_DATABASE"],
|
60 |
"AGEStorage": [
|
61 |
"AGE_POSTGRES_DB",
|
62 |
"AGE_POSTGRES_USER",
|
|
|
72 |
"NanoVectorDBStorage": [],
|
73 |
"MilvusVectorDBStorage": [],
|
74 |
"ChromaVectorDBStorage": [],
|
75 |
+
# "TiDBVectorDBStorage": ["TIDB_USER", "TIDB_PASSWORD", "TIDB_DATABASE"],
|
76 |
"PGVectorStorage": ["POSTGRES_USER", "POSTGRES_PASSWORD", "POSTGRES_DATABASE"],
|
77 |
"FaissVectorDBStorage": [],
|
78 |
"QdrantVectorDBStorage": ["QDRANT_URL"], # QDRANT_API_KEY has default value None
|
|
|
97 |
"MongoVectorDBStorage": ".kg.mongo_impl",
|
98 |
"RedisKVStorage": ".kg.redis_impl",
|
99 |
"ChromaVectorDBStorage": ".kg.chroma_impl",
|
100 |
+
# "TiDBKVStorage": ".kg.tidb_impl",
|
101 |
+
# "TiDBVectorDBStorage": ".kg.tidb_impl",
|
102 |
+
# "TiDBGraphStorage": ".kg.tidb_impl",
|
103 |
"PGKVStorage": ".kg.postgres_impl",
|
104 |
"PGVectorStorage": ".kg.postgres_impl",
|
105 |
"AGEStorage": ".kg.age_impl",
|