From 0b5c708660572a3df561c06e67af911392335e44 Mon Sep 17 00:00:00 2001 From: yangdx Date: Tue, 5 Aug 2025 18:03:51 +0800 Subject: [PATCH] Update storage implementation documentation - Add detailed storage type descriptions - Remove Chroma from vector storage options - Include recommended PostgreSQL version - Add Memgraph to graph storage options - Update performance comparison notes --- README-zh.md | 49 +++++++++++++++++++++++++++++++++++++- README.md | 50 ++++++++++++++++++++++++++++++++++++++- lightrag/api/README-zh.md | 1 - lightrag/api/README.md | 1 - 4 files changed, 97 insertions(+), 4 deletions(-) diff --git a/README-zh.md b/README-zh.md index 2d08ff51..4c74f6e2 100644 --- a/README-zh.md +++ b/README-zh.md @@ -737,7 +737,54 @@ rag.insert(documents, file_paths=file_paths) ### 存储 -LightRAG使用到4种类型的存储,每一种存储都有多种实现方案。在初始化LightRAG的时候可以通过参数设定这四类存储的实现方案。详情请参看前面的LightRAG初始化参数。 +LightRAG 使用 4 种类型的存储用于不同目的: + +* KV_STORAGE:llm 响应缓存、文本块、文档信息 +* VECTOR_STORAGE:实体向量、关系向量、块向量 +* GRAPH_STORAGE:实体关系图 +* DOC_STATUS_STORAGE:文档索引状态 + +每种存储类型都有几种实现: + +* KV_STORAGE 支持的实现名称 + +``` +JsonKVStorage JsonFile(默认) +PGKVStorage Postgres +RedisKVStorage Redis +MongoKVStorage MogonDB +``` + +* GRAPH_STORAGE 支持的实现名称 + +``` +NetworkXStorage NetworkX(默认) +Neo4JStorage Neo4J +PGGraphStorage PostgreSQL with AGE plugin +``` + +> 在测试中Neo4j图形数据库相比PostgreSQL AGE有更好的性能表现。 + +* VECTOR_STORAGE 支持的实现名称 + +``` +NanoVectorDBStorage NanoVector(默认) +PGVectorStorage Postgres +MilvusVectorDBStorge Milvus +FaissVectorDBStorage Faiss +QdrantVectorDBStorage Qdrant +MongoVectorDBStorage MongoDB +``` + +* DOC_STATUS_STORAGE 支持的实现名称 + +``` +JsonDocStatusStorage JsonFile(默认) +PGDocStatusStorage Postgres +MongoDocStatusStorage MongoDB +``` + +每一种存储类型的链接配置范例可以在 `env.example` 文件中找到。链接字符串中的数据库实例是需要你预先在数据库服务器上创建好的,LightRAG 仅负责在数据库实例中创建数据表,不负责创建数据库实例。如果使用 Redis 作为存储,记得给 Redis 配置自动持久化数据规则,否则 Redis 服务重启后数据会丢失。如果使用PostgreSQL数据库,推荐使用16.6版本或以上。
使用Neo4J进行存储 diff --git a/README.md b/README.md index bf319763..ce606554 100644 --- a/README.md +++ b/README.md @@ -747,7 +747,55 @@ rag.insert(documents, file_paths=file_paths) ### Storage -LightRAG uses four types of storage, each of which has multiple implementation options. When initializing LightRAG, the implementation schemes for these four types of storage can be set through parameters. For details, please refer to the previous LightRAG initialization parameters. +LightRAG uses 4 types of storage for different purposes: + +* KV_STORAGE: llm response cache, text chunks, document information +* VECTOR_STORAGE: entities vectors, relation vectors, chunks vectors +* GRAPH_STORAGE: entity relation graph +* DOC_STATUS_STORAGE: document indexing status + +Each storage type has several implementations: + +* KV_STORAGE supported implementations: + +``` +JsonKVStorage JsonFile (default) +PGKVStorage Postgres +RedisKVStorage Redis +MongoKVStorage MongoDB +``` + +* GRAPH_STORAGE supported implementations: + +``` +NetworkXStorage NetworkX (default) +Neo4JStorage Neo4J +PGGraphStorage PostgreSQL with AGE plugin +MemgraphStorage. Memgraph +``` + +> Testing has shown that Neo4J delivers superior performance in production environments compared to PostgreSQL with AGE plugin. + +* VECTOR_STORAGE supported implementations: + +``` +NanoVectorDBStorage NanoVector (default) +PGVectorStorage Postgres +MilvusVectorDBStorage Milvus +FaissVectorDBStorage Faiss +QdrantVectorDBStorage Qdrant +MongoVectorDBStorage MongoDB +``` + +* DOC_STATUS_STORAGE: supported implementations: + +``` +JsonDocStatusStorage JsonFile (default) +PGDocStatusStorage Postgres +MongoDocStatusStorage MongoDB +``` + +Example connection configurations for each storage type can be found in the `env.example` file. The database instance in the connection string needs to be created by you on the database server beforehand. LightRAG is only responsible for creating tables within the database instance, not for creating the database instance itself. If using Redis as storage, remember to configure automatic data persistence rules for Redis, otherwise data will be lost after the Redis service restarts. If using PostgreSQL, it is recommended to use version 16.6 or above.
Using Neo4J for Storage diff --git a/lightrag/api/README-zh.md b/lightrag/api/README-zh.md index b80419e1..6fe5f86c 100644 --- a/lightrag/api/README-zh.md +++ b/lightrag/api/README-zh.md @@ -409,7 +409,6 @@ PGGraphStorage PostgreSQL with AGE plugin NanoVectorDBStorage NanoVector(默认) PGVectorStorage Postgres MilvusVectorDBStorge Milvus -ChromaVectorDBStorage Chroma FaissVectorDBStorage Faiss QdrantVectorDBStorage Qdrant MongoVectorDBStorage MongoDB diff --git a/lightrag/api/README.md b/lightrag/api/README.md index 6e0a59de..ce27baff 100644 --- a/lightrag/api/README.md +++ b/lightrag/api/README.md @@ -412,7 +412,6 @@ MemgraphStorage. Memgraph NanoVectorDBStorage NanoVector (default) PGVectorStorage Postgres MilvusVectorDBStorage Milvus -ChromaVectorDBStorage Chroma FaissVectorDBStorage Faiss QdrantVectorDBStorage Qdrant MongoVectorDBStorage MongoDB