TigerGraph
TigerGraph 是一个原生分布式和高性能的图数据库。以顶点和边组成的图格式存储数据可以形成丰富的关系,非常适合用于 grounding LLM 响应。
TigerGraph
和 LangChain
集成的一个重要示例在此处展示。
安装和设置
安装 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