Remove TiDB storage implementaion

This commit is contained in:
yangdx
2025-04-02 14:40:27 +08:00
parent 5d517d72f5
commit 013be621d5
8 changed files with 22 additions and 30 deletions

View File

@@ -1036,8 +1036,8 @@ rag.clear_cache(modes=["local"])
| **参数** | **类型** | **说明** | **默认值** | | **参数** | **类型** | **说明** | **默认值** |
|--------------|----------|-----------------|-------------| |--------------|----------|-----------------|-------------|
| **working_dir** | `str` | 存储缓存的目录 | `lightrag_cache+timestamp` | | **working_dir** | `str` | 存储缓存的目录 | `lightrag_cache+timestamp` |
| **kv_storage** | `str` | Storage type for documents and text chunks. Supported types: `JsonKVStorage`,`PGKVStorage`,`RedisKVStorage`,`MongoKVStorage`,`TiDBKVStorage` | `JsonKVStorage` | | **kv_storage** | `str` | Storage type for documents and text chunks. Supported types: `JsonKVStorage`,`PGKVStorage`,`RedisKVStorage`,`MongoKVStorage` | `JsonKVStorage` |
| **vector_storage** | `str` | Storage type for embedding vectors. Supported types: `NanoVectorDBStorage`,`PGVectorStorage`,`MilvusVectorDBStorage`,`ChromaVectorDBStorage`,`FaissVectorDBStorage`,`TiDBVectorDBStorage`,`MongoVectorDBStorage`,`QdrantVectorDBStorage` | `NanoVectorDBStorage` | | **vector_storage** | `str` | Storage type for embedding vectors. Supported types: `NanoVectorDBStorage`,`PGVectorStorage`,`MilvusVectorDBStorage`,`ChromaVectorDBStorage`,`FaissVectorDBStorage`,`MongoVectorDBStorage`,`QdrantVectorDBStorage` | `NanoVectorDBStorage` |
| **graph_storage** | `str` | Storage type for graph edges and nodes. Supported types: `NetworkXStorage`,`Neo4JStorage`,`PGGraphStorage`,`AGEStorage`,`GremlinStorage` | `NetworkXStorage` | | **graph_storage** | `str` | Storage type for graph edges and nodes. Supported types: `NetworkXStorage`,`Neo4JStorage`,`PGGraphStorage`,`AGEStorage`,`GremlinStorage` | `NetworkXStorage` |
| **doc_status_storage** | `str` | Storage type for documents process status. Supported types: `JsonDocStatusStorage`,`PGDocStatusStorage`,`MongoDocStatusStorage` | `JsonDocStatusStorage` | | **doc_status_storage** | `str` | Storage type for documents process status. Supported types: `JsonDocStatusStorage`,`PGDocStatusStorage`,`MongoDocStatusStorage` | `JsonDocStatusStorage` |
| **chunk_token_size** | `int` | 拆分文档时每个块的最大令牌大小 | `1200` | | **chunk_token_size** | `int` | 拆分文档时每个块的最大令牌大小 | `1200` |

View File

@@ -1064,8 +1064,8 @@ Valid modes are:
| **Parameter** | **Type** | **Explanation** | **Default** | | **Parameter** | **Type** | **Explanation** | **Default** |
|--------------|----------|-----------------|-------------| |--------------|----------|-----------------|-------------|
| **working_dir** | `str` | Directory where the cache will be stored | `lightrag_cache+timestamp` | | **working_dir** | `str` | Directory where the cache will be stored | `lightrag_cache+timestamp` |
| **kv_storage** | `str` | Storage type for documents and text chunks. Supported types: `JsonKVStorage`,`PGKVStorage`,`RedisKVStorage`,`MongoKVStorage`,`TiDBKVStorage` | `JsonKVStorage` | | **kv_storage** | `str` | Storage type for documents and text chunks. Supported types: `JsonKVStorage`,`PGKVStorage`,`RedisKVStorage`,`MongoKVStorage` | `JsonKVStorage` |
| **vector_storage** | `str` | Storage type for embedding vectors. Supported types: `NanoVectorDBStorage`,`PGVectorStorage`,`MilvusVectorDBStorage`,`ChromaVectorDBStorage`,`FaissVectorDBStorage`,`TiDBVectorDBStorage`,`MongoVectorDBStorage`,`QdrantVectorDBStorage` | `NanoVectorDBStorage` | | **vector_storage** | `str` | Storage type for embedding vectors. Supported types: `NanoVectorDBStorage`,`PGVectorStorage`,`MilvusVectorDBStorage`,`ChromaVectorDBStorage`,`FaissVectorDBStorage`,`MongoVectorDBStorage`,`QdrantVectorDBStorage` | `NanoVectorDBStorage` |
| **graph_storage** | `str` | Storage type for graph edges and nodes. Supported types: `NetworkXStorage`,`Neo4JStorage`,`PGGraphStorage`,`AGEStorage`,`GremlinStorage` | `NetworkXStorage` | | **graph_storage** | `str` | Storage type for graph edges and nodes. Supported types: `NetworkXStorage`,`Neo4JStorage`,`PGGraphStorage`,`AGEStorage`,`GremlinStorage` | `NetworkXStorage` |
| **doc_status_storage** | `str` | Storage type for documents process status. Supported types: `JsonDocStatusStorage`,`PGDocStatusStorage`,`MongoDocStatusStorage` | `JsonDocStatusStorage` | | **doc_status_storage** | `str` | Storage type for documents process status. Supported types: `JsonDocStatusStorage`,`PGDocStatusStorage`,`MongoDocStatusStorage` | `JsonDocStatusStorage` |
| **chunk_token_size** | `int` | Maximum token size per chunk when splitting documents | `1200` | | **chunk_token_size** | `int` | Maximum token size per chunk when splitting documents | `1200` |

View File

@@ -13,14 +13,6 @@ uri=redis://localhost:6379/1
[qdrant] [qdrant]
uri = http://localhost:16333 uri = http://localhost:16333
[tidb]
host = localhost
port = 4000
user = your_username
password = your_password
database = your_database
workspace = default # 可选,默认为default
[postgres] [postgres]
host = localhost host = localhost
port = 5432 port = 5432

View File

@@ -109,12 +109,12 @@ LIGHTRAG_VECTOR_STORAGE=NanoVectorDBStorage
LIGHTRAG_GRAPH_STORAGE=NetworkXStorage LIGHTRAG_GRAPH_STORAGE=NetworkXStorage
LIGHTRAG_DOC_STATUS_STORAGE=JsonDocStatusStorage LIGHTRAG_DOC_STATUS_STORAGE=JsonDocStatusStorage
### TiDB Configuration ### TiDB Configuration (Deprecated)
TIDB_HOST=localhost # TIDB_HOST=localhost
TIDB_PORT=4000 # TIDB_PORT=4000
TIDB_USER=your_username # TIDB_USER=your_username
TIDB_PASSWORD='your_password' # TIDB_PASSWORD='your_password'
TIDB_DATABASE=your_database # TIDB_DATABASE=your_database
### separating all data from difference Lightrag instances(deprecating) ### separating all data from difference Lightrag instances(deprecating)
# TIDB_WORKSPACE=default # TIDB_WORKSPACE=default

View File

@@ -1,3 +1,7 @@
###########################################
# TiDB storage implementation is deprecated
###########################################
import asyncio import asyncio
import os import os

View File

@@ -294,7 +294,6 @@ JsonKVStorage JsonFile(默认)
PGKVStorage Postgres PGKVStorage Postgres
RedisKVStorage Redis RedisKVStorage Redis
MongoKVStorage MogonDB MongoKVStorage MogonDB
TiDBKVStorage TiDB
``` ```
* GRAPH_STORAGE 支持的实现名称 * GRAPH_STORAGE 支持的实现名称
@@ -316,7 +315,6 @@ MilvusVectorDBStorge Milvus
ChromaVectorDBStorage Chroma ChromaVectorDBStorage Chroma
FaissVectorDBStorage Faiss FaissVectorDBStorage Faiss
QdrantVectorDBStorage Qdrant QdrantVectorDBStorage Qdrant
TiDBVectorDBStorage TiDB
MongoVectorDBStorage MongoDB MongoVectorDBStorage MongoDB
``` ```

View File

@@ -305,7 +305,6 @@ JsonKVStorage JsonFile(default)
PGKVStorage Postgres PGKVStorage Postgres
RedisKVStorage Redis RedisKVStorage Redis
MongoKVStorage MogonDB MongoKVStorage MogonDB
TiDBKVStorage TiDB
``` ```
* GRAPH_STORAGE supported implement-name * GRAPH_STORAGE supported implement-name
@@ -327,7 +326,6 @@ MilvusVectorDBStorge Milvus
ChromaVectorDBStorage Chroma ChromaVectorDBStorage Chroma
FaissVectorDBStorage Faiss FaissVectorDBStorage Faiss
QdrantVectorDBStorage Qdrant QdrantVectorDBStorage Qdrant
TiDBVectorDBStorage TiDB
MongoVectorDBStorage MongoDB MongoVectorDBStorage MongoDB
``` ```

View File

@@ -4,7 +4,7 @@ STORAGE_IMPLEMENTATIONS = {
"JsonKVStorage", "JsonKVStorage",
"MongoKVStorage", "MongoKVStorage",
"RedisKVStorage", "RedisKVStorage",
"TiDBKVStorage", # "TiDBKVStorage",
"PGKVStorage", "PGKVStorage",
], ],
"required_methods": ["get_by_id", "upsert"], "required_methods": ["get_by_id", "upsert"],
@@ -26,7 +26,7 @@ STORAGE_IMPLEMENTATIONS = {
"NanoVectorDBStorage", "NanoVectorDBStorage",
"MilvusVectorDBStorage", "MilvusVectorDBStorage",
"ChromaVectorDBStorage", "ChromaVectorDBStorage",
"TiDBVectorDBStorage", # "TiDBVectorDBStorage",
"PGVectorStorage", "PGVectorStorage",
"FaissVectorDBStorage", "FaissVectorDBStorage",
"QdrantVectorDBStorage", "QdrantVectorDBStorage",
@@ -50,13 +50,13 @@ STORAGE_ENV_REQUIREMENTS: dict[str, list[str]] = {
"JsonKVStorage": [], "JsonKVStorage": [],
"MongoKVStorage": [], "MongoKVStorage": [],
"RedisKVStorage": ["REDIS_URI"], "RedisKVStorage": ["REDIS_URI"],
"TiDBKVStorage": ["TIDB_USER", "TIDB_PASSWORD", "TIDB_DATABASE"], # "TiDBKVStorage": ["TIDB_USER", "TIDB_PASSWORD", "TIDB_DATABASE"],
"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": [],
"TiDBGraphStorage": ["TIDB_USER", "TIDB_PASSWORD", "TIDB_DATABASE"], # "TiDBGraphStorage": ["TIDB_USER", "TIDB_PASSWORD", "TIDB_DATABASE"],
"AGEStorage": [ "AGEStorage": [
"AGE_POSTGRES_DB", "AGE_POSTGRES_DB",
"AGE_POSTGRES_USER", "AGE_POSTGRES_USER",
@@ -72,7 +72,7 @@ STORAGE_ENV_REQUIREMENTS: dict[str, list[str]] = {
"NanoVectorDBStorage": [], "NanoVectorDBStorage": [],
"MilvusVectorDBStorage": [], "MilvusVectorDBStorage": [],
"ChromaVectorDBStorage": [], "ChromaVectorDBStorage": [],
"TiDBVectorDBStorage": ["TIDB_USER", "TIDB_PASSWORD", "TIDB_DATABASE"], # "TiDBVectorDBStorage": ["TIDB_USER", "TIDB_PASSWORD", "TIDB_DATABASE"],
"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
@@ -97,9 +97,9 @@ STORAGES = {
"MongoVectorDBStorage": ".kg.mongo_impl", "MongoVectorDBStorage": ".kg.mongo_impl",
"RedisKVStorage": ".kg.redis_impl", "RedisKVStorage": ".kg.redis_impl",
"ChromaVectorDBStorage": ".kg.chroma_impl", "ChromaVectorDBStorage": ".kg.chroma_impl",
"TiDBKVStorage": ".kg.tidb_impl", # "TiDBKVStorage": ".kg.tidb_impl",
"TiDBVectorDBStorage": ".kg.tidb_impl", # "TiDBVectorDBStorage": ".kg.tidb_impl",
"TiDBGraphStorage": ".kg.tidb_impl", # "TiDBGraphStorage": ".kg.tidb_impl",
"PGKVStorage": ".kg.postgres_impl", "PGKVStorage": ".kg.postgres_impl",
"PGVectorStorage": ".kg.postgres_impl", "PGVectorStorage": ".kg.postgres_impl",
"AGEStorage": ".kg.age_impl", "AGEStorage": ".kg.age_impl",