feat(lightrag): 添加 查询时使用embedding缓存功能
- 在 LightRAG 类中添加 embedding_cache_config配置项 - 实现基于 embedding 相似度的缓存查询和存储 - 添加量化和反量化函数,用于压缩 embedding 数据 - 新增示例演示 embedding 缓存的使用
This commit is contained in:
@@ -85,7 +85,10 @@ class LightRAG:
|
||||
working_dir: str = field(
|
||||
default_factory=lambda: f"./lightrag_cache_{datetime.now().strftime('%Y-%m-%d-%H:%M:%S')}"
|
||||
)
|
||||
|
||||
# Default not to use embedding cache
|
||||
embedding_cache_config: dict = field(
|
||||
default_factory=lambda: {"enabled": False, "similarity_threshold": 0.95}
|
||||
)
|
||||
kv_storage: str = field(default="JsonKVStorage")
|
||||
vector_storage: str = field(default="NanoVectorDBStorage")
|
||||
graph_storage: str = field(default="NetworkXStorage")
|
||||
|
Reference in New Issue
Block a user