pip install graphrag
./graphtest
python -m graphrag.index --init --root ./graphtest
.env
settings.yaml
GRAPHRAG_API_KEY=<you api key>
model
api_base
llm: api_key: ${GRAPHRAG_API_KEY} type: openai_chat model: glm-4-air # 修改LLM api_base: https://open.bigmodel.cn/api/paas/v4 # 修改请求URL embeddings: async_mode: threaded llm: api_key: ${GRAPHRAG_API_KEY} type: openai_embedding model: embedding-3 # 修改向量模型 api_base: https://open.bigmodel.cn/api/paas/v4 # 修改请求URL
python -m graphrag.index --root ./graphtest
python -m graphrag.query --root ./graphtest --method global "your query"
python -m graphrag.query --root ./graphtest --method local "your query"
Was this page helpful?