I am not sure if this is the right place to post a PostgreSQL + Retrieval Augmented Generation (RAG) question, but I have tried other sites but I did not receive any response.
I have managed to use RAG to query data in a PostgreSQL table using Python and the lanchain_community module.
But I have been struggling for weeks trying to find a solution to using RAG to perform WITH RECURSIVE CTE on two tables (modeling node and edge graph data).
The SQL queries generated by RAG for this graph data model are error prone.
Is there an example somewhere where RAG has been used to successfully generate WITH RECURSIVE CTE on two table graph data?
Below is the main code section I am using to perform RAG on PostgreSQL.