Posts

RAG Basics answer by Google Gemini AI

  AI Architecture Complete - Chunking, Embeddings, Vector DB - White Edition AI Knowledge Pipeline: Complete Archive Chunking • Embedding Models • LLMs • Vector Databases • Local vs Cloud • Security — All Questions & Answers Preserved and Improved — White Background Edition Contents — All 15 Turns 1. Why do we need chunking? 2. Is chunking mandatory for small files? Limits? 3. Embedding Model vs LLM? 4. Same company model? Single embed model for multiple LLMs? Rebuild needed? 5. Is embed model also an LLM? Can it answer, know English, code? 6. What does embed model know? Maths, programs, history, stocks? 7. Can it calculate 25*40? Will not vs cannot? 8. Does it use frozen weights? Need GPU like LLM? 9. Size? RAM vs Disk? Where is data retrieved from? 10. Deep Dive: Manual vector handling, VDB as MySQL, loop logic, soft-switch, internal embeddings, why called embedding? 11. Pulling internal representations, why LLM heavier, VDB useless without model? Where ...

Mathamatics used in AI vectordatabase --

  Core Native Metrics Inner Product (Dot Product) Euclidean Distance (L₂) Specialized Native Metrics Hamming Distance (Used only for binary embeddings) Jaccard Distance (Used only for sparse token vectors) Manhattan Distance (L₁) (Supported by select engines like FAISS or Milvus for specific use cases) In vector databases, Euclidean Distance and the Pythagorean theorem are fundamental tools used to measure the geometric space between vectors. However, to handle high-dimensional data at scale, vector databases rely on several other core mathematical concepts. Here are the main mathematical concepts used in vector databases, grouped by how they work: 1. Alternative Distance & Similarity Metrics While Euclidean distance (\(L_{2}\) norm) measures the straight-line distance, other metrics are often more effective depending on how data is normalized. Cosine Similarity: Measures the cosine of the angle between two vectors, ignoring their magnitude. It evaluates directional alig...

ai without Cosine Similarity

 ai without Cosine Similarity  -- from Gemini ai Modern AI systems and retrieval-augmented generation (RAG) pipelines can replace cosine similarity with several alternative metrics, hybrid approaches, or model-based re-rankers: [ 1 , 2 , 3 ] 1. Alternative Distance and Similarity Metrics Euclidean Distance (L₂): Measures the direct, straight-line distance between vector endpoints rather than angular alignment, though it is sensitive to vector magnitude. When embeddings are strictly normalized to unit length, Euclidean distance and cosine similarity produce identical rankings. [ 1 , 2 ] Inner Product (Dot Product): Multiplies raw vector components without normalization. It captures both direction and magnitude, making it useful when vector scale carries meaningful signal. [ 1 , 2 ] recos (Rearrangement Inequality): Normalizes the dot product using sorted vector components to relax strict linear dependence into ordinal concordance, outperforming cosine similarity across mu...

Multi Agent Travel planner on amazon Bedrock

 https://medium.com/@ahsan.shaokat/building-a-multi-agent-travel-planner-on-amazon-bedrock-873277d045b9

Why can't we just use a "Soft Switch" on the LLM AS EMbed Model in RAG Design

Answer by google Gemini AI --   This is a brilliant architectural thought. You can technically get vectors directly out of an LLM. In fact, OpenAI and Hugging Face allow you to pull the internal representations from an LLM. So why don't we use a "soft switch" to use the LLM for both jobs? Three critical issues prevent this: The Pooling Problem (The Math is Wrong): When an LLM reads text, it creates a separate vector for every single token . If you pass a 1,000-token chunk into an LLM, it outputs 1,000 vectors. It does not natively know how to compress those 1,000 vectors into a single vector that represents the overall meaning of the paragraph. An embedding model has a special layer at the end (called a pooling layer) specifically trained to average and compress all those tokens into one clean vector . Massive Resource Waste: LLMs are giants (billions of parameters). Loading an 8-Billion parameter LLM into your computer's memory just to output a vector is like dri...