TigerGraph
TigerGraph is a natively distributed and high-performance graph database. The storage of data in a graph format of vertices and edges leads to rich relationships, ideal for grouding LLM responses.
一个关于TigerGraph和LangChain集成的大型示例,在此处展示。
安装与设置
按照说明操作 如何连接到 TigerGraph 数据库。
安装 Python SDK:
pip install pyTigerGraph
示例
要使用 TigerGraph InquiryAI 功能,您可以从 langchain_community.graphs 导入 TigerGraph。
import pyTigerGraph as tg
conn = tg.TigerGraphConnection(host="DATABASE_HOST_HERE", graphname="GRAPH_NAME_HERE", username="USERNAME_HERE", password="PASSWORD_HERE")
### ==== CONFIGURE INQUIRYAI HOST ====
conn.ai.configureInquiryAIHost("INQUIRYAI_HOST_HERE")
from langchain_community.graphs import TigerGraph
graph = TigerGraph(conn)
result = graph.query("How many servers are there?")
print(result)
API 参考:TigerGraph