← All questions
System DesignHard· Multimodal RAG· Latency Optimization

One engineer wants a single shared embedding space acro...

A shared embedding space pays a fixed per-query cost against the entire corpus regardless of the budget. In contrast, a router’s cost scales with the number of sources it chooses to query, making it more efficient when latency budgets are tight. The argument for ‘simplicity’ in a shared space is often overstated, as per-modality thresholds suggest the space is rarely truly unified. The router approach only becomes suboptimal if the corpus simplifies to one or two truly comparable modalities, where the router’s overhead no longer provides a benefit.

Code playground (Python)