graphrag
graphrag copied to clipboard
Added Postgres pipeline storage
Description
We need a RAG solution for on-prem deployments. The current pipeline storage options (Cosmos DB and Blob Storage) do not support on-prem environments, and we want to avoid storing the graph in files or memory. To address this, I added support for PostgreSQL as a storage option, providing an additional way to persist graphs.
Related Issues
https://github.com/microsoft/graphrag/discussions/1679
Proposed Changes
- Implemented a PostgreSQL storage pipeline, following the same design pattern as
cosmosdb_pipeline_storage.pyandfile_pipeline_storage.py. - Because id serves as the primary key in PostgreSQL tables, it is explicitly included in the graph during initialization.
Checklist
- [x] I have tested these changes locally.
- [x] I have reviewed the code changes.
- [ ] I have updated the documentation (if necessary).
- [ ] I have added appropriate unit tests (if applicable).
Additional Notes
[Add any additional notes or context that may be helpful for the reviewer(s).]