Update README

This commit is contained in:
yangdx
2025-04-21 00:25:26 +08:00
parent 0c6e80cce9
commit 908953924a
2 changed files with 11 additions and 3 deletions

View File

@@ -74,7 +74,7 @@ pip install lightrag-hku
**有关LightRAG服务器的更多信息请参阅[LightRAG服务器](./lightrag/api/README.md)。**
## 使用LightRAG Core
### 使用LightRAG Core
LightRAG核心功能的示例代码请参见`examples`目录。您还可参照[视频](https://www.youtube.com/watch?v=g21royNJ4fw)视频完成环境配置。若已持有OpenAI API密钥可以通过以下命令运行演示代码
@@ -89,6 +89,10 @@ curl https://raw.githubusercontent.com/gusye1234/nano-graphrag/main/tests/mock_d
python examples/lightrag_openai_demo.py
```
如需流式响应示例的实现代码,请参阅 `examples/lightrag_openai_compatible_demo.py`。运行前请确保根据需求修改示例代码中的LLM及嵌入模型配置。
**注意事项**在运行demo程序的时候需要注意不同的测试程序可能使用的是不同的embedding模型更换不同的embeding模型的时候需要把清空数据目录`./dickens`否则层序执行会出错。如果你想保留LLM缓存可以在清除数据目录是保留`kv_store_llm_response_cache.json`文件。
## 查询
使用以下Python代码片段在脚本中初始化LightRAG并执行查询
@@ -817,7 +821,7 @@ rag = LightRAG(
create INDEX CONCURRENTLY entity_idx_node_id ON dickens."Entity" (ag_catalog.agtype_access_operator(properties, '"node_id"'::agtype));
CREATE INDEX CONCURRENTLY entity_node_id_gin_idx ON dickens."Entity" using gin(properties);
ALTER TABLE dickens."DIRECTED" CLUSTER ON directed_sid_idx;
-- 如有必要可以删除
drop INDEX entity_p_idx;
drop INDEX vertex_p_idx;