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 參考:TigerGraph