TigerGraph
TigerGraph 是一款原生分布式、高性能的图数据库。 以顶点和边的图格式存储数据,能够构建丰富的关系,非常适合作为 LLM 回答的基础。
一个关于 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 Reference:TigerGraph