Zero. I’ve done this with google drive and GPT-3 (thus quite limited in prompt length). The biggest hurdle for your requirements is the nonexistent public API for ChatGPT and Roam Research.
Obsidian is just plain text. Only a matter of time before ChatGPT is accessible via API (there are some libraries that have reverse engineered the API; I put ChatGPT in VSCode when it first came out). Until then, GPT3 has an API.
Not sure if this is still supported, but Roam used to have an in-app query interface. You could use the JS console to run Datomic style Datalog queries.