Not sure if I understood this correctly, but:
org-agenda-mode
uses the symbol org-agenda-files
to get a list of files that it should use to create the agenda. Via the hook, the function is called before org-agenda-mode
- and ripgrep is so fast that there is little to no delay in generating that list (even with a few thousand org files). The interactivity is not lost. I have been using this little hack for more than a year and it works flawlessly (for me, that is).
org-agenda itself is the bottleneck. If there are more than a hundred org-files to be considered, building the org-agenda starts to take time.
(In fact, rg is so fast and I had so many issues with the database of org-roam v2 that I wrote my own note-taking system based on rg and some of the ideas of org-roam v1 (see here Orgrr - org-roam-ripgrep) Still using it daily.)