Optimizing RAG Pipelines: Enhancing AI Service RecommendationsOptimizing RAG Pipelines: Enhancing AI Service Recommendations
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
While building Mahir AI, a service booking app for the Pakistani market, I needed the assistant to recommend real services based on natural language queries, not just keyword matches. That meant building a RAG pipeline on top of Supabase's pgvector extension.
The first version was straightforward: embed every service listing as is, store the vectors, run similarity search. Results were mediocre. A user asking for "someone to fix my kitchen sink" wasn't reliably matching plumbers, because the raw listing data was too sparse and inconsistent, some entries were a single line, others had five.
The fix was in the preprocessing, not the retrieval logic. I restructured each listing into a consistent, context rich chunk before embedding: service type, common problem descriptions, location context, and price range folded into a short natural language paragraph. That alone improved match quality more than any tuning I did on the retrieval side.
This pipeline now sits behind a Gemini based multi agent layer that handles the conversation, decides when to search, and formats the final recommendation. But the lesson that stuck with me: in RAG systems, embedding quality is a data problem before it's a model problem. Most teams over invest in the model and under invest in how they structure what goes into it.
Post image
Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started