feat(lightrag): 添加 查询时使用embedding缓存功能
Browse files- 在 LightRAG 类中添加 embedding_cache_config配置项
- 实现基于 embedding 相似度的缓存查询和存储
- 添加量化和反量化函数,用于压缩 embedding 数据
- 新增示例演示 embedding 缓存的使用
examples/lightrag_openai_compatible_demo_embedding_cache.py
CHANGED
@@ -62,7 +62,7 @@ async def main():
|
|
62 |
working_dir=WORKING_DIR,
|
63 |
embedding_cache_config={
|
64 |
"enabled": True,
|
65 |
-
"similarity_threshold": 0.90,
|
66 |
},
|
67 |
llm_model_func=llm_model_func,
|
68 |
embedding_func=EmbeddingFunc(
|
|
|
62 |
working_dir=WORKING_DIR,
|
63 |
embedding_cache_config={
|
64 |
"enabled": True,
|
65 |
+
"similarity_threshold": 0.90,
|
66 |
},
|
67 |
llm_model_func=llm_model_func,
|
68 |
embedding_func=EmbeddingFunc(
|