[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"categories-en":3,"post:\u002Fpost\u002Fembeddings-explained-the-secret-to-making-ai-understand-your-data-and-not-hallucinate":37},[4,11,17,24,30],{"id":5,"slug":6,"name":7,"colorHex":8,"iconName":9,"postCount":10},"0e2c1225-f78a-4c20-8c93-998ab9dc93b9","frontend","Frontend","#40484f",null,25,{"id":12,"slug":13,"name":14,"colorHex":15,"iconName":9,"postCount":16},"bc8df70e-b7fb-4d89-a80c-fd458d36d58c","code-development","Code & Development","#8b5cf6",23,{"id":18,"slug":19,"name":20,"colorHex":21,"iconName":22,"postCount":23},"550e8400-e29b-41d4-a716-446655440001","inteligencia-artificial","Artificial Intelligence","#6366f1","brain",14,{"id":25,"slug":26,"name":27,"colorHex":28,"iconName":9,"postCount":29},"ea63b69c-2eb4-4100-81f3-70ce52d33743","tech-news","Tech News","#e50606",4,{"id":31,"slug":32,"name":33,"colorHex":34,"iconName":35,"postCount":36},"550e8400-e29b-41d4-a716-446655440017","how-to-guides","How-To & Guides","#be123c","book-open",2,{"post":38,"related":641,"translations":709,"resolved":9},{"id":39,"slug":40,"title":41,"excerpt":42,"image":43,"featured":44,"groupId":45,"publishedAt":46,"readingTime":47,"views":48,"author":49,"category":51,"tags":52,"contentJson":62,"metaTitle":638,"metaDescription":639,"updatedAt":640},"983e9be1-5816-425a-a65d-5ba5f22c5c03","embeddings-explained-the-secret-to-making-ai-understand-your-data-and-not-hallucinate","Embeddings Explained: The Secret to Making AI Understand Your Data (and Not Hallucinate)","Embeddings are the technical foundation for making RAG (AI with your data) work, transforming text into numbers that represent meaning. Without them, your AI is dumb or too expensive. This practical guide with Python and sentence-transformers shows how to implement semantic search, solve synonym problems, and understand why they're essential for building intelligent and efficient chatbots.","https:\u002F\u002Fmfgiomkkbihnlpfdxwrt.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fblog-assets\u002Fmedia\u002Ffeatured\u002F1772074951735-featured-02wwin.jpeg",false,"e9df2da0-0452-4bb6-ad67-51210582f344","2026-03-25T16:13:04.604+00:00",6,92,{"name":50,"avatar":9},"Genildo Souza",{"slug":19,"name":20,"color":21},[53,56,59],{"slug":54,"name":55},"rag","RAG",{"slug":57,"name":58},"llm","LLM",{"slug":60,"name":61},"ai","AI",{"type":63,"content":64},"doc",[65,85,91,97,99,107,113,119,146,149,159,165,173,191,192,197,203,216,222,228,237,254,260,266,267,273,279,285,367,373,378,379,385,391,397,405,414,449,455,471,472,478,484,492,536,544,578,579,585,591,609,626,631,635],{"type":66,"attrs":67,"content":69},"blockquote",{"id":68},"quote_jq5bve5p",[70],{"type":71,"attrs":72,"content":74},"paragraph",{"id":73},"p_b5aluafj",[75,78,83],{"text":76,"type":77},"Embeddings transform text into lists of numbers that represent ","text",{"text":79,"type":77,"marks":80},"meaning",[81],{"type":82},"italic",{"text":84,"type":77},", not words. It's the technical foundation for making RAG (AI with your data) work. Without it, your AI is dumb or too expensive.",{"type":71,"attrs":86,"content":88},{"id":87},"p_2prct6fc",[89],{"text":90,"type":77},"Your user asks \"what's the profit?\" and your AI searches for the word \"profit\" in the database. The problem? The official report uses the phrase \"net income\". Result: the AI says \"I couldn't find anything.\"",{"type":71,"attrs":92,"content":94},{"id":93},"p_2bcaozej",[95],{"text":96,"type":77},"Keyword search fails in this scenario 100% of the time. That's exactly where embeddings come in.",{"type":98},"horizontalRule",{"type":100,"attrs":101,"content":104},"heading",{"id":102,"level":103},"h_zayv21rt",3,[105],{"text":106,"type":77},"What Embeddings Actually Are",{"type":71,"attrs":108,"content":110},{"id":109},"p_ttvns19o",[111],{"text":112,"type":77},"Forget complex mathematical definitions for a second.",{"type":71,"attrs":114,"content":116},{"id":115},"p_rzqf9t5w",[117],{"text":118,"type":77},"Think of a GPS map.",{"type":120,"attrs":121,"content":124},"bulletList",{"id":122,"tight":123},"ul_sf0cltyl",true,[125,136],{"type":126,"attrs":127,"content":129},"listItem",{"id":128},"li_nnut4vya",[130],{"type":71,"attrs":131,"content":133},{"id":132},"p_d2gf2ux9",[134],{"text":135,"type":77},"\"Pizza place\" and \"Restaurant\" are close to each other on the map.",{"type":126,"attrs":137,"content":139},{"id":138},"li_k32vsu6o",[140],{"type":71,"attrs":141,"content":143},{"id":142},"p_d7qvrvv6",[144],{"text":145,"type":77},"\"Auto repair shop\" is far from \"Pizza place.\"",{"type":71,"attrs":147},{"id":148},"p_bmmfkald",{"type":71,"attrs":150,"content":152},{"id":151},"p_41fp3tne",[153,155,157],{"text":154,"type":77},"Embeddings do this, but with text.",{"type":156},"hardBreak",{"text":158,"type":77},"They transform sentences into coordinates (vectors) in a massive space. Sentences with similar meanings are \"close\" (similar numbers). Sentences with different meanings are \"far\" (different numbers).",{"type":71,"attrs":160,"content":162},{"id":161},"p_z68m27fq",[163],{"text":164,"type":77},"It doesn't matter if the user writes \"money,\" \"cash,\" or \"capital.\" If the context is financial, the embedding generates very similar numbers for these terms.",{"type":166,"attrs":167},"image",{"id":168,"alt":169,"src":170,"size":171,"align":172,"title":9,"width":9,"height":9},"img_730hm3d9","Visual representation of embeddings in vector space showing semantically similar phrases clustered together","https:\u002F\u002Fmfgiomkkbihnlpfdxwrt.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fblog-assets\u002Fmedia\u002F1772074457685-3hwnof.png","large","center",{"type":71,"attrs":174,"content":176},{"id":175},"p_4x4epbop",[177,179,183,185,189],{"text":178,"type":77},"This allows the computer to understand ",{"text":180,"type":77,"marks":181},"synonyms",[182],{"type":82},{"text":184,"type":77}," and ",{"text":186,"type":77,"marks":187},"intent",[188],{"type":82},{"text":190,"type":77},", without needing giant if\u002Felse rules.",{"type":98},{"type":166,"attrs":193},{"id":194,"alt":195,"src":196,"size":171,"align":172,"title":195,"width":9,"height":9},"img_0n3cx05r","3D vector space visualization showing clusters of semantically similar words: 'money', 'cash', 'capital' grouped close together, while 'pizza' and 'restaurant' form another cluster, and 'auto repair' isolated far away. Small floating dots represent words as points in space with connecting lines showing similarity relationships. Clean minimal style with soft gradient background.","https:\u002F\u002Fcdn.leonardo.ai\u002Fusers\u002F88cebc39-26ed-4801-a7c7-03a601670251\u002Fgenerations\u002Fe96afbd5-4704-482e-be30-7df3d4b72475\u002FPhoenix_10_3D_vector_space_visualization_showing_clusters_of_s_0.jpg",{"type":100,"attrs":198,"content":200},{"id":199,"level":103},"h_i9imszei",[201],{"text":202,"type":77},"Hands-On: How the Code Works",{"type":71,"attrs":204,"content":206},{"id":205},"p_dw1c5dr7",[207,209,214],{"text":208,"type":77},"The theory is easy. Where most people get stuck is the implementation. We'll use Python and the ",{"text":210,"type":77,"marks":211},"sentence-transformers",[212],{"type":213},"code",{"text":215,"type":77}," library (industry standard).",{"type":71,"attrs":217,"content":219},{"id":218},"p_2etnafs8",[220],{"text":221,"type":77},"Imagine you have a support system. The user asks something, and you need to find the right answer in the manual.",{"type":71,"attrs":223,"content":225},{"id":224},"p_idtw8hbj",[226],{"text":227,"type":77},"Here's the code:",{"type":229,"attrs":230,"content":234},"codeBlock",{"id":231,"language":232,"highlighted":233},"code_0597awiw","python","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">from\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> sentence_transformers \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">import\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> SentenceTransformer, util\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6A737D;--shiki-dark:#6A737D\"># 1. Load a pre-trained model\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6A737D;--shiki-dark:#6A737D\"># 'all-MiniLM-L6-v2' is lightweight, fast, and good enough to start\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">model \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> SentenceTransformer(\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">'\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#005CC5;--shiki-dark:#79B8FF\">all\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">-\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">MiniLM\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">-\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">L6\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">-\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">v2\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">'\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6A737D;--shiki-dark:#6A737D\"># 2. Your \"database\" of documents (in production, this comes from a PDF or SQL)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">documentos \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> [\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">    \"\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">O aplicativo crasha ao iniciar após o update.\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">\"\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">    \"\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">Como resetar a senha do email.\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">\"\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">    \"\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">Problemas com conexão Wi\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">-\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">Fi no servidor.\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">\"\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">    \"\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">O app fecha sozinho quando tento abrir fotos.\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">]\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6A737D;--shiki-dark:#6A737D\"># 3. The user's question (which doesn't match the docs word-for-word)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">query \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\"> \"\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">Meu app não abre depois da atualização\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6A737D;--shiki-dark:#6A737D\"># 4. Generate embeddings (transform everything into numbers)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6A737D;--shiki-dark:#6A737D\"># This creates a \"matrix\" of numbers representing meaning\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">doc_embeddings \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> model.encode(documentos)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">query_embedding \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> model.encode(query)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6A737D;--shiki-dark:#6A737D\"># 5. Find which document is closest to the question\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6A737D;--shiki-dark:#6A737D\"># Cosine Similarity measures the \"angular distance\" between vectors\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6A737D;--shiki-dark:#6A737D\"># Result close to 1.0 = very similar. Close to 0 = nothing to do with it.\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">resultados \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> util.cos_sim(query_embedding, doc_embeddings)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6A737D;--shiki-dark:#6A737D\"># Get the index of the highest value (the most relevant document)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">melhor_indice \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> resultados.argmax()\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#005CC5;--shiki-dark:#79B8FF\">print\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">(\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">f\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">\"\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">Pergunta: {query}\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">\"\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#005CC5;--shiki-dark:#79B8FF\">print\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">(\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">f\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">\"\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">Resposta encontrada: {documentos[melhor_indice]}\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">\"\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6A737D;--shiki-dark:#6A737D\"># Output: \"O aplicativo crasha ao iniciar após o update.\"\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",[235],{"text":236,"type":77},"from sentence_transformers import SentenceTransformer, util\n\n# 1. Load a pre-trained model\n# 'all-MiniLM-L6-v2' is lightweight, fast, and good enough to start\nmodel = SentenceTransformer('all-MiniLM-L6-v2')\n\n# 2. Your \"database\" of documents (in production, this comes from a PDF or SQL)\ndocumentos = [\n    \"O aplicativo crasha ao iniciar após o update.\",\n    \"Como resetar a senha do email.\",\n    \"Problemas com conexão Wi-Fi no servidor.\",\n    \"O app fecha sozinho quando tento abrir fotos.\"\n]\n\n# 3. The user's question (which doesn't match the docs word-for-word)\nquery = \"Meu app não abre depois da atualização\"\n\n# 4. Generate embeddings (transform everything into numbers)\n# This creates a \"matrix\" of numbers representing meaning\ndoc_embeddings = model.encode(documentos)\nquery_embedding = model.encode(query)\n\n# 5. Find which document is closest to the question\n# Cosine Similarity measures the \"angular distance\" between vectors\n# Result close to 1.0 = very similar. Close to 0 = nothing to do with it.\nresultados = util.cos_sim(query_embedding, doc_embeddings)\n\n# Get the index of the highest value (the most relevant document)\nmelhor_indice = resultados.argmax()\n\nprint(f\"Pergunta: {query}\")\nprint(f\"Resposta encontrada: {documentos[melhor_indice]}\")\n# Output: \"O aplicativo crasha ao iniciar após o update.\"",{"type":71,"attrs":238,"content":240},{"id":239},"p_3buxyo4i",[241,246,248,252],{"text":242,"type":77,"marks":243},"The key insight:",[244],{"type":245},"bold",{"text":247,"type":77}," The code ",{"text":249,"type":77,"marks":250},"never",[251],{"type":245},{"text":253,"type":77}," searched for the word \"update.\" The document has \"update,\" the question has \"atualização.\"",{"type":71,"attrs":255,"content":257},{"id":256},"p_www9l0lh",[258],{"text":259,"type":77},"Since the model was trained on billions of texts, it knows that \"update\" and \"atualização\" appear in similar contexts. It generates nearby vectors. The math does the rest.",{"type":71,"attrs":261,"content":263},{"id":262},"p_gpai7u5u",[264],{"text":265,"type":77},"This solves the synonym problem, spelling errors (\"atualizaco\"), and paraphrasing automatically.",{"type":98},{"type":100,"attrs":268,"content":270},{"id":269,"level":103},"h_c9h5n4ws",[271],{"text":272,"type":77},"Why This is Essential for RAG",{"type":71,"attrs":274,"content":276},{"id":275},"p_nf9v5fer",[277],{"text":278,"type":77},"RAG (Retrieval-Augmented Generation) is the gold standard today for creating AIs that know about your private data (internal PDFs, contracts, SQL).",{"type":71,"attrs":280,"content":282},{"id":281},"p_fle12fme",[283],{"text":284,"type":77},"The RAG flow depends 100% on embeddings:",{"type":286,"attrs":287,"content":290},"orderedList",{"id":288,"type":9,"start":289,"tight":123},"ol_jqrt5529",1,[291,311,325,339,353],{"type":126,"attrs":292,"content":294},{"id":293},"li_hs0m6lgi",[295],{"type":71,"attrs":296,"content":298},{"id":297},"p_dtgvjf3c",[299,303,305,309],{"text":300,"type":77,"marks":301},"Indexing:",[302],{"type":245},{"text":304,"type":77}," You break your PDFs into chunks and generate embeddings for each chunk. Save this in a vector database (like Pinecone, Milvus, or ",{"text":306,"type":77,"marks":307},"pgvector",[308],{"type":213},{"text":310,"type":77}," in Postgres).",{"type":126,"attrs":312,"content":314},{"id":313},"li_wvdr6qhv",[315],{"type":71,"attrs":316,"content":318},{"id":317},"p_dqv4x209",[319,323],{"text":320,"type":77,"marks":321},"Query:",[322],{"type":245},{"text":324,"type":77}," The user asks something. You generate the embedding of the question.",{"type":126,"attrs":326,"content":328},{"id":327},"li_36zbo1ph",[329],{"type":71,"attrs":330,"content":332},{"id":331},"p_10tfr8ei",[333,337],{"text":334,"type":77,"marks":335},"Search:",[336],{"type":245},{"text":338,"type":77}," You ask the database: \"Which document embeddings are close to this question's embedding?\"",{"type":126,"attrs":340,"content":342},{"id":341},"li_g5obb9f3",[343],{"type":71,"attrs":344,"content":346},{"id":345},"p_x24j0jo8",[347,351],{"text":348,"type":77,"marks":349},"Context:",[350],{"type":245},{"text":352,"type":77}," The database returns the most relevant text chunks.",{"type":126,"attrs":354,"content":356},{"id":355},"li_m7k6y9vx",[357],{"type":71,"attrs":358,"content":360},{"id":359},"p_t4swzrv9",[361,365],{"text":362,"type":77,"marks":363},"Answer:",[364],{"type":245},{"text":366,"type":77}," You send these chunks to the LLM (GPT-4, Llama 3) and ask: \"Answer using ONLY this context.\"",{"type":71,"attrs":368,"content":370},{"id":369},"p_akvcr72m",[371],{"text":372,"type":77},"Without embeddings, the system would have to send the entire document (500 pages) to the LLM. That's slow, expensive (lots of tokens), and usually blows up the context limit. With embeddings, you only send 3 relevant paragraphs.",{"type":166,"attrs":374},{"id":375,"alt":376,"src":377,"size":171,"align":172,"title":9,"width":9,"height":9},"img_m6j9o88h","Diagram showing the RAG workflow: documents are chunked and embedded, stored in vector database, user query is embedded, similar chunks are retrieved and sent to LLM for answer generation","https:\u002F\u002Fmfgiomkkbihnlpfdxwrt.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fblog-assets\u002Fmedia\u002F1772074711674-yu7gwp.png",{"type":98},{"type":100,"attrs":380,"content":382},{"id":381,"level":103},"h_4ivkbkky",[383],{"text":384,"type":77},"The Classic Mistake: Swapping Models",{"type":71,"attrs":386,"content":388},{"id":387},"p_4uxik9y0",[389],{"text":390,"type":77},"I've seen this break an entire team's production.",{"type":71,"attrs":392,"content":394},{"id":393},"p_7eevxx4t",[395],{"text":396,"type":77},"Dev creates the system with embedding model X, indexes 1 million documents. A month later, switches to model Y because \"they saw on Hacker News that it's 1% more accurate.\"",{"type":71,"attrs":398,"content":400},{"id":399},"p_wjqx0819",[401],{"text":402,"type":77,"marks":403},"Result: Everything breaks.",[404],{"type":245},{"type":71,"attrs":406,"content":408},{"id":407},"p_y73li4e5",[409,411,412],{"text":410,"type":77},"Why?",{"type":156},{"text":413,"type":77},"Each model creates its own \"map\" (vector space). The coordinates change.",{"type":120,"attrs":415,"content":417},{"id":416,"tight":123},"ul_xra84tet",[418,434],{"type":126,"attrs":419,"content":421},{"id":420},"li_72pn8hxq",[422],{"type":71,"attrs":423,"content":425},{"id":424},"p_gwq0zd1l",[426,428,432],{"text":427,"type":77},"Model X puts \"Dog\" at coordinate ",{"text":429,"type":77,"marks":430},"(10, 10)",[431],{"type":213},{"text":433,"type":77},".",{"type":126,"attrs":435,"content":437},{"id":436},"li_ezbav58s",[438],{"type":71,"attrs":439,"content":441},{"id":440},"p_y00rztib",[442,444,448],{"text":443,"type":77},"Model Y puts \"Dog\" at coordinate ",{"text":445,"type":77,"marks":446},"(50, 50)",[447],{"type":213},{"text":433,"type":77},{"type":71,"attrs":450,"content":452},{"id":451},"p_ktvw0vaw",[453],{"text":454,"type":77},"If you swap models, the old embeddings saved in the database become useless. They point to places that don't exist in the new map.",{"type":71,"attrs":456,"content":458},{"id":457},"p_7y8su8j1",[459,463,465,469],{"text":460,"type":77,"marks":461},"The golden rule:",[462],{"type":245},{"text":464,"type":77}," If you swap the embedding model, ",{"text":466,"type":77,"marks":467},"you have to re-index everything",[468],{"type":245},{"text":470,"type":77},". No exceptions.",{"type":98},{"type":100,"attrs":473,"content":475},{"id":474,"level":103},"h_o6xf620o",[476],{"text":477,"type":77},"When to Use (and When Not To)",{"type":71,"attrs":479,"content":481},{"id":480},"p_qlzj168x",[482],{"text":483,"type":77},"Embeddings aren't a silver bullet. Use them wisely:",{"type":71,"attrs":485,"content":487},{"id":486},"p_4knsy5sa",[488],{"text":489,"type":77,"marks":490},"✅ Use Embeddings when:",[491],{"type":245},{"type":120,"attrs":493,"content":495},{"id":494,"tight":123},"ul_68lzfmy6",[496,506,516,526],{"type":126,"attrs":497,"content":499},{"id":498},"li_oc11t30m",[500],{"type":71,"attrs":501,"content":503},{"id":502},"p_res84nob",[504],{"text":505,"type":77},"You need semantic search (the user doesn't know the exact term).",{"type":126,"attrs":507,"content":509},{"id":508},"li_9al02dmu",[510],{"type":71,"attrs":511,"content":513},{"id":512},"p_gevpu3qw",[514],{"text":515,"type":77},"Implementing RAG (AI with your data).",{"type":126,"attrs":517,"content":519},{"id":518},"li_y4w3xkjd",[520],{"type":71,"attrs":521,"content":523},{"id":522},"p_gjmpg7ff",[524],{"text":525,"type":77},"Recommendation systems (\"who liked X, also liked Y\" based on description).",{"type":126,"attrs":527,"content":529},{"id":528},"li_vjk3agtj",[530],{"type":71,"attrs":531,"content":533},{"id":532},"p_rw0tmwal",[534],{"text":535,"type":77},"Text classification (e.g., labeling support tickets).",{"type":71,"attrs":537,"content":539},{"id":538},"p_85n1t81t",[540],{"text":541,"type":77,"marks":542},"❌ DON'T use Embeddings when:",[543],{"type":245},{"type":120,"attrs":545,"content":547},{"id":546,"tight":123},"ul_iup3vnvw",[548,558,568],{"type":126,"attrs":549,"content":551},{"id":550},"li_p53yvews",[552],{"type":71,"attrs":553,"content":555},{"id":554},"p_wcm4ll7g",[556],{"text":557,"type":77},"You need exact match (e.g., searching by CPF, ID, or SKU).",{"type":126,"attrs":559,"content":561},{"id":560},"li_3wldozj6",[562],{"type":71,"attrs":563,"content":565},{"id":564},"p_8h9qdkmq",[566],{"text":567,"type":77},"You're dealing with perfectly structured data (pure SQL is faster).",{"type":126,"attrs":569,"content":571},{"id":570},"li_8ys0d3pz",[572],{"type":71,"attrs":573,"content":575},{"id":574},"p_dt6j1059",[576],{"text":577,"type":77},"The user always knows exactly the technical term (e.g., specific API command).",{"type":98},{"type":100,"attrs":580,"content":582},{"id":581,"level":103},"h_224puw16",[583],{"text":584,"type":77},"Next Step",{"type":71,"attrs":586,"content":588},{"id":587},"p_xobjcdvi",[589],{"text":590,"type":77},"Stop reading theory.",{"type":71,"attrs":592,"content":594},{"id":593},"p_kp2w28cg",[595,597,601,603,607],{"text":596,"type":77},"Open your terminal, install the lib (",{"text":598,"type":77,"marks":599},"pip install sentence-transformers",[600],{"type":213},{"text":602,"type":77},") and run the code above. Change the ",{"text":604,"type":77,"marks":605},"query",[606],{"type":213},{"text":608,"type":77}," string to something that makes sense in your context and watch the magic happen.",{"type":71,"attrs":610,"content":612},{"id":611},"p_n0uzo47y",[613,615,618,620,624],{"text":614,"type":77},"After that, look at ",{"text":306,"type":77,"marks":616},[617],{"type":213},{"text":619,"type":77}," or ",{"text":621,"type":77,"marks":622},"ChromaDB",[623],{"type":213},{"text":625,"type":77}," to store these vectors. It's the gateway to making your own intelligent chatbot.",{"type":166,"attrs":627},{"id":628,"alt":629,"src":630,"size":171,"align":172,"title":629,"width":9,"height":9},"img_s2ylstgp","Side-by-side comparison showing two different vector spaces. Left side shows Model X coordinate system with word 'Dog' at position (10,10). Right side shows Model Y coordinate system with same word 'Dog' at position (50,50). Dotted lines connect corresponding words between the two spaces to illustrate incompatibility. Red X marks crossing out old embeddings becoming useless after model swap. Simple technical illustration style with clear labels.","https:\u002F\u002Fcdn.leonardo.ai\u002Fusers\u002F88cebc39-26ed-4801-a7c7-03a601670251\u002Fgenerations\u002Fdb13779b-2341-4440-a6ed-fbd972108f0b\u002FPhoenix_10_Sidebyside_comparison_showing_two_different_vector_0.jpg",{"type":632,"attrs":633},"newsletterBlock",{"id":634},"nl_fp26ubu8",{"type":71,"attrs":636},{"id":637},"p_t0snw0ah","Embeddings Explained: The Secret to Making AI Understand Your Data","Discover how embeddings transform text into numbers for semantic search and RAG. Learn to implement with Python and avoid common mistakes when building your AI with data.","2026-08-24T14:53:53.315534+00:00",[642,666,682,696],{"id":643,"slug":644,"title":645,"excerpt":646,"image":647,"featured":44,"groupId":648,"publishedAt":649,"readingTime":650,"views":651,"author":652,"category":653,"tags":654},"10ee04ce-fa53-44d7-9603-2e375733d313","the-rise-of-shadow-deployment-and-the-dna-behind-the-hidden-ox-alpha-model","The Rise of Shadow Deployment and the DNA Behind the Hidden Ox Alpha Model","The ghost launch of Ox Alpha revealed a new era in software engineering, where strategic anonymity redefines the future of AI models.","https:\u002F\u002Fmfgiomkkbihnlpfdxwrt.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fblog-assets\u002Fmedia\u002Ffeatured\u002F1787604179257-featured-byxw99.webp","ba241d77-9b03-4c87-8e52-ba727a888e59","2026-08-24T22:56:11.386568+00:00",7,0,{"name":50,"avatar":9},{"slug":19,"name":20,"color":21},[655,658,659,662,663],{"slug":656,"name":657},"china","China",{"slug":57,"name":58},{"slug":660,"name":661},"infraestrutura","Infraestrutura",{"slug":60,"name":61},{"slug":664,"name":665},"performance","Performance",{"id":667,"slug":668,"title":669,"excerpt":670,"image":671,"featured":44,"groupId":672,"publishedAt":673,"readingTime":29,"views":651,"author":674,"category":675,"tags":676},"99d8b7bf-03aa-4c01-8bc7-ef1aca804b30","conversational-ai-exhausted-how-to-migrate-to-agentic-workflows-and-execute-real-actions","Conversational AI Exhausted? How to Migrate to Agentic Workflows and Execute Real Actions","The chat paradigm is exhausted. Discover agentic workflows: systems that plan, execute, and verify tasks autonomously and in a testable manner.","https:\u002F\u002Fmfgiomkkbihnlpfdxwrt.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fblog-assets\u002Fmedia\u002Ffeatured\u002F1773194326109-featured-g0e36z.jpeg","2438fae0-5c5e-41ce-9543-89007a6888cc","2026-07-08T23:42:19.403576+00:00",{"name":50,"avatar":9},{"slug":19,"name":20,"color":21},[677,678,679],{"slug":60,"name":61},{"slug":57,"name":58},{"slug":680,"name":681},"openclaw","OpenClaw",{"id":683,"slug":684,"title":685,"excerpt":686,"image":687,"featured":44,"groupId":688,"publishedAt":689,"readingTime":690,"views":651,"author":691,"category":692,"tags":693},"011ee3e7-61c8-4877-a99b-edc119022f4d","glm-52-vs-kimi-k27-why-glm-wins-the-code-reliability-test","GLM-5.2 vs. Kimi K2.7: Why GLM Wins the Code Reliability Test","Five independent evaluators tested GLM-5.2 and Kimi K2.7 on coding tasks. Discover which model wins the battle for reliability and development speed.","https:\u002F\u002Fmfgiomkkbihnlpfdxwrt.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fblog-assets\u002Fmedia\u002Ffeatured\u002F1782256309298-featured-ubiuao.webp","8707b037-1af8-46ff-972a-99c4ead20adc","2026-07-08T22:58:35.7148+00:00",5,{"name":50,"avatar":9},{"slug":19,"name":20,"color":21},[694,695],{"slug":60,"name":61},{"slug":664,"name":665},{"id":697,"slug":698,"title":699,"excerpt":700,"image":701,"featured":44,"groupId":702,"publishedAt":703,"readingTime":47,"views":651,"author":704,"category":705,"tags":706},"e595e2c6-e464-46d7-ba67-810f8d0cd234","how-to-choose-an-ai-sdk-why-the-fear-of-lock-in-is-a-mistake-and-how-to-decide-based-on-your-apps-format","How to choose an AI SDK: why the fear of lock-in is a mistake and how to decide based on your app's format","The fear of being locked into an AI provider is a common mistake. Learn how to choose the best SDK based on your project's format and productivity.","https:\u002F\u002Fmfgiomkkbihnlpfdxwrt.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fblog-assets\u002Fmedia\u002Ffeatured\u002F1782794440171-featured-aqj363.webp","7839c171-0b65-418a-87dc-7ded7786a84a","2026-07-04T19:26:16.054373+00:00",{"name":50,"avatar":9},{"slug":19,"name":20,"color":21},[707,708],{"slug":60,"name":61},{"slug":57,"name":58},{"en":40,"pt":710},"embeddings-explicados-o-segredo-para-ia-entender-seus-dados-e-nao-alucinar"]