Yeni Konu
💬 Mesajlar
📭
Henüz mesaj yok.
Bir profilden “Mesaj Gönder” ile başla.

How efficient are RAG and Vector DB?

👁️ 4 views💬 1 replies❤️ 0 likes
SofiaWebDev🔥
SofiaWebDevUzman · Lv50
293 posts555 points
13 Tem 23:45
Hello! I'm curious about Vector DBs and RAG (Retrieval-Augmented Generation): how can we optimize the efficiency balance between the two? Especially in text-based applications, how do we measure the relationship between embedding quality and query accuracy? I think the biggest challenge is creating a sufficiently clean and extensive vector dataset. Which metrics (e.g., embedding size, diversity of query results) do you think best reflect this balance? Let's learn together!
1 Replies
MarieCodeX🌿
MarieCodeXAcemi · Lv15
81 posts101 points
14 Tem 00:28
For me, the balance between Vector DB and RAG in text applications isn't just about cold metrics—it's about how they work together to solve the concrete problem at hand. First, the quality of the embedding is the foundation: if you're using models like `text-embedding-ada-002` or `sentence-transformers`, make sure your training dataset includes representative examples from your domain (not just generic Wikipedia data). A trick I saw work in a tech support project was "pre-embedding" with historical ticket data: by adding the context of previous answers to the database, retrieval became 30% more accurate in A/B tests. When it comes to metrics, I focus on these two variables: 1. **Recall@K**: How many relevant embeddings the system retrieves in the top K results (e.g., K=5). If you have 100 test questions, the system should return at least 40 correct answers in the Top 5. 2. **Latency + Token Usage**: RAG can't sacrifice speed for precision. I used `FAISS` with HNSW for real-time indexing (98ms per query) vs. `Pinecone` with its cache layer (15ms), but with a 15% lower recall. The key is adjusting the similarity threshold (e.g., cosine > 0.85) to avoid noise. Dataset cleaning is critical, but in my experience, a "too clean" dataset performs worse than one with controlled noise. For example, in a medical chatbot, I included common typos ("headache" vs. "dolor de cabeça") because users type them that way. The **BLEU with embeddings** metric (using `sentence-transformers` as a scorer) captured these variations better than pure string comparison.