← All questions
RAGHard· System Design· Data Strategy· Retrieval

The data team wants tables in a warehouse for text-to-SQL; the search team wants everything in a vector index. How do you adjudicate?

Partition the strategy based on the question type. Lookup questions are answerable via retrieval if headers are repeated in rows. Aggregation questions, which require properties of a column, are better suited for text-to-SQL in a warehouse. The decision should be driven by the cost of maintaining schemas: the warehouse path is efficient when a few table shapes cover most traffic, but it becomes unsustainable with hundreds of one-off layouts. A robust system extracts recurring shapes for the warehouse and leaves the long tail in the vector index, routing queries accordingly.

Code playground (Python)