General Introduction
GraphRAG-Dify is an open source project , designed to combine GraphRAG and Dify technology , rapid creation and deployment of AI Agents. the project utilizes FastAPI and Uvicorn for service building , and supports DSL import , which is convenient for users to integrate and use in real applications .
Function List
- Create AI Agent: Combine GraphRAG and Dify technology to quickly create an AI Agent.
- Service building: Use FastAPI and Uvicorn for service building to ensure efficient operation.
- DSL Import: Supports DSL import for easy user integration and use.
- Code Management: Provides detailed code management and version control functions.
- Compatibility: Compatible with the latest official version to ensure the stability and reliability of the code.
Using Help
Installation and Configuration
- Clone Code Repository::
git clone https://github.com/brightwang/graphrag-dify.git cd graphrag-dify
- Installation of dependencies: In
pyproject.toml
file, add the following dependency packages and runpoetry install
::[tool.poetry.dependencies] fastapi = "^0.115.0" uvicorn = "^0.31.0" asyncio = "^3.4.3" utils = "^1.0.2"
- Configuring GraphRAG: Will
main.py
file in the GraphRAG project source root directory and place thesearch.py
cap (a poem)search_prompt.py
Overwrite the GraphRAG source files according to the directory location in the repository. - Generating Indexes: Store the generated index files in the root directory of the
indexes
Catalog.
Using GraphRAG-Dify
- Starting services: Use the following command to start the GraphRAG service:
poetry shell uvicorn main:app --reload --host 0.0.0.0 --port 8000
- Test Enquiry: Refer to the following command to test whether the service is running properly:
poetry run poe query --root . /indexs/wzry ---method local --response_type search_prompt "What skills does Xiang Yu have"
- Import Dify DSL: Import the two DSLs from Dify and re-publish the workflow as a tool and re-reference it in Agent, as described in the video tutorial in the project.
Detailed function operation flow
- GraphRAG combined with Dify::
- Expose GraphRAG as an HTTP service for use by Dify.
- Configure Dify's Agent to be able to invoke services provided by GraphRAG.
- Define Dify's workflow via DSL and publish it as a tool.
- Testing and validation::
- Verify the correctness of the service using the test commands provided.
- Adjust configuration files and code to ensure stable service operation.
- Optimization and Maintenance::
- Dependency packages are updated regularly to maintain compatibility with the official version of GraphRAG.
- Optimize code and configuration to improve service performance based on actual usage.