query_engine = index.as_query_engine()
response = query_engine.query("Tell me more about Interleaf")
from IPython.display import display, Markdown
display(Markdown(f"<b>{response}</b>"))
可视化图RAG:
%ngql --address 127.0.0.1 --port 9669 --user root --password <password>
%%ngql
USE paul_graham_essay;
MATCH p=(n)-[*1..2]-()
WHERE id(n) IN ['Interleaf', 'history', 'Software', 'Company']
RETURN p LIMIT 100;
%ng_draw
4条答案
按热度按时间erhoui1w1#
要使用NebulaGraph进行检索增强生成(RAG)操作,并结合你现有的数据,请按照以下步骤进行:
对于OpenAI:
对于Azure OpenAI:
准备NebulaGraph:
确保你已经运行了具有定义数据模式的NebulaGraph。
示例化NebulaGraphStore:
通过遵循这些步骤,你可以利用NebulaGraph对你现有的数据进行检索增强生成(RAG)。这个过程包括加载你的数据、对其进行索引、存储索引、查询它以及评估结果以确保准确性和相关性。这样可以让你通过将特定的数据融入到LLM 1(https://github.com/run-llama/llama_index/blob/main/docs/docs/examples/query_engine/knowledge_graph_rag_query_engine.ipynb)2(https://github.com/run-llama/llama_index/blob/main/docs/docs/examples/query_engine/knowledge_graph_query_engine.ipynb)3(https://github.com/run-llama/llama_index/blob/main/docs/docs/getting_started/concepts.md)4(https://github.com/run-llama/llama_index/blob/main/docs/docs/examples/index_structs/knowledge_graph/NebulaGraphKGIndexDemo.ipynb) 生成的响应中,来增强你的LLM应用的能力。如果你想继续与 Dosu 对话,请提及 @dosu。
1mrurvl12#
我的数据已经保存在NebulaGraph中,而不是本地数据。
h9vpoimq3#
除非你用llama-index构建它,否则你能做的最好的事情就是text2cypher。
e7arh2l64#
除非你用llama-index构建了它,否则你能做的最好的事情就是text2cypher。
我想问一个关于llama-index的问题。目前,我只在llama-index中找到了KnowledgeGraphIndex.from_documents函数来实现它,但这个函数似乎只是提取本地数据实体关系并将其存储在Neo4j中。既然我已经将提取的实体和关系放入Neo4j中,接下来我应该做什么?从NG中提取数据,然后将其输入到这个函数中吗?