[{"data":1,"prerenderedAt":1879},["ShallowReactive",2],{"article-alternates":3,"article-\u002Ftr\u002Fai\u002Fembedding-drift-uretimde-vector-dbleri-nasil-surdururuz":13},{"i18nKey":4,"paths":5},"ai-006-2026-05",{"de":6,"en":7,"es":8,"fr":9,"it":10,"ru":11,"tr":12},"\u002Fde\u002Fai\u002Fembedding-drift-vector-db-produktion","\u002Fen\u002Fai\u002Fembedding-drift-production-vector-databases","\u002Fes\u002Fai\u002Fgestion-deriva-embeddings-bases-datos-vectoriales-produccion","\u002Ffr\u002Fai\u002Fembedding-drift-gestion-base-donnees-vecteurs-production","\u002Fit\u002Fai\u002Fgestione-drift-embedding-database-vettoriali-produzione","\u002Fru\u002Fai\u002Fembedding-drift-vector-db-production","\u002Ftr\u002Fai\u002Fembedding-drift-uretimde-vector-dbleri-nasil-surdururuz",{"_path":12,"_dir":14,"_draft":15,"_partial":15,"_locale":16,"title":17,"description":18,"publishedAt":19,"modifiedAt":19,"category":14,"i18nKey":4,"tags":20,"readingTime":26,"author":27,"body":28,"_type":1873,"_id":1874,"_source":1875,"_file":1876,"_stem":1877,"_extension":1878},"ai",false,"","Embedding Drift: Üretimde Vector DB'leri Nasıl Sürdürürüz","Model değişiminde embedding uyumsuzluğu, re-indexing maliyeti ve incremental migration stratejileri — production vector database sürdürülebilirliği","2026-05-18",[21,22,23,24,25],"vector-database","embedding-drift","mlops","retrieval-augmented-generation","model-migration",8,"Roibase",{"type":29,"children":30,"toc":1859},"root",[31,56,63,68,73,78,85,97,102,108,113,118,123,371,376,792,808,814,819,906,911,916,922,927,932,1014,1019,1025,1030,1040,1050,1374,1380,1400,1405,1410,1416,1421,1426,1431,1460,1474,1480,1492,1497,1843,1848,1853],{"type":32,"tag":33,"props":34,"children":35},"element","p",{},[36,39,46,48,54],{"type":37,"value":38},"text","Production'da RAG sistemleri kurduğunuzda ilk ay her şey çalışır. Üçüncü ayda OpenAI ",{"type":32,"tag":40,"props":41,"children":43},"code",{"className":42},[],[44],{"type":37,"value":45},"text-embedding-3-large",{"type":37,"value":47}," yerine ",{"type":32,"tag":40,"props":49,"children":51},{"className":50},[],[52],{"type":37,"value":53},"text-embedding-4",{"type":37,"value":55}," yayınlar, siz de \"yeni model daha iyi\" diye test edersiniz. Test sonuçları %4 daha yüksek recall gösterir. Ama 12 milyon dokümanınız hâlâ eski embedding modeline göre index'li. Yeniden index'lemeye 18 saat, 6.400 dolar API maliyeti gerekiyor. Bu noktada embedding drift başlar — model güncellersiniz ama vector store eskide kalır, sorgu embedding'i ile stored embedding'ler farklı manifold'lara oturur, retrieval accuracy sessizce düşer. Bu yazı, model migration'ı hangi maliyet-kalite dengesinde yapacağınızı, incremental re-indexing'i nasıl tasarlayacağınızı ve drift'i üretimde nasıl ölçeceğinizi açıklıyor.",{"type":32,"tag":57,"props":58,"children":60},"h2",{"id":59},"embedding-drift-nedir-ve-neden-önemli",[61],{"type":37,"value":62},"Embedding Drift Nedir ve Neden Önemli",{"type":32,"tag":33,"props":64,"children":65},{},[66],{"type":37,"value":67},"Embedding drift, sorgu embedding modelinin document embedding modelinden farklı olması durumudur. Eğer indexleme sırasında model A ile embedding üretip, sorgu sırasında model B kullanırsanız — cosine similarity anlamlı olmaktan çıkar. İki model farklı vektör uzayında çalıştığı için \"benzerlik\" skoru yanıltıcı hale gelir.",{"type":32,"tag":33,"props":69,"children":70},{},[71],{"type":37,"value":72},"Bu durum özellikle üç senaryoda görülür: (1) embedding model provider yeni versiyon yayınlar (OpenAI ada-002 → text-embedding-3-small geçişi %12 boyut azalması getirdi ama binary compatibility yoktu), (2) fine-tuned model'e geçiş (domain-specific veri ile eğitilmiş model genelden daha iyi çalışır ama tüm corpus yeniden embed edilmeli), (3) multilingual model değişimi (sentence-transformers\u002Fparaphrase-multilingual-mpnet-base-v2 yerine intfloat\u002Fmultilingual-e5-large kullanmak retrieval@10'u %8 artırır ama 1:1 mapping yok).",{"type":32,"tag":33,"props":74,"children":75},{},[76],{"type":37,"value":77},"Production'da drift'i fark etmek zordur çünkü metrikler yavaşça kayar. İlk haftada kullanıcılar \"biraz kötü sonuç geldi\" der, ikinci haftada support ticket'ları %15 artar, üçüncü haftada retention düşer. Drift'in early signal'ı şudur: yeni sorguların ortalama similarity skoru indexleme zamanındaki baseline'a göre düşer. Eğer indexleme sırasında mean cosine similarity 0.78 idiyse, sorgu zamanında 0.71'e düşmesi — model uyumsuzluğunun göstergesidir.",{"type":32,"tag":79,"props":80,"children":82},"h3",{"id":81},"maliyet-tradeoff-re-index-vs-dual-model",[83],{"type":37,"value":84},"Maliyet Tradeoff: Re-index vs Dual Model",{"type":32,"tag":33,"props":86,"children":87},{},[88,90,95],{"type":37,"value":89},"Re-indexing maliyetini üç bileşende düşünün: (1) API call maliyeti (OpenAI ",{"type":32,"tag":40,"props":91,"children":93},{"className":92},[],[94],{"type":37,"value":45},{"type":37,"value":96}," 1M token = 0.13 dolar, Cohere embed-v3 0.10 dolar), (2) compute time (12M doküman × 512 token ortalama = 6.1B token ≈ 18 saat paralel batch processing), (3) downtime riski (atomic switchover yapmazsanız kullanıcı sorguları yarım index'e düşer).",{"type":32,"tag":33,"props":98,"children":99},{},[100],{"type":37,"value":101},"Alternatif: dual model stratejisi — yeni model için ayrı index oluşturup A\u002FB test ile geçiş. Bu durumda storage cost 2×, ama risk sıfır. Yeni index ready olduğunda traffic'i %10 → %50 → %100 shift edersiniz. Eğer regression görürseniz rollback anında olur. Ancak bu strateji 2× vector storage maliyeti getirir (Pinecone'da p1.x1 pod 0.096 dolar\u002Fsaat, 12M 1536-dim vector = ~18GB ≈ 2 pod = 140 dolar\u002Fay, dual index = 280 dolar\u002Fay).",{"type":32,"tag":57,"props":103,"children":105},{"id":104},"incremental-re-indexing-hotcold-partitioning",[106],{"type":37,"value":107},"Incremental Re-indexing: Hot\u002FCold Partitioning",{"type":32,"tag":33,"props":109,"children":110},{},[111],{"type":37,"value":112},"Tüm corpus'u bir gecede re-index'lemek yerine, kullanım frekansına göre hot\u002Fcold partition yapın. Son 30 günde sorguya düşmüş dokümanlar \"hot\", geri kalanı \"cold\" olsun. Hot partition tipik olarak corpus'un %15-25'ini oluşturur ama sorgu hit'lerinin %80'ini karşılar.",{"type":32,"tag":33,"props":114,"children":115},{},[116],{"type":37,"value":117},"Strateji: önce hot partition'ı yeni modelle re-embed edin (18 saat yerine 3 saat, maliyet 6.400 → 1.200 dolar). Sorgu zamanında shard routing yapın — yeni sorgular önce hot index'e düşer, miss olursa cold index'e fallback. Bu şekilde %80 accuracy improvement'ı ilk günde, %100 improvement 2-3 haftalık rolling re-index ile gelir.",{"type":32,"tag":33,"props":119,"children":120},{},[121],{"type":37,"value":122},"Partition tracking için PostgreSQL'de basit bir tablo yeterli:",{"type":32,"tag":124,"props":125,"children":129},"pre",{"className":126,"code":127,"language":128,"meta":16,"style":16},"language-sql shiki shiki-themes github-dark","CREATE TABLE doc_partition (\n  doc_id UUID PRIMARY KEY,\n  partition TEXT CHECK (partition IN ('hot', 'cold')),\n  last_queried_at TIMESTAMPTZ,\n  embedding_model TEXT,\n  embedding_version TEXT,\n  re_indexed_at TIMESTAMPTZ\n);\n\nCREATE INDEX idx_partition_model \n  ON doc_partition(partition, embedding_model);\n","sql",[130],{"type":32,"tag":40,"props":131,"children":132},{"__ignoreMap":16},[133,162,181,240,258,276,293,307,315,325,348],{"type":32,"tag":134,"props":135,"children":138},"span",{"class":136,"line":137},"line",1,[139,145,150,156],{"type":32,"tag":134,"props":140,"children":142},{"style":141},"--shiki-default:#F97583",[143],{"type":37,"value":144},"CREATE",{"type":32,"tag":134,"props":146,"children":147},{"style":141},[148],{"type":37,"value":149}," TABLE",{"type":32,"tag":134,"props":151,"children":153},{"style":152},"--shiki-default:#B392F0",[154],{"type":37,"value":155}," doc_partition",{"type":32,"tag":134,"props":157,"children":159},{"style":158},"--shiki-default:#E1E4E8",[160],{"type":37,"value":161}," (\n",{"type":32,"tag":134,"props":163,"children":165},{"class":136,"line":164},2,[166,171,176],{"type":32,"tag":134,"props":167,"children":168},{"style":158},[169],{"type":37,"value":170},"  doc_id UUID ",{"type":32,"tag":134,"props":172,"children":173},{"style":141},[174],{"type":37,"value":175},"PRIMARY KEY",{"type":32,"tag":134,"props":177,"children":178},{"style":158},[179],{"type":37,"value":180},",\n",{"type":32,"tag":134,"props":182,"children":184},{"class":136,"line":183},3,[185,190,195,200,205,210,215,219,225,230,235],{"type":32,"tag":134,"props":186,"children":187},{"style":141},[188],{"type":37,"value":189},"  partition",{"type":32,"tag":134,"props":191,"children":192},{"style":141},[193],{"type":37,"value":194}," TEXT",{"type":32,"tag":134,"props":196,"children":197},{"style":141},[198],{"type":37,"value":199}," CHECK",{"type":32,"tag":134,"props":201,"children":202},{"style":158},[203],{"type":37,"value":204}," (",{"type":32,"tag":134,"props":206,"children":207},{"style":141},[208],{"type":37,"value":209},"partition",{"type":32,"tag":134,"props":211,"children":212},{"style":141},[213],{"type":37,"value":214}," IN",{"type":32,"tag":134,"props":216,"children":217},{"style":158},[218],{"type":37,"value":204},{"type":32,"tag":134,"props":220,"children":222},{"style":221},"--shiki-default:#9ECBFF",[223],{"type":37,"value":224},"'hot'",{"type":32,"tag":134,"props":226,"children":227},{"style":158},[228],{"type":37,"value":229},", ",{"type":32,"tag":134,"props":231,"children":232},{"style":221},[233],{"type":37,"value":234},"'cold'",{"type":32,"tag":134,"props":236,"children":237},{"style":158},[238],{"type":37,"value":239},")),\n",{"type":32,"tag":134,"props":241,"children":243},{"class":136,"line":242},4,[244,249,254],{"type":32,"tag":134,"props":245,"children":246},{"style":158},[247],{"type":37,"value":248},"  last_queried_at ",{"type":32,"tag":134,"props":250,"children":251},{"style":141},[252],{"type":37,"value":253},"TIMESTAMPTZ",{"type":32,"tag":134,"props":255,"children":256},{"style":158},[257],{"type":37,"value":180},{"type":32,"tag":134,"props":259,"children":261},{"class":136,"line":260},5,[262,267,272],{"type":32,"tag":134,"props":263,"children":264},{"style":158},[265],{"type":37,"value":266},"  embedding_model ",{"type":32,"tag":134,"props":268,"children":269},{"style":141},[270],{"type":37,"value":271},"TEXT",{"type":32,"tag":134,"props":273,"children":274},{"style":158},[275],{"type":37,"value":180},{"type":32,"tag":134,"props":277,"children":279},{"class":136,"line":278},6,[280,285,289],{"type":32,"tag":134,"props":281,"children":282},{"style":158},[283],{"type":37,"value":284},"  embedding_version ",{"type":32,"tag":134,"props":286,"children":287},{"style":141},[288],{"type":37,"value":271},{"type":32,"tag":134,"props":290,"children":291},{"style":158},[292],{"type":37,"value":180},{"type":32,"tag":134,"props":294,"children":296},{"class":136,"line":295},7,[297,302],{"type":32,"tag":134,"props":298,"children":299},{"style":158},[300],{"type":37,"value":301},"  re_indexed_at ",{"type":32,"tag":134,"props":303,"children":304},{"style":141},[305],{"type":37,"value":306},"TIMESTAMPTZ\n",{"type":32,"tag":134,"props":308,"children":309},{"class":136,"line":26},[310],{"type":32,"tag":134,"props":311,"children":312},{"style":158},[313],{"type":37,"value":314},");\n",{"type":32,"tag":134,"props":316,"children":318},{"class":136,"line":317},9,[319],{"type":32,"tag":134,"props":320,"children":322},{"emptyLinePlaceholder":321},true,[323],{"type":37,"value":324},"\n",{"type":32,"tag":134,"props":326,"children":328},{"class":136,"line":327},10,[329,333,338,343],{"type":32,"tag":134,"props":330,"children":331},{"style":141},[332],{"type":37,"value":144},{"type":32,"tag":134,"props":334,"children":335},{"style":141},[336],{"type":37,"value":337}," INDEX",{"type":32,"tag":134,"props":339,"children":340},{"style":152},[341],{"type":37,"value":342}," idx_partition_model",{"type":32,"tag":134,"props":344,"children":345},{"style":158},[346],{"type":37,"value":347}," \n",{"type":32,"tag":134,"props":349,"children":351},{"class":136,"line":350},11,[352,357,362,366],{"type":32,"tag":134,"props":353,"children":354},{"style":141},[355],{"type":37,"value":356},"  ON",{"type":32,"tag":134,"props":358,"children":359},{"style":158},[360],{"type":37,"value":361}," doc_partition(",{"type":32,"tag":134,"props":363,"children":364},{"style":141},[365],{"type":37,"value":209},{"type":32,"tag":134,"props":367,"children":368},{"style":158},[369],{"type":37,"value":370},", embedding_model);\n",{"type":32,"tag":33,"props":372,"children":373},{},[374],{"type":37,"value":375},"Query routing logic:",{"type":32,"tag":124,"props":377,"children":381},{"className":378,"code":379,"language":380,"meta":16,"style":16},"language-python shiki shiki-themes github-dark","def retrieve(query: str, model: str, k: int = 10):\n    query_emb = embed(query, model)\n    \n    # hot partition'dan ara\n    hot_results = vector_db.search(\n        collection=\"hot\",\n        vector=query_emb,\n        limit=k,\n        filter={\"embedding_model\": model}\n    )\n    \n    if len(hot_results) >= k:\n        return hot_results\n    \n    # eksik varsa cold'dan tamamla\n    cold_results = vector_db.search(\n        collection=\"cold\",\n        vector=query_emb,\n        limit=k - len(hot_results),\n        filter={\"embedding_model\": model}\n    )\n    \n    return merge_results(hot_results, cold_results)\n","python",[382],{"type":32,"tag":40,"props":383,"children":384},{"__ignoreMap":16},[385,443,461,469,478,495,517,534,551,578,586,593,622,636,644,653,670,691,707,738,762,770,778],{"type":32,"tag":134,"props":386,"children":387},{"class":136,"line":137},[388,393,398,403,409,414,418,423,428,433,438],{"type":32,"tag":134,"props":389,"children":390},{"style":141},[391],{"type":37,"value":392},"def",{"type":32,"tag":134,"props":394,"children":395},{"style":152},[396],{"type":37,"value":397}," retrieve",{"type":32,"tag":134,"props":399,"children":400},{"style":158},[401],{"type":37,"value":402},"(query: ",{"type":32,"tag":134,"props":404,"children":406},{"style":405},"--shiki-default:#79B8FF",[407],{"type":37,"value":408},"str",{"type":32,"tag":134,"props":410,"children":411},{"style":158},[412],{"type":37,"value":413},", model: ",{"type":32,"tag":134,"props":415,"children":416},{"style":405},[417],{"type":37,"value":408},{"type":32,"tag":134,"props":419,"children":420},{"style":158},[421],{"type":37,"value":422},", k: ",{"type":32,"tag":134,"props":424,"children":425},{"style":405},[426],{"type":37,"value":427},"int",{"type":32,"tag":134,"props":429,"children":430},{"style":141},[431],{"type":37,"value":432}," =",{"type":32,"tag":134,"props":434,"children":435},{"style":405},[436],{"type":37,"value":437}," 10",{"type":32,"tag":134,"props":439,"children":440},{"style":158},[441],{"type":37,"value":442},"):\n",{"type":32,"tag":134,"props":444,"children":445},{"class":136,"line":164},[446,451,456],{"type":32,"tag":134,"props":447,"children":448},{"style":158},[449],{"type":37,"value":450},"    query_emb ",{"type":32,"tag":134,"props":452,"children":453},{"style":141},[454],{"type":37,"value":455},"=",{"type":32,"tag":134,"props":457,"children":458},{"style":158},[459],{"type":37,"value":460}," embed(query, model)\n",{"type":32,"tag":134,"props":462,"children":463},{"class":136,"line":183},[464],{"type":32,"tag":134,"props":465,"children":466},{"style":158},[467],{"type":37,"value":468},"    \n",{"type":32,"tag":134,"props":470,"children":471},{"class":136,"line":242},[472],{"type":32,"tag":134,"props":473,"children":475},{"style":474},"--shiki-default:#6A737D",[476],{"type":37,"value":477},"    # hot partition'dan ara\n",{"type":32,"tag":134,"props":479,"children":480},{"class":136,"line":260},[481,486,490],{"type":32,"tag":134,"props":482,"children":483},{"style":158},[484],{"type":37,"value":485},"    hot_results ",{"type":32,"tag":134,"props":487,"children":488},{"style":141},[489],{"type":37,"value":455},{"type":32,"tag":134,"props":491,"children":492},{"style":158},[493],{"type":37,"value":494}," vector_db.search(\n",{"type":32,"tag":134,"props":496,"children":497},{"class":136,"line":278},[498,504,508,513],{"type":32,"tag":134,"props":499,"children":501},{"style":500},"--shiki-default:#FFAB70",[502],{"type":37,"value":503},"        collection",{"type":32,"tag":134,"props":505,"children":506},{"style":141},[507],{"type":37,"value":455},{"type":32,"tag":134,"props":509,"children":510},{"style":221},[511],{"type":37,"value":512},"\"hot\"",{"type":32,"tag":134,"props":514,"children":515},{"style":158},[516],{"type":37,"value":180},{"type":32,"tag":134,"props":518,"children":519},{"class":136,"line":295},[520,525,529],{"type":32,"tag":134,"props":521,"children":522},{"style":500},[523],{"type":37,"value":524},"        vector",{"type":32,"tag":134,"props":526,"children":527},{"style":141},[528],{"type":37,"value":455},{"type":32,"tag":134,"props":530,"children":531},{"style":158},[532],{"type":37,"value":533},"query_emb,\n",{"type":32,"tag":134,"props":535,"children":536},{"class":136,"line":26},[537,542,546],{"type":32,"tag":134,"props":538,"children":539},{"style":500},[540],{"type":37,"value":541},"        limit",{"type":32,"tag":134,"props":543,"children":544},{"style":141},[545],{"type":37,"value":455},{"type":32,"tag":134,"props":547,"children":548},{"style":158},[549],{"type":37,"value":550},"k,\n",{"type":32,"tag":134,"props":552,"children":553},{"class":136,"line":317},[554,559,563,568,573],{"type":32,"tag":134,"props":555,"children":556},{"style":500},[557],{"type":37,"value":558},"        filter",{"type":32,"tag":134,"props":560,"children":561},{"style":141},[562],{"type":37,"value":455},{"type":32,"tag":134,"props":564,"children":565},{"style":158},[566],{"type":37,"value":567},"{",{"type":32,"tag":134,"props":569,"children":570},{"style":221},[571],{"type":37,"value":572},"\"embedding_model\"",{"type":32,"tag":134,"props":574,"children":575},{"style":158},[576],{"type":37,"value":577},": model}\n",{"type":32,"tag":134,"props":579,"children":580},{"class":136,"line":327},[581],{"type":32,"tag":134,"props":582,"children":583},{"style":158},[584],{"type":37,"value":585},"    )\n",{"type":32,"tag":134,"props":587,"children":588},{"class":136,"line":350},[589],{"type":32,"tag":134,"props":590,"children":591},{"style":158},[592],{"type":37,"value":468},{"type":32,"tag":134,"props":594,"children":596},{"class":136,"line":595},12,[597,602,607,612,617],{"type":32,"tag":134,"props":598,"children":599},{"style":141},[600],{"type":37,"value":601},"    if",{"type":32,"tag":134,"props":603,"children":604},{"style":405},[605],{"type":37,"value":606}," len",{"type":32,"tag":134,"props":608,"children":609},{"style":158},[610],{"type":37,"value":611},"(hot_results) ",{"type":32,"tag":134,"props":613,"children":614},{"style":141},[615],{"type":37,"value":616},">=",{"type":32,"tag":134,"props":618,"children":619},{"style":158},[620],{"type":37,"value":621}," k:\n",{"type":32,"tag":134,"props":623,"children":625},{"class":136,"line":624},13,[626,631],{"type":32,"tag":134,"props":627,"children":628},{"style":141},[629],{"type":37,"value":630},"        return",{"type":32,"tag":134,"props":632,"children":633},{"style":158},[634],{"type":37,"value":635}," hot_results\n",{"type":32,"tag":134,"props":637,"children":639},{"class":136,"line":638},14,[640],{"type":32,"tag":134,"props":641,"children":642},{"style":158},[643],{"type":37,"value":468},{"type":32,"tag":134,"props":645,"children":647},{"class":136,"line":646},15,[648],{"type":32,"tag":134,"props":649,"children":650},{"style":474},[651],{"type":37,"value":652},"    # eksik varsa cold'dan tamamla\n",{"type":32,"tag":134,"props":654,"children":656},{"class":136,"line":655},16,[657,662,666],{"type":32,"tag":134,"props":658,"children":659},{"style":158},[660],{"type":37,"value":661},"    cold_results ",{"type":32,"tag":134,"props":663,"children":664},{"style":141},[665],{"type":37,"value":455},{"type":32,"tag":134,"props":667,"children":668},{"style":158},[669],{"type":37,"value":494},{"type":32,"tag":134,"props":671,"children":673},{"class":136,"line":672},17,[674,678,682,687],{"type":32,"tag":134,"props":675,"children":676},{"style":500},[677],{"type":37,"value":503},{"type":32,"tag":134,"props":679,"children":680},{"style":141},[681],{"type":37,"value":455},{"type":32,"tag":134,"props":683,"children":684},{"style":221},[685],{"type":37,"value":686},"\"cold\"",{"type":32,"tag":134,"props":688,"children":689},{"style":158},[690],{"type":37,"value":180},{"type":32,"tag":134,"props":692,"children":694},{"class":136,"line":693},18,[695,699,703],{"type":32,"tag":134,"props":696,"children":697},{"style":500},[698],{"type":37,"value":524},{"type":32,"tag":134,"props":700,"children":701},{"style":141},[702],{"type":37,"value":455},{"type":32,"tag":134,"props":704,"children":705},{"style":158},[706],{"type":37,"value":533},{"type":32,"tag":134,"props":708,"children":710},{"class":136,"line":709},19,[711,715,719,724,729,733],{"type":32,"tag":134,"props":712,"children":713},{"style":500},[714],{"type":37,"value":541},{"type":32,"tag":134,"props":716,"children":717},{"style":141},[718],{"type":37,"value":455},{"type":32,"tag":134,"props":720,"children":721},{"style":158},[722],{"type":37,"value":723},"k ",{"type":32,"tag":134,"props":725,"children":726},{"style":141},[727],{"type":37,"value":728},"-",{"type":32,"tag":134,"props":730,"children":731},{"style":405},[732],{"type":37,"value":606},{"type":32,"tag":134,"props":734,"children":735},{"style":158},[736],{"type":37,"value":737},"(hot_results),\n",{"type":32,"tag":134,"props":739,"children":741},{"class":136,"line":740},20,[742,746,750,754,758],{"type":32,"tag":134,"props":743,"children":744},{"style":500},[745],{"type":37,"value":558},{"type":32,"tag":134,"props":747,"children":748},{"style":141},[749],{"type":37,"value":455},{"type":32,"tag":134,"props":751,"children":752},{"style":158},[753],{"type":37,"value":567},{"type":32,"tag":134,"props":755,"children":756},{"style":221},[757],{"type":37,"value":572},{"type":32,"tag":134,"props":759,"children":760},{"style":158},[761],{"type":37,"value":577},{"type":32,"tag":134,"props":763,"children":765},{"class":136,"line":764},21,[766],{"type":32,"tag":134,"props":767,"children":768},{"style":158},[769],{"type":37,"value":585},{"type":32,"tag":134,"props":771,"children":773},{"class":136,"line":772},22,[774],{"type":32,"tag":134,"props":775,"children":776},{"style":158},[777],{"type":37,"value":468},{"type":32,"tag":134,"props":779,"children":781},{"class":136,"line":780},23,[782,787],{"type":32,"tag":134,"props":783,"children":784},{"style":141},[785],{"type":37,"value":786},"    return",{"type":32,"tag":134,"props":788,"children":789},{"style":158},[790],{"type":37,"value":791}," merge_results(hot_results, cold_results)\n",{"type":32,"tag":33,"props":793,"children":794},{},[795,797,806],{"type":37,"value":796},"Bu yaklaşım Roibase'in ",{"type":32,"tag":798,"props":799,"children":803},"a",{"href":800,"rel":801},"https:\u002F\u002Fwww.roibase.com.tr\u002Ftr\u002Ffirstparty",[802],"nofollow",[804],{"type":37,"value":805},"first-party veri mimarisi",{"type":37,"value":807}," çalışmalarında kullanılan \"event-driven incremental sync\" mantığına benzer — tüm veriyi tek seferde kopyalamak yerine değişen subset'i sürekli sync ederiz.",{"type":32,"tag":79,"props":809,"children":811},{"id":810},"drift-detection-embedding-space-monitoring",[812],{"type":37,"value":813},"Drift Detection: Embedding Space Monitoring",{"type":32,"tag":33,"props":815,"children":816},{},[817],{"type":37,"value":818},"Drift'i üretimde ölçmek için üç metrik kullanın:",{"type":32,"tag":820,"props":821,"children":822},"table",{},[823,847],{"type":32,"tag":824,"props":825,"children":826},"thead",{},[827],{"type":32,"tag":828,"props":829,"children":830},"tr",{},[831,837,842],{"type":32,"tag":832,"props":833,"children":834},"th",{},[835],{"type":37,"value":836},"Metrik",{"type":32,"tag":832,"props":838,"children":839},{},[840],{"type":37,"value":841},"Threshold",{"type":32,"tag":832,"props":843,"children":844},{},[845],{"type":37,"value":846},"Anlamı",{"type":32,"tag":848,"props":849,"children":850},"tbody",{},[851,870,888],{"type":32,"tag":828,"props":852,"children":853},{},[854,860,865],{"type":32,"tag":855,"props":856,"children":857},"td",{},[858],{"type":37,"value":859},"Mean similarity shift",{"type":32,"tag":855,"props":861,"children":862},{},[863],{"type":37,"value":864},"baseline − 0.05",{"type":32,"tag":855,"props":866,"children":867},{},[868],{"type":37,"value":869},"Query embedding ile index arasındaki uzaklık arttı",{"type":32,"tag":828,"props":871,"children":872},{},[873,878,883],{"type":32,"tag":855,"props":874,"children":875},{},[876],{"type":37,"value":877},"Top-k stability",{"type":32,"tag":855,"props":879,"children":880},{},[881],{"type":37,"value":882},"\u003C%90 overlap",{"type":32,"tag":855,"props":884,"children":885},{},[886],{"type":37,"value":887},"Aynı sorgu farklı sonuçlar döndürüyor (model değişiminin etkisi)",{"type":32,"tag":828,"props":889,"children":890},{},[891,896,901],{"type":32,"tag":855,"props":892,"children":893},{},[894],{"type":37,"value":895},"OOV (out-of-vocabulary) rate",{"type":32,"tag":855,"props":897,"children":898},{},[899],{"type":37,"value":900},">%2",{"type":32,"tag":855,"props":902,"children":903},{},[904],{"type":37,"value":905},"Yeni model eski corpus'taki terimleri tanımıyor",{"type":32,"tag":33,"props":907,"children":908},{},[909],{"type":37,"value":910},"Mean similarity shift'i günlük batch job ile hesaplayın — son 24 saatte atılan sorguları alın, hem eski model hem yeni model ile embed edin, stored embedding'lerle cosine similarity karşılaştırın. Eğer yeni model ile similarity 0.73, eski model ile 0.78 ise — 0.05 drift var demektir, re-indexing sinyali.",{"type":32,"tag":33,"props":912,"children":913},{},[914],{"type":37,"value":915},"Top-k stability için aynı test query set'ini (100-200 sorgu) her gün iki modelle çalıştırın, ilk 10 sonucu karşılaştırın. Eğer overlap %85'in altına düşerse — model migration gerekiyor.",{"type":32,"tag":57,"props":917,"children":919},{"id":918},"model-migration-stratejisi-blue-green-deployment",[920],{"type":37,"value":921},"Model Migration Stratejisi: Blue-Green Deployment",{"type":32,"tag":33,"props":923,"children":924},{},[925],{"type":37,"value":926},"Model değiştirirken atomic switchover yapın — blue-green deployment. Eski index \"blue\", yeni index \"green\" olsun. Traffic ilk önce blue'ya gider, siz arka planda green'i doldurursunuz. Green ready olduğunda traffic'i 5 dakikada green'e çekersiniz. Eğer problem varsa hemen blue'ya rollback.",{"type":32,"tag":33,"props":928,"children":929},{},[930],{"type":37,"value":931},"Konkret adımlar:",{"type":32,"tag":933,"props":934,"children":935},"ol",{},[936,956,966,984,994,1004],{"type":32,"tag":937,"props":938,"children":939},"li",{},[940,946,948,954],{"type":32,"tag":941,"props":942,"children":943},"strong",{},[944],{"type":37,"value":945},"T-0:",{"type":37,"value":947}," Yeni model ile embedding üretmeye başla, paralel index oluştur (",{"type":32,"tag":40,"props":949,"children":951},{"className":950},[],[952],{"type":37,"value":953},"green_index",{"type":37,"value":955},").",{"type":32,"tag":937,"props":957,"children":958},{},[959,964],{"type":32,"tag":941,"props":960,"children":961},{},[962],{"type":37,"value":963},"T+18h:",{"type":37,"value":965}," Green index %100 ready. Blue index hâlâ live.",{"type":32,"tag":937,"props":967,"children":968},{},[969,974,976,982],{"type":32,"tag":941,"props":970,"children":971},{},[972],{"type":37,"value":973},"T+18h 5m:",{"type":37,"value":975}," Query router'a ",{"type":32,"tag":40,"props":977,"children":979},{"className":978},[],[980],{"type":37,"value":981},"MODEL_VERSION=green",{"type":37,"value":983}," flag ekle, traffic %10 green'e shift et.",{"type":32,"tag":937,"props":985,"children":986},{},[987,992],{"type":32,"tag":941,"props":988,"children":989},{},[990],{"type":37,"value":991},"T+18h 30m:",{"type":37,"value":993}," Hata yok, %50 shift.",{"type":32,"tag":937,"props":995,"children":996},{},[997,1002],{"type":32,"tag":941,"props":998,"children":999},{},[1000],{"type":37,"value":1001},"T+19h:",{"type":37,"value":1003}," %100 green. Blue index read-only mode'a alınır (7 gün yedek).",{"type":32,"tag":937,"props":1005,"children":1006},{},[1007,1012],{"type":32,"tag":941,"props":1008,"children":1009},{},[1010],{"type":37,"value":1011},"T+7 gün:",{"type":37,"value":1013}," Blue index silinir.",{"type":32,"tag":33,"props":1015,"children":1016},{},[1017],{"type":37,"value":1018},"Bu yaklaşım özellikle e-ticaret arama sistemlerinde kritik — Roibase'in çalıştığı bir müşteride (kozmetik kategori, 2.4M ürün, 80K\u002Fgün sorgu) model migration sırasında %0.2 oturum kaybı yaşandı (blue-green sayesinde rollback 12 saniyede tamamlandı).",{"type":32,"tag":79,"props":1020,"children":1022},{"id":1021},"cost-optimization-batch-cache",[1023],{"type":37,"value":1024},"Cost Optimization: Batch + Cache",{"type":32,"tag":33,"props":1026,"children":1027},{},[1028],{"type":37,"value":1029},"Re-indexing maliyetini düşürmek için iki teknik:",{"type":32,"tag":33,"props":1031,"children":1032},{},[1033,1038],{"type":32,"tag":941,"props":1034,"children":1035},{},[1036],{"type":37,"value":1037},"Batch API kullanımı:",{"type":37,"value":1039}," OpenAI batch API normal API'ye göre %50 indirimli (0.13 → 0.065 dolar\u002F1M token). Ancak async — response 1-24 saat içinde gelir. Re-indexing için yeterli çünkü realtime değil. 12M dokümanı batch'e gönderirseniz 6.400 → 3.200 dolar.",{"type":32,"tag":33,"props":1041,"children":1042},{},[1043,1048],{"type":32,"tag":941,"props":1044,"children":1045},{},[1046],{"type":37,"value":1047},"Semantic cache:",{"type":37,"value":1049}," Eğer aynı doküman farklı metadata ile birden fazla kez indexlenmişse (örn: same product description, farklı SKU), embedding'i cache'leyin. MD5 hash ile deduplicate edin. Roibase deneyiminde bu %12-18 maliyet azaltması sağlıyor (özellikli fashion\u002Fbeauty segmentlerinde ürün açıklamaları benzer oluyor).",{"type":32,"tag":124,"props":1051,"children":1053},{"className":378,"code":1052,"language":380,"meta":16,"style":16},"import hashlib\nfrom functools import lru_cache\n\n@lru_cache(maxsize=100_000)\ndef cached_embed(text: str, model: str) -> list[float]:\n    cache_key = hashlib.md5(f\"{model}:{text}\".encode()).hexdigest()\n    cached = redis.get(cache_key)\n    if cached:\n        return json.loads(cached)\n    \n    emb = openai.Embedding.create(input=text, model=model)\n    redis.setex(cache_key, 86400 * 7, json.dumps(emb))\n    return emb\n",[1054],{"type":32,"tag":40,"props":1055,"children":1056},{"__ignoreMap":16},[1057,1070,1092,1099,1131,1175,1242,1259,1271,1283,1290,1334,1362],{"type":32,"tag":134,"props":1058,"children":1059},{"class":136,"line":137},[1060,1065],{"type":32,"tag":134,"props":1061,"children":1062},{"style":141},[1063],{"type":37,"value":1064},"import",{"type":32,"tag":134,"props":1066,"children":1067},{"style":158},[1068],{"type":37,"value":1069}," hashlib\n",{"type":32,"tag":134,"props":1071,"children":1072},{"class":136,"line":164},[1073,1078,1083,1087],{"type":32,"tag":134,"props":1074,"children":1075},{"style":141},[1076],{"type":37,"value":1077},"from",{"type":32,"tag":134,"props":1079,"children":1080},{"style":158},[1081],{"type":37,"value":1082}," functools ",{"type":32,"tag":134,"props":1084,"children":1085},{"style":141},[1086],{"type":37,"value":1064},{"type":32,"tag":134,"props":1088,"children":1089},{"style":158},[1090],{"type":37,"value":1091}," lru_cache\n",{"type":32,"tag":134,"props":1093,"children":1094},{"class":136,"line":183},[1095],{"type":32,"tag":134,"props":1096,"children":1097},{"emptyLinePlaceholder":321},[1098],{"type":37,"value":324},{"type":32,"tag":134,"props":1100,"children":1101},{"class":136,"line":242},[1102,1107,1112,1117,1121,1126],{"type":32,"tag":134,"props":1103,"children":1104},{"style":152},[1105],{"type":37,"value":1106},"@lru_cache",{"type":32,"tag":134,"props":1108,"children":1109},{"style":158},[1110],{"type":37,"value":1111},"(",{"type":32,"tag":134,"props":1113,"children":1114},{"style":500},[1115],{"type":37,"value":1116},"maxsize",{"type":32,"tag":134,"props":1118,"children":1119},{"style":141},[1120],{"type":37,"value":455},{"type":32,"tag":134,"props":1122,"children":1123},{"style":405},[1124],{"type":37,"value":1125},"100_000",{"type":32,"tag":134,"props":1127,"children":1128},{"style":158},[1129],{"type":37,"value":1130},")\n",{"type":32,"tag":134,"props":1132,"children":1133},{"class":136,"line":260},[1134,1138,1143,1148,1152,1156,1160,1165,1170],{"type":32,"tag":134,"props":1135,"children":1136},{"style":141},[1137],{"type":37,"value":392},{"type":32,"tag":134,"props":1139,"children":1140},{"style":152},[1141],{"type":37,"value":1142}," cached_embed",{"type":32,"tag":134,"props":1144,"children":1145},{"style":158},[1146],{"type":37,"value":1147},"(text: ",{"type":32,"tag":134,"props":1149,"children":1150},{"style":405},[1151],{"type":37,"value":408},{"type":32,"tag":134,"props":1153,"children":1154},{"style":158},[1155],{"type":37,"value":413},{"type":32,"tag":134,"props":1157,"children":1158},{"style":405},[1159],{"type":37,"value":408},{"type":32,"tag":134,"props":1161,"children":1162},{"style":158},[1163],{"type":37,"value":1164},") -> list[",{"type":32,"tag":134,"props":1166,"children":1167},{"style":405},[1168],{"type":37,"value":1169},"float",{"type":32,"tag":134,"props":1171,"children":1172},{"style":158},[1173],{"type":37,"value":1174},"]:\n",{"type":32,"tag":134,"props":1176,"children":1177},{"class":136,"line":278},[1178,1183,1187,1192,1197,1202,1206,1211,1216,1221,1225,1229,1233,1237],{"type":32,"tag":134,"props":1179,"children":1180},{"style":158},[1181],{"type":37,"value":1182},"    cache_key ",{"type":32,"tag":134,"props":1184,"children":1185},{"style":141},[1186],{"type":37,"value":455},{"type":32,"tag":134,"props":1188,"children":1189},{"style":158},[1190],{"type":37,"value":1191}," hashlib.md5(",{"type":32,"tag":134,"props":1193,"children":1194},{"style":141},[1195],{"type":37,"value":1196},"f",{"type":32,"tag":134,"props":1198,"children":1199},{"style":221},[1200],{"type":37,"value":1201},"\"",{"type":32,"tag":134,"props":1203,"children":1204},{"style":405},[1205],{"type":37,"value":567},{"type":32,"tag":134,"props":1207,"children":1208},{"style":158},[1209],{"type":37,"value":1210},"model",{"type":32,"tag":134,"props":1212,"children":1213},{"style":405},[1214],{"type":37,"value":1215},"}",{"type":32,"tag":134,"props":1217,"children":1218},{"style":221},[1219],{"type":37,"value":1220},":",{"type":32,"tag":134,"props":1222,"children":1223},{"style":405},[1224],{"type":37,"value":567},{"type":32,"tag":134,"props":1226,"children":1227},{"style":158},[1228],{"type":37,"value":37},{"type":32,"tag":134,"props":1230,"children":1231},{"style":405},[1232],{"type":37,"value":1215},{"type":32,"tag":134,"props":1234,"children":1235},{"style":221},[1236],{"type":37,"value":1201},{"type":32,"tag":134,"props":1238,"children":1239},{"style":158},[1240],{"type":37,"value":1241},".encode()).hexdigest()\n",{"type":32,"tag":134,"props":1243,"children":1244},{"class":136,"line":295},[1245,1250,1254],{"type":32,"tag":134,"props":1246,"children":1247},{"style":158},[1248],{"type":37,"value":1249},"    cached ",{"type":32,"tag":134,"props":1251,"children":1252},{"style":141},[1253],{"type":37,"value":455},{"type":32,"tag":134,"props":1255,"children":1256},{"style":158},[1257],{"type":37,"value":1258}," redis.get(cache_key)\n",{"type":32,"tag":134,"props":1260,"children":1261},{"class":136,"line":26},[1262,1266],{"type":32,"tag":134,"props":1263,"children":1264},{"style":141},[1265],{"type":37,"value":601},{"type":32,"tag":134,"props":1267,"children":1268},{"style":158},[1269],{"type":37,"value":1270}," cached:\n",{"type":32,"tag":134,"props":1272,"children":1273},{"class":136,"line":317},[1274,1278],{"type":32,"tag":134,"props":1275,"children":1276},{"style":141},[1277],{"type":37,"value":630},{"type":32,"tag":134,"props":1279,"children":1280},{"style":158},[1281],{"type":37,"value":1282}," json.loads(cached)\n",{"type":32,"tag":134,"props":1284,"children":1285},{"class":136,"line":327},[1286],{"type":32,"tag":134,"props":1287,"children":1288},{"style":158},[1289],{"type":37,"value":468},{"type":32,"tag":134,"props":1291,"children":1292},{"class":136,"line":350},[1293,1298,1302,1307,1312,1316,1321,1325,1329],{"type":32,"tag":134,"props":1294,"children":1295},{"style":158},[1296],{"type":37,"value":1297},"    emb ",{"type":32,"tag":134,"props":1299,"children":1300},{"style":141},[1301],{"type":37,"value":455},{"type":32,"tag":134,"props":1303,"children":1304},{"style":158},[1305],{"type":37,"value":1306}," openai.Embedding.create(",{"type":32,"tag":134,"props":1308,"children":1309},{"style":500},[1310],{"type":37,"value":1311},"input",{"type":32,"tag":134,"props":1313,"children":1314},{"style":141},[1315],{"type":37,"value":455},{"type":32,"tag":134,"props":1317,"children":1318},{"style":158},[1319],{"type":37,"value":1320},"text, ",{"type":32,"tag":134,"props":1322,"children":1323},{"style":500},[1324],{"type":37,"value":1210},{"type":32,"tag":134,"props":1326,"children":1327},{"style":141},[1328],{"type":37,"value":455},{"type":32,"tag":134,"props":1330,"children":1331},{"style":158},[1332],{"type":37,"value":1333},"model)\n",{"type":32,"tag":134,"props":1335,"children":1336},{"class":136,"line":595},[1337,1342,1347,1352,1357],{"type":32,"tag":134,"props":1338,"children":1339},{"style":158},[1340],{"type":37,"value":1341},"    redis.setex(cache_key, ",{"type":32,"tag":134,"props":1343,"children":1344},{"style":405},[1345],{"type":37,"value":1346},"86400",{"type":32,"tag":134,"props":1348,"children":1349},{"style":141},[1350],{"type":37,"value":1351}," *",{"type":32,"tag":134,"props":1353,"children":1354},{"style":405},[1355],{"type":37,"value":1356}," 7",{"type":32,"tag":134,"props":1358,"children":1359},{"style":158},[1360],{"type":37,"value":1361},", json.dumps(emb))\n",{"type":32,"tag":134,"props":1363,"children":1364},{"class":136,"line":624},[1365,1369],{"type":32,"tag":134,"props":1366,"children":1367},{"style":141},[1368],{"type":37,"value":786},{"type":32,"tag":134,"props":1370,"children":1371},{"style":158},[1372],{"type":37,"value":1373}," emb\n",{"type":32,"tag":57,"props":1375,"children":1377},{"id":1376},"fine-tuned-model-geçişi-domain-adaptation-tradeoff",[1378],{"type":37,"value":1379},"Fine-Tuned Model Geçişi: Domain Adaptation Tradeoff",{"type":32,"tag":33,"props":1381,"children":1382},{},[1383,1385,1391,1392,1398],{"type":37,"value":1384},"Generic embedding modeli yerine domain-specific fine-tuned model kullanmak retrieval@10'u %8-15 artırır (örn: legal domain'de ",{"type":32,"tag":40,"props":1386,"children":1388},{"className":1387},[],[1389],{"type":37,"value":1390},"paraphrase-mpnet-base-v2",{"type":37,"value":47},{"type":32,"tag":40,"props":1393,"children":1395},{"className":1394},[],[1396],{"type":37,"value":1397},"legal-bert-base-uncased",{"type":37,"value":1399}," + contrastive learning). Ancak fine-tuning maliyeti var: (1) labeled data toplama (1000-5000 query-document pair), (2) GPU time (A100 8 saat ≈ 60 dolar), (3) tam corpus re-indexing.",{"type":32,"tag":33,"props":1401,"children":1402},{},[1403],{"type":37,"value":1404},"Tradeoff analizi: eğer retrieval accuracy %10 artarsa ve bu conversion'a %2 katkı yapıyorsa (örn: lead gen flow'unda doğru makale önermek form doldurmayı %2 artırıyor), aylık 100K sorgu × 0.02 × 50 dolar AOV = 100K dolar lift. Bu durumda 10K dolar fine-tuning + re-indexing maliyeti 1 ayda geri döner.",{"type":32,"tag":33,"props":1406,"children":1407},{},[1408],{"type":37,"value":1409},"Ancak fine-tuned model maintenance maliyeti de var — her 6 ayda bir yeni data ile re-train gerekir (domain shift). Bu sürekli re-indexing döngüsü getirir. Alternatif: adapter layer — base model üzerine küçük bir fine-tuned layer ekleyin, böylece base embedding'ler sabit kalır, sadece query-time projection değişir. Bu durumda re-indexing gerekmez ama accuracy gain %15'ten %8'e düşer.",{"type":32,"tag":57,"props":1411,"children":1413},{"id":1412},"karşı-durum-re-indexing-gereksiz-mi",[1414],{"type":37,"value":1415},"Karşı Durum: Re-indexing Gereksiz mi?",{"type":32,"tag":33,"props":1417,"children":1418},{},[1419],{"type":37,"value":1420},"Bazı durumda re-indexing yapmamak doğru karar olabilir. Eğer (1) model değişimi minor ise (örn: OpenAI ada-002 ile text-embedding-3-small arasında empirik recall farkı \u003C%2), (2) corpus statik ise (yeni doküman eklenmiyor), (3) sorgu pattern'i değişmiyor ise — drift minimal olur.",{"type":32,"tag":33,"props":1422,"children":1423},{},[1424],{"type":37,"value":1425},"Özellikle B2B SaaS ürünlerinde (internal knowledge base, documentation search) corpus yılda 1-2 kez güncellenir. Bu durumda major model upgrade (örn: BERT → MPNet) dışında re-indexing yapmamak mantıklı. Bunun yerine sorgu zamanında ensemble yapın — hem eski model hem yeni model ile retrieval yapın, sonuçları reciprocal rank fusion ile merge edin. Bu %3-5 latency maliyeti getirir ama re-indexing maliyetinden düşük.",{"type":32,"tag":33,"props":1427,"children":1428},{},[1429],{"type":37,"value":1430},"Karar ağacı:",{"type":32,"tag":1432,"props":1433,"children":1434},"ul",{},[1435,1440,1445,1450,1455],{"type":32,"tag":937,"props":1436,"children":1437},{},[1438],{"type":37,"value":1439},"Corpus >5M doküman + yeni model %5+ accuracy gain → hot\u002Fcold partitioning ile incremental re-index",{"type":32,"tag":937,"props":1441,"children":1442},{},[1443],{"type":37,"value":1444},"Corpus \u003C1M + %10+ gain → blue-green full re-index",{"type":32,"tag":937,"props":1446,"children":1447},{},[1448],{"type":37,"value":1449},"Corpus \u003C1M + \u003C%5 gain → ensemble + re-index erteleme",{"type":32,"tag":937,"props":1451,"children":1452},{},[1453],{"type":37,"value":1454},"Fine-tuned model + conversion impact >10× maliyet → re-index",{"type":32,"tag":937,"props":1456,"children":1457},{},[1458],{"type":37,"value":1459},"Fine-tuned model + conversion impact \u003C3× maliyet → adapter layer veya vazgeç",{"type":32,"tag":33,"props":1461,"children":1462},{},[1463,1465,1472],{"type":37,"value":1464},"Roibase'in ",{"type":32,"tag":798,"props":1466,"children":1469},{"href":1467,"rel":1468},"https:\u002F\u002Fwww.roibase.com.tr\u002Ftr\u002Fgeo",[802],[1470],{"type":37,"value":1471},"GEO çalışmalarında",{"type":37,"value":1473}," benzer bir durum var — LLM citation optimize ederken hangi içeriği yeniden üretmek gerekir, hangisi mevcut haliyle yeterli? Bu da maliyet-etki tradeoff'u gerektirir.",{"type":32,"tag":57,"props":1475,"children":1477},{"id":1476},"drift-önleme-version-pinning-ve-contract-testing",[1478],{"type":37,"value":1479},"Drift Önleme: Version Pinning ve Contract Testing",{"type":32,"tag":33,"props":1481,"children":1482},{},[1483,1485,1490],{"type":37,"value":1484},"Production'da embedding drift'ten korunmanın en iyi yolu — model versiyonunu pin'lemek ve API contract test yazmak. OpenAI ",{"type":32,"tag":40,"props":1486,"children":1488},{"className":1487},[],[1489],{"type":37,"value":45},{"type":37,"value":1491}," kullanıyorsanız, model ID'yi config'de sabit tutun, otomatik upgrade'e izin vermeyin. Yeni versiyon çıktığında manuel test edin.",{"type":32,"tag":33,"props":1493,"children":1494},{},[1495],{"type":37,"value":1496},"Contract test örneği:",{"type":32,"tag":124,"props":1498,"children":1500},{"className":378,"code":1499,"language":380,"meta":16,"style":16},"def test_embedding_compatibility():\n    test_docs = [\n        \"machine learning model training\",\n        \"vector database indexing\",\n        \"semantic search optimization\"\n    ]\n    \n    # baseline embedding (production model)\n    baseline = [embed(doc, model=\"text-embedding-3-large\") for doc in test_docs]\n    \n    # yeni model ile karşılaştır\n    candidate = [embed(doc, model=\"text-embedding-4\") for doc in test_docs]\n    \n    # cosine similarity kontrolü\n    for i, doc in enumerate(test_docs):\n        sim = cosine_similarity(baseline[i], candidate[i])\n        assert sim > 0.95, f\"Embedding drift detected: {doc}, sim={sim}\"\n",[1501],{"type":32,"tag":40,"props":1502,"children":1503},{"__ignoreMap":16},[1504,1521,1538,1550,1562,1570,1578,1585,1593,1648,1655,1663,1712,1719,1727,1754,1771],{"type":32,"tag":134,"props":1505,"children":1506},{"class":136,"line":137},[1507,1511,1516],{"type":32,"tag":134,"props":1508,"children":1509},{"style":141},[1510],{"type":37,"value":392},{"type":32,"tag":134,"props":1512,"children":1513},{"style":152},[1514],{"type":37,"value":1515}," test_embedding_compatibility",{"type":32,"tag":134,"props":1517,"children":1518},{"style":158},[1519],{"type":37,"value":1520},"():\n",{"type":32,"tag":134,"props":1522,"children":1523},{"class":136,"line":164},[1524,1529,1533],{"type":32,"tag":134,"props":1525,"children":1526},{"style":158},[1527],{"type":37,"value":1528},"    test_docs ",{"type":32,"tag":134,"props":1530,"children":1531},{"style":141},[1532],{"type":37,"value":455},{"type":32,"tag":134,"props":1534,"children":1535},{"style":158},[1536],{"type":37,"value":1537}," [\n",{"type":32,"tag":134,"props":1539,"children":1540},{"class":136,"line":183},[1541,1546],{"type":32,"tag":134,"props":1542,"children":1543},{"style":221},[1544],{"type":37,"value":1545},"        \"machine learning model training\"",{"type":32,"tag":134,"props":1547,"children":1548},{"style":158},[1549],{"type":37,"value":180},{"type":32,"tag":134,"props":1551,"children":1552},{"class":136,"line":242},[1553,1558],{"type":32,"tag":134,"props":1554,"children":1555},{"style":221},[1556],{"type":37,"value":1557},"        \"vector database indexing\"",{"type":32,"tag":134,"props":1559,"children":1560},{"style":158},[1561],{"type":37,"value":180},{"type":32,"tag":134,"props":1563,"children":1564},{"class":136,"line":260},[1565],{"type":32,"tag":134,"props":1566,"children":1567},{"style":221},[1568],{"type":37,"value":1569},"        \"semantic search optimization\"\n",{"type":32,"tag":134,"props":1571,"children":1572},{"class":136,"line":278},[1573],{"type":32,"tag":134,"props":1574,"children":1575},{"style":158},[1576],{"type":37,"value":1577},"    ]\n",{"type":32,"tag":134,"props":1579,"children":1580},{"class":136,"line":295},[1581],{"type":32,"tag":134,"props":1582,"children":1583},{"style":158},[1584],{"type":37,"value":468},{"type":32,"tag":134,"props":1586,"children":1587},{"class":136,"line":26},[1588],{"type":32,"tag":134,"props":1589,"children":1590},{"style":474},[1591],{"type":37,"value":1592},"    # baseline embedding (production model)\n",{"type":32,"tag":134,"props":1594,"children":1595},{"class":136,"line":317},[1596,1601,1605,1610,1614,1618,1623,1628,1633,1638,1643],{"type":32,"tag":134,"props":1597,"children":1598},{"style":158},[1599],{"type":37,"value":1600},"    baseline ",{"type":32,"tag":134,"props":1602,"children":1603},{"style":141},[1604],{"type":37,"value":455},{"type":32,"tag":134,"props":1606,"children":1607},{"style":158},[1608],{"type":37,"value":1609}," [embed(doc, ",{"type":32,"tag":134,"props":1611,"children":1612},{"style":500},[1613],{"type":37,"value":1210},{"type":32,"tag":134,"props":1615,"children":1616},{"style":141},[1617],{"type":37,"value":455},{"type":32,"tag":134,"props":1619,"children":1620},{"style":221},[1621],{"type":37,"value":1622},"\"text-embedding-3-large\"",{"type":32,"tag":134,"props":1624,"children":1625},{"style":158},[1626],{"type":37,"value":1627},") ",{"type":32,"tag":134,"props":1629,"children":1630},{"style":141},[1631],{"type":37,"value":1632},"for",{"type":32,"tag":134,"props":1634,"children":1635},{"style":158},[1636],{"type":37,"value":1637}," doc ",{"type":32,"tag":134,"props":1639,"children":1640},{"style":141},[1641],{"type":37,"value":1642},"in",{"type":32,"tag":134,"props":1644,"children":1645},{"style":158},[1646],{"type":37,"value":1647}," test_docs]\n",{"type":32,"tag":134,"props":1649,"children":1650},{"class":136,"line":327},[1651],{"type":32,"tag":134,"props":1652,"children":1653},{"style":158},[1654],{"type":37,"value":468},{"type":32,"tag":134,"props":1656,"children":1657},{"class":136,"line":350},[1658],{"type":32,"tag":134,"props":1659,"children":1660},{"style":474},[1661],{"type":37,"value":1662},"    # yeni model ile karşılaştır\n",{"type":32,"tag":134,"props":1664,"children":1665},{"class":136,"line":595},[1666,1671,1675,1679,1683,1687,1692,1696,1700,1704,1708],{"type":32,"tag":134,"props":1667,"children":1668},{"style":158},[1669],{"type":37,"value":1670},"    candidate ",{"type":32,"tag":134,"props":1672,"children":1673},{"style":141},[1674],{"type":37,"value":455},{"type":32,"tag":134,"props":1676,"children":1677},{"style":158},[1678],{"type":37,"value":1609},{"type":32,"tag":134,"props":1680,"children":1681},{"style":500},[1682],{"type":37,"value":1210},{"type":32,"tag":134,"props":1684,"children":1685},{"style":141},[1686],{"type":37,"value":455},{"type":32,"tag":134,"props":1688,"children":1689},{"style":221},[1690],{"type":37,"value":1691},"\"text-embedding-4\"",{"type":32,"tag":134,"props":1693,"children":1694},{"style":158},[1695],{"type":37,"value":1627},{"type":32,"tag":134,"props":1697,"children":1698},{"style":141},[1699],{"type":37,"value":1632},{"type":32,"tag":134,"props":1701,"children":1702},{"style":158},[1703],{"type":37,"value":1637},{"type":32,"tag":134,"props":1705,"children":1706},{"style":141},[1707],{"type":37,"value":1642},{"type":32,"tag":134,"props":1709,"children":1710},{"style":158},[1711],{"type":37,"value":1647},{"type":32,"tag":134,"props":1713,"children":1714},{"class":136,"line":624},[1715],{"type":32,"tag":134,"props":1716,"children":1717},{"style":158},[1718],{"type":37,"value":468},{"type":32,"tag":134,"props":1720,"children":1721},{"class":136,"line":638},[1722],{"type":32,"tag":134,"props":1723,"children":1724},{"style":474},[1725],{"type":37,"value":1726},"    # cosine similarity kontrolü\n",{"type":32,"tag":134,"props":1728,"children":1729},{"class":136,"line":646},[1730,1735,1740,1744,1749],{"type":32,"tag":134,"props":1731,"children":1732},{"style":141},[1733],{"type":37,"value":1734},"    for",{"type":32,"tag":134,"props":1736,"children":1737},{"style":158},[1738],{"type":37,"value":1739}," i, doc ",{"type":32,"tag":134,"props":1741,"children":1742},{"style":141},[1743],{"type":37,"value":1642},{"type":32,"tag":134,"props":1745,"children":1746},{"style":405},[1747],{"type":37,"value":1748}," enumerate",{"type":32,"tag":134,"props":1750,"children":1751},{"style":158},[1752],{"type":37,"value":1753},"(test_docs):\n",{"type":32,"tag":134,"props":1755,"children":1756},{"class":136,"line":655},[1757,1762,1766],{"type":32,"tag":134,"props":1758,"children":1759},{"style":158},[1760],{"type":37,"value":1761},"        sim ",{"type":32,"tag":134,"props":1763,"children":1764},{"style":141},[1765],{"type":37,"value":455},{"type":32,"tag":134,"props":1767,"children":1768},{"style":158},[1769],{"type":37,"value":1770}," cosine_similarity(baseline[i], candidate[i])\n",{"type":32,"tag":134,"props":1772,"children":1773},{"class":136,"line":672},[1774,1779,1784,1789,1794,1798,1802,1807,1811,1816,1820,1825,1829,1834,1838],{"type":32,"tag":134,"props":1775,"children":1776},{"style":141},[1777],{"type":37,"value":1778},"        assert",{"type":32,"tag":134,"props":1780,"children":1781},{"style":158},[1782],{"type":37,"value":1783}," sim ",{"type":32,"tag":134,"props":1785,"children":1786},{"style":141},[1787],{"type":37,"value":1788},">",{"type":32,"tag":134,"props":1790,"children":1791},{"style":405},[1792],{"type":37,"value":1793}," 0.95",{"type":32,"tag":134,"props":1795,"children":1796},{"style":158},[1797],{"type":37,"value":229},{"type":32,"tag":134,"props":1799,"children":1800},{"style":141},[1801],{"type":37,"value":1196},{"type":32,"tag":134,"props":1803,"children":1804},{"style":221},[1805],{"type":37,"value":1806},"\"Embedding drift detected: ",{"type":32,"tag":134,"props":1808,"children":1809},{"style":405},[1810],{"type":37,"value":567},{"type":32,"tag":134,"props":1812,"children":1813},{"style":158},[1814],{"type":37,"value":1815},"doc",{"type":32,"tag":134,"props":1817,"children":1818},{"style":405},[1819],{"type":37,"value":1215},{"type":32,"tag":134,"props":1821,"children":1822},{"style":221},[1823],{"type":37,"value":1824},", sim=",{"type":32,"tag":134,"props":1826,"children":1827},{"style":405},[1828],{"type":37,"value":567},{"type":32,"tag":134,"props":1830,"children":1831},{"style":158},[1832],{"type":37,"value":1833},"sim",{"type":32,"tag":134,"props":1835,"children":1836},{"style":405},[1837],{"type":37,"value":1215},{"type":32,"tag":134,"props":1839,"children":1840},{"style":221},[1841],{"type":37,"value":1842},"\"\n",{"type":32,"tag":33,"props":1844,"children":1845},{},[1846],{"type":37,"value":1847},"Bu test CI\u002FCD pipeline'ında her model update'inde koşar. Eğer drift %5'i geçerse deployment bloklarınız, manual review yaparsınız.",{"type":32,"tag":33,"props":1849,"children":1850},{},[1851],{"type":37,"value":1852},"Re-indexing'i planlı maintenance window'a bağlayın — ayda bir pazar gecesi 02:00-06:00 arası. Bu şekilde drift birikimi önlenir, kullanıcı deneyimi etkilenmez. Roibase operasyonlarında benzer pencereler kullanıyoruz — örneğin CDP sync job'ları gece 03:00'te koşar, böylece gündüz query latency'si artmaz.",{"type":32,"tag":1854,"props":1855,"children":1856},"style",{},[1857],{"type":37,"value":1858},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":16,"searchDepth":183,"depth":183,"links":1860},[1861,1864,1867,1870,1871,1872],{"id":59,"depth":164,"text":62,"children":1862},[1863],{"id":81,"depth":183,"text":84},{"id":104,"depth":164,"text":107,"children":1865},[1866],{"id":810,"depth":183,"text":813},{"id":918,"depth":164,"text":921,"children":1868},[1869],{"id":1021,"depth":183,"text":1024},{"id":1376,"depth":164,"text":1379},{"id":1412,"depth":164,"text":1415},{"id":1476,"depth":164,"text":1479},"markdown","content:tr:ai:embedding-drift-uretimde-vector-dbleri-nasil-surdururuz.md","content","tr\u002Fai\u002Fembedding-drift-uretimde-vector-dbleri-nasil-surdururuz.md","tr\u002Fai\u002Fembedding-drift-uretimde-vector-dbleri-nasil-surdururuz","md",1779285859578]