Skip to main content
TigerGraph 是一款原生分布式、高性能图数据库。 以顶点和边的图格式存储数据,形成丰富的关系,非常适合为 LLM 响应提供数据基础。
TigerGraphLangChain 集成的完整示例请见此处

安装与配置

按照如何连接到 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)