Am I misreading this code? It looks like you don't have precomputed table representations and search, instead you scan, embed, and compare on each run?
Tables, columns and views are scanned at configuration time (or based on an API trigger) and stored in the data store and a vector store, not on every run.
They are then retrieved and injected based on relevance to the query.
https://github.com/Dataherald/dataherald/blob/main/services/...