[{"data":1,"prerenderedAt":1781},["ShallowReactive",2],{"article-alternates":3,"article-\u002Fru\u002Fai\u002Fembedding-drift-vector-db-production":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":11,"_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":1775,"_id":1776,"_source":1777,"_file":1778,"_stem":1779,"_extension":1780},"ai",false,"","Embedding Drift: Как поддерживать Vector DB в production","Несовместимость эмбеддингов при смене модели, стоимость переиндексации и стратегии постепенной миграции — устойчивость Vector Database в production","2026-05-18",[21,22,23,24,25],"vector-database","embedding-drift","mlops","retrieval-augmented-generation","model-migration",9,"Roibase",{"type":29,"children":30,"toc":1761},"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,1401,1406,1411,1417,1422,1427,1432,1461,1475,1481,1493,1498,1755],{"type":32,"tag":33,"props":34,"children":35},"element","p",{},[36,39,46,48,54],{"type":37,"value":38},"text","Когда вы развёртываете RAG-системы в production, первый месяц работает отлично. На третий месяц 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},", потом ",{"type":32,"tag":40,"props":49,"children":51},{"className":50},[],[52],{"type":37,"value":53},"text-embedding-4",{"type":37,"value":55},". Вы тестируете новую модель — recall на 4% выше. Но 12 миллионов документов по-прежнему проиндексированы по старой модели. Переиндексация занимает 18 часов, стоит 6400 долларов в API-вызовах. Вот где начинается embedding drift — вы обновляете модель, а vector store остаётся в прошлом. Query embedding и stored embedding находятся в разных многообразиях, accuracy retrieval молча падает. В этом материале разберём, при каком соотношении затрат и качества делать migration, как спроектировать incremental re-indexing и как измерять drift в production.",{"type":32,"tag":57,"props":58,"children":60},"h2",{"id":59},"что-такое-embedding-drift-и-почему-это-важно",[61],{"type":37,"value":62},"Что такое Embedding Drift и почему это важно",{"type":32,"tag":33,"props":64,"children":65},{},[66],{"type":37,"value":67},"Embedding drift — ситуация, когда query embedding генерируется другой моделью, чем document embedding. Если вы индексировали документы моделью A, а запросы обрабатываете моделью B — cosine similarity становится бессмысленна. Две модели работают в разных векторных пространствах, \"схожесть\" скоры теряют смысл.",{"type":32,"tag":33,"props":69,"children":70},{},[71],{"type":37,"value":72},"Это происходит в трёх сценариях: (1) провайдер эмбеддингов выпускает новую версию (OpenAI ada-002 → text-embedding-3-small снизил размер на 12%, но binary compatibility отсутствует), (2) переход на fine-tuned модель (модель, обучённая на domain-specific данных, работает лучше, но корпус нужно переиндексировать полностью), (3) смена multilingual модели (переход с sentence-transformers\u002Fparaphrase-multilingual-mpnet-base-v2 на intfloat\u002Fmultilingual-e5-large повышает retrieval@10 на 8%, но mapping не 1:1).",{"type":32,"tag":33,"props":74,"children":75},{},[76],{"type":37,"value":77},"В production drift трудно заметить, потому что метрики падают постепенно. На первой неделе юзеры жалуются \"результаты стали хуже\", на второй неделе количество тикетов поддержки растёт на 15%, на третьей неделе падает retention. Ранний сигнал drift'а — средняя cosine similarity новых запросов ниже, чем baseline во время индексации. Если во время индексации было mean cosine similarity 0.78, а теперь во время запросов 0.71 — это признак несовместимости модели.",{"type":32,"tag":79,"props":80,"children":82},"h3",{"id":81},"trade-off-re-index-vs-dual-model",[83],{"type":37,"value":84},"Trade-off: Re-index vs Dual Model",{"type":32,"tag":33,"props":86,"children":87},{},[88,90,95],{"type":37,"value":89},"Думайте о стоимости переиндексации в трёх компонентах: (1) стоимость API (OpenAI ",{"type":32,"tag":40,"props":91,"children":93},{"className":92},[],[94],{"type":37,"value":45},{"type":37,"value":96}," стоит 0.13 доллара за 1M токенов, Cohere embed-v3 — 0.10), (2) compute time (12M документов × 512 токенов в среднем = 6.1B токенов ≈ 18 часов параллельной обработки), (3) риск downtime (если не сделать atomic switchover, запросы упадут на полуготовый индекс).",{"type":32,"tag":33,"props":98,"children":99},{},[100],{"type":37,"value":101},"Альтернатива — dual model стратегия: создать отдельный индекс для новой модели и делать A\u002FB тестирование при переходе. Storage cost удвоится, но риск исчезнет. Когда новый индекс готов, постепенно переводите трафик: 10% → 50% → 100%. Если заметите regression — можно откатиться мгновенно. Но двойной индекс означает двойные затраты на хранилище (Pinecone p1.x1 pod стоит 0.096 доллара\u002Fчас, 12M vectors 1536-dim = ~18GB ≈ 2 pod'а = 140 долларов\u002Fмесяц, dual index = 280 долларов\u002Fмесяц).",{"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},"Вместо переиндексации всего корпуса за ночь — разделите документы по частоте использования: hot\u002Fcold partition. \"Hot\" — документы, на которые делали запросы за последние 30 дней, \"cold\" — остальное. Hot partition обычно составляет 15-25% корпуса, но отвечает за 80% попаданий запросов.",{"type":32,"tag":33,"props":114,"children":115},{},[116],{"type":37,"value":117},"Стратегия: сначала переиндексируйте hot partition'ом новой моделью (18 часов → 3 часа, 6400 → 1200 долларов). При запросе используйте shard routing — сначала ищите в hot индексе, если не нашли — fallback на cold. Так 80% accuracy improvement получаете в день, 100% — за 2-3 недели rolling re-index'а.",{"type":32,"tag":33,"props":119,"children":120},{},[121],{"type":37,"value":122},"Для отслеживания partition'ов достаточно таблицы в PostgreSQL:",{"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,316,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":310},{"class":136,"line":309},8,[311],{"type":32,"tag":134,"props":312,"children":313},{"style":158},[314],{"type":37,"value":315},");\n",{"type":32,"tag":134,"props":317,"children":318},{"class":136,"line":26},[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'а:",{"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\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    # если не достаточно — дополняем из cold\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\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":309},[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":26},[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},"    # если не достаточно — дополняем из cold\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},"Этот подход похож на \"event-driven incremental sync\" из ",{"type":32,"tag":798,"props":799,"children":803},"a",{"href":800,"rel":801},"https:\u002F\u002Fwww.roibase.com.tr\u002Fru\u002Ffirstparty",[802],"nofollow",[804],{"type":37,"value":805},"first-party data архитектуры Roibase",{"type":37,"value":807}," — вместо копирования всех данных за раз синхронизируем меняющийся subset постоянно.",{"type":32,"tag":79,"props":809,"children":811},{"id":810},"drift-detection-мониторинг-embedding-space",[812],{"type":37,"value":813},"Drift Detection: Мониторинг Embedding Space",{"type":32,"tag":33,"props":815,"children":816},{},[817],{"type":37,"value":818},"Измеряйте drift в production тремя метриками:",{"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},"Метрика",{"type":32,"tag":832,"props":838,"children":839},{},[840],{"type":37,"value":841},"Порог",{"type":32,"tag":832,"props":843,"children":844},{},[845],{"type":37,"value":846},"Значение",{"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 отдалилась от индекса",{"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},"Один запрос возвращает разные результаты (эффект смены модели)",{"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},"Новая модель не распознаёт термины из старого корпуса",{"type":32,"tag":33,"props":907,"children":908},{},[909],{"type":37,"value":910},"Mean similarity shift рассчитывайте ежедневным batch job'ом — возьмите запросы за последние 24 часа, закодируйте их обе модели, вычислите cosine similarity с stored embedding'ами. Если новая модель даёт similarity 0.73, старая 0.78 — есть drift на 0.05, нужна переиндексация.",{"type":32,"tag":33,"props":912,"children":913},{},[914],{"type":37,"value":915},"Top-k stability — каждый день прогоняйте тот же набор тестовых запросов (100-200 штук) обеими моделями, сравнивайте топ-10 результатов. Если overlap упадёт ниже 85% — нужна миграция модели.",{"type":32,"tag":57,"props":917,"children":919},{"id":918},"стратегия-migration-blue-green-deployment",[920],{"type":37,"value":921},"Стратегия Migration: Blue-Green Deployment",{"type":32,"tag":33,"props":923,"children":924},{},[925],{"type":37,"value":926},"При смене модели делайте atomic switchover — blue-green deployment. Старый индекс — \"blue\", новый — \"green\". Трафик идёт на blue, вы заполняете green в фоне. Когда green готов, переводите трафик за 5 минут. Проблема — откат на blue мгновенный.",{"type":32,"tag":33,"props":928,"children":929},{},[930],{"type":37,"value":931},"Пошагово:",{"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}," Начинаете генерировать embedding'и новой моделью, параллельно создаёте индекс (",{"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 индекс готов на 100%, blue всё ещё 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'е устанавливаете флаг ",{"type":32,"tag":40,"props":977,"children":979},{"className":978},[],[980],{"type":37,"value":981},"MODEL_VERSION=green",{"type":37,"value":983},", переводите 10% трафика на green.",{"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}," Ошибок нет, переводите 50%.",{"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 переходит в read-only (резервная копия на 7 дней).",{"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 дней:",{"type":37,"value":1013}," Blue индекс удаляется.",{"type":32,"tag":33,"props":1015,"children":1016},{},[1017],{"type":37,"value":1018},"Roibase работал с e-commerce клиентом (косметика, 2.4M товаров, 80K запросов\u002Fдень), где migration модели привела к loss 0.2% сессий (благодаря blue-green, откат произошёл за 12 секунд).",{"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},"Снизьте стоимость переиндексации двумя техниками:",{"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:",{"type":37,"value":1039}," OpenAI batch API на 50% дешевле обычного (0.13 → 0.065 доллара\u002F1M токенов). Асинхронный — response через 1-24 часа. Для переиндексации подходит идеально. 12M документов в batch'е = 6400 → 3200 долларов.",{"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}," Если один документ индексируется несколько раз (same description, разные SKU), кэшируйте embedding. Deduplicate через MD5 hash. На практике это даёт 12-18% экономию (особенно в fashion\u002Fbeauty — описания товаров часто совпадают).",{"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":309},[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":26},[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-domain-adaptation-trade-off",[1378],{"type":37,"value":1379},"Fine-Tuned Model: Domain Adaptation Trade-off",{"type":32,"tag":33,"props":1381,"children":1382},{},[1383,1385,1391,1393,1399],{"type":37,"value":1384},"Переход с generic модели на domain-specific fine-tuned повышает retrieval@10 на 8-15% (example: в legal domain'е ",{"type":32,"tag":40,"props":1386,"children":1388},{"className":1387},[],[1389],{"type":37,"value":1390},"paraphrase-mpnet-base-v2",{"type":37,"value":1392}," заменить на ",{"type":32,"tag":40,"props":1394,"children":1396},{"className":1395},[],[1397],{"type":37,"value":1398},"legal-bert-base-uncased",{"type":37,"value":1400}," + contrastive learning). Но есть затраты: (1) сбор labeled data (1000-5000 query-document пар), (2) GPU time (A100 8 часов ≈ 60 долларов), (3) полная переиндексация корпуса.",{"type":32,"tag":33,"props":1402,"children":1403},{},[1404],{"type":37,"value":1405},"ROI анализ: если retrieval accuracy вырастет на 10% и это приведёт к +2% конверсии (например, в lead gen правильная статья повышает заполнение формы), то 100K запросов\u002Fмесяц × 0.02 × 50 дол. AOV = 100K дол. lift. Стоимость fine-tuning + переиндексации 10K долларов окупится за месяц.",{"type":32,"tag":33,"props":1407,"children":1408},{},[1409],{"type":37,"value":1410},"Но fine-tuned модель требует maintenance — переобучение каждые 6 месяцев (domain shift). Это ведёт к циклам переиндексации. Альтернатива — adapter layer: поверх base модели добавьте маленький fine-tuned слой. Base embedding'и остаются неизменны, меняется только query-time projection. Re-indexing не нужен, но accuracy gain падает с 15% на 8%.",{"type":32,"tag":57,"props":1412,"children":1414},{"id":1413},"контрпример-когда-переиндексация-не-нужна",[1415],{"type":37,"value":1416},"Контрпример: Когда Переиндексация Не Нужна",{"type":32,"tag":33,"props":1418,"children":1419},{},[1420],{"type":37,"value":1421},"Иногда переиндексация — не самое правильное решение. Если (1) смена модели minor (recall разница \u003C%2), (2) корпус статичный (новых документов не добавляется), (3) query pattern не меняется — drift минимален.",{"type":32,"tag":33,"props":1423,"children":1424},{},[1425],{"type":37,"value":1426},"В B2B SaaS (internal knowledge base, документация) корпус обновляется 1-2 раза в год. Здесь major upgrade (BERT → MPNet) — исключение, переиндексация неоправдана. Используйте ensemble — retrieval обеими моделями, результаты мержьте через reciprocal rank fusion. +3-5% latency, но дешевле переиндексации.",{"type":32,"tag":33,"props":1428,"children":1429},{},[1430],{"type":37,"value":1431},"Decision tree:",{"type":32,"tag":1433,"props":1434,"children":1435},"ul",{},[1436,1441,1446,1451,1456],{"type":32,"tag":937,"props":1437,"children":1438},{},[1439],{"type":37,"value":1440},"Корпус >5M документов + новая модель даёт +5% accuracy → incremental re-index с hot\u002Fcold",{"type":32,"tag":937,"props":1442,"children":1443},{},[1444],{"type":37,"value":1445},"Корпус \u003C1M + +10% accuracy → blue-green full re-index",{"type":32,"tag":937,"props":1447,"children":1448},{},[1449],{"type":37,"value":1450},"Корпус \u003C1M + \u003C%5 accuracy → ensemble + отложить переиндексацию",{"type":32,"tag":937,"props":1452,"children":1453},{},[1454],{"type":37,"value":1455},"Fine-tuned модель + conversion impact >10× затрат → переиндексировать",{"type":32,"tag":937,"props":1457,"children":1458},{},[1459],{"type":37,"value":1460},"Fine-tuned модель + conversion impact \u003C3× затрат → adapter layer или отказаться",{"type":32,"tag":33,"props":1462,"children":1463},{},[1464,1466,1473],{"type":37,"value":1465},"В ",{"type":32,"tag":798,"props":1467,"children":1470},{"href":1468,"rel":1469},"https:\u002F\u002Fwww.roibase.com.tr\u002Fru\u002Fgeo",[802],[1471],{"type":37,"value":1472},"GEO работах Roibase",{"type":37,"value":1474}," аналогичный вопрос — какой контент переделывать при оптимизации LLM citation, какой достаточен в текущем виде? Тоже требует cost-impact анализа.",{"type":32,"tag":57,"props":1476,"children":1478},{"id":1477},"профилактика-drift-version-pinning-и-contract-testing",[1479],{"type":37,"value":1480},"Профилактика Drift: Version Pinning и Contract Testing",{"type":32,"tag":33,"props":1482,"children":1483},{},[1484,1486,1491],{"type":37,"value":1485},"Лучший способ избежать drift в production — pin'ить версию модели и писать contract test'ы. Если используете OpenAI ",{"type":32,"tag":40,"props":1487,"children":1489},{"className":1488},[],[1490],{"type":37,"value":45},{"type":37,"value":1492},", зафиксируйте model ID в config, отключите auto-upgrade. При выходе новой версии тестируйте вручную.",{"type":32,"tag":33,"props":1494,"children":1495},{},[1496],{"type":37,"value":1497},"Пример contract test'а:",{"type":32,"tag":124,"props":1499,"children":1501},{"className":378,"code":1500,"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 модель)\n    baseline = [embed(doc, model=\"text-embedding-3-large\") for doc in test_docs]\n    \n    # сравняем с новой моделью\n    candidate = [embed(doc, model=\"text-embedding-4\") for doc in test_docs]\n    \n    # проверим cosine similarity\n    for i, doc in enumerate(test_docs):\n",[1502],{"type":32,"tag":40,"props":1503,"children":1504},{"__ignoreMap":16},[1505,1522,1539,1551,1563,1571,1579,1586,1594,1649,1656,1664,1713,1720,1728],{"type":32,"tag":134,"props":1506,"children":1507},{"class":136,"line":137},[1508,1512,1517],{"type":32,"tag":134,"props":1509,"children":1510},{"style":141},[1511],{"type":37,"value":392},{"type":32,"tag":134,"props":1513,"children":1514},{"style":152},[1515],{"type":37,"value":1516}," test_embedding_compatibility",{"type":32,"tag":134,"props":1518,"children":1519},{"style":158},[1520],{"type":37,"value":1521},"():\n",{"type":32,"tag":134,"props":1523,"children":1524},{"class":136,"line":164},[1525,1530,1534],{"type":32,"tag":134,"props":1526,"children":1527},{"style":158},[1528],{"type":37,"value":1529},"    test_docs ",{"type":32,"tag":134,"props":1531,"children":1532},{"style":141},[1533],{"type":37,"value":455},{"type":32,"tag":134,"props":1535,"children":1536},{"style":158},[1537],{"type":37,"value":1538}," [\n",{"type":32,"tag":134,"props":1540,"children":1541},{"class":136,"line":183},[1542,1547],{"type":32,"tag":134,"props":1543,"children":1544},{"style":221},[1545],{"type":37,"value":1546},"        \"machine learning model training\"",{"type":32,"tag":134,"props":1548,"children":1549},{"style":158},[1550],{"type":37,"value":180},{"type":32,"tag":134,"props":1552,"children":1553},{"class":136,"line":242},[1554,1559],{"type":32,"tag":134,"props":1555,"children":1556},{"style":221},[1557],{"type":37,"value":1558},"        \"vector database indexing\"",{"type":32,"tag":134,"props":1560,"children":1561},{"style":158},[1562],{"type":37,"value":180},{"type":32,"tag":134,"props":1564,"children":1565},{"class":136,"line":260},[1566],{"type":32,"tag":134,"props":1567,"children":1568},{"style":221},[1569],{"type":37,"value":1570},"        \"semantic search optimization\"\n",{"type":32,"tag":134,"props":1572,"children":1573},{"class":136,"line":278},[1574],{"type":32,"tag":134,"props":1575,"children":1576},{"style":158},[1577],{"type":37,"value":1578},"    ]\n",{"type":32,"tag":134,"props":1580,"children":1581},{"class":136,"line":295},[1582],{"type":32,"tag":134,"props":1583,"children":1584},{"style":158},[1585],{"type":37,"value":468},{"type":32,"tag":134,"props":1587,"children":1588},{"class":136,"line":309},[1589],{"type":32,"tag":134,"props":1590,"children":1591},{"style":474},[1592],{"type":37,"value":1593},"    # baseline embedding (production модель)\n",{"type":32,"tag":134,"props":1595,"children":1596},{"class":136,"line":26},[1597,1602,1606,1611,1615,1619,1624,1629,1634,1639,1644],{"type":32,"tag":134,"props":1598,"children":1599},{"style":158},[1600],{"type":37,"value":1601},"    baseline ",{"type":32,"tag":134,"props":1603,"children":1604},{"style":141},[1605],{"type":37,"value":455},{"type":32,"tag":134,"props":1607,"children":1608},{"style":158},[1609],{"type":37,"value":1610}," [embed(doc, ",{"type":32,"tag":134,"props":1612,"children":1613},{"style":500},[1614],{"type":37,"value":1210},{"type":32,"tag":134,"props":1616,"children":1617},{"style":141},[1618],{"type":37,"value":455},{"type":32,"tag":134,"props":1620,"children":1621},{"style":221},[1622],{"type":37,"value":1623},"\"text-embedding-3-large\"",{"type":32,"tag":134,"props":1625,"children":1626},{"style":158},[1627],{"type":37,"value":1628},") ",{"type":32,"tag":134,"props":1630,"children":1631},{"style":141},[1632],{"type":37,"value":1633},"for",{"type":32,"tag":134,"props":1635,"children":1636},{"style":158},[1637],{"type":37,"value":1638}," doc ",{"type":32,"tag":134,"props":1640,"children":1641},{"style":141},[1642],{"type":37,"value":1643},"in",{"type":32,"tag":134,"props":1645,"children":1646},{"style":158},[1647],{"type":37,"value":1648}," test_docs]\n",{"type":32,"tag":134,"props":1650,"children":1651},{"class":136,"line":327},[1652],{"type":32,"tag":134,"props":1653,"children":1654},{"style":158},[1655],{"type":37,"value":468},{"type":32,"tag":134,"props":1657,"children":1658},{"class":136,"line":350},[1659],{"type":32,"tag":134,"props":1660,"children":1661},{"style":474},[1662],{"type":37,"value":1663},"    # сравняем с новой моделью\n",{"type":32,"tag":134,"props":1665,"children":1666},{"class":136,"line":595},[1667,1672,1676,1680,1684,1688,1693,1697,1701,1705,1709],{"type":32,"tag":134,"props":1668,"children":1669},{"style":158},[1670],{"type":37,"value":1671},"    candidate ",{"type":32,"tag":134,"props":1673,"children":1674},{"style":141},[1675],{"type":37,"value":455},{"type":32,"tag":134,"props":1677,"children":1678},{"style":158},[1679],{"type":37,"value":1610},{"type":32,"tag":134,"props":1681,"children":1682},{"style":500},[1683],{"type":37,"value":1210},{"type":32,"tag":134,"props":1685,"children":1686},{"style":141},[1687],{"type":37,"value":455},{"type":32,"tag":134,"props":1689,"children":1690},{"style":221},[1691],{"type":37,"value":1692},"\"text-embedding-4\"",{"type":32,"tag":134,"props":1694,"children":1695},{"style":158},[1696],{"type":37,"value":1628},{"type":32,"tag":134,"props":1698,"children":1699},{"style":141},[1700],{"type":37,"value":1633},{"type":32,"tag":134,"props":1702,"children":1703},{"style":158},[1704],{"type":37,"value":1638},{"type":32,"tag":134,"props":1706,"children":1707},{"style":141},[1708],{"type":37,"value":1643},{"type":32,"tag":134,"props":1710,"children":1711},{"style":158},[1712],{"type":37,"value":1648},{"type":32,"tag":134,"props":1714,"children":1715},{"class":136,"line":624},[1716],{"type":32,"tag":134,"props":1717,"children":1718},{"style":158},[1719],{"type":37,"value":468},{"type":32,"tag":134,"props":1721,"children":1722},{"class":136,"line":638},[1723],{"type":32,"tag":134,"props":1724,"children":1725},{"style":474},[1726],{"type":37,"value":1727},"    # проверим cosine similarity\n",{"type":32,"tag":134,"props":1729,"children":1730},{"class":136,"line":646},[1731,1736,1741,1745,1750],{"type":32,"tag":134,"props":1732,"children":1733},{"style":141},[1734],{"type":37,"value":1735},"    for",{"type":32,"tag":134,"props":1737,"children":1738},{"style":158},[1739],{"type":37,"value":1740}," i, doc ",{"type":32,"tag":134,"props":1742,"children":1743},{"style":141},[1744],{"type":37,"value":1643},{"type":32,"tag":134,"props":1746,"children":1747},{"style":405},[1748],{"type":37,"value":1749}," enumerate",{"type":32,"tag":134,"props":1751,"children":1752},{"style":158},[1753],{"type":37,"value":1754},"(test_docs):\n",{"type":32,"tag":1756,"props":1757,"children":1758},"style",{},[1759],{"type":37,"value":1760},"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":1762},[1763,1766,1769,1772,1773,1774],{"id":59,"depth":164,"text":62,"children":1764},[1765],{"id":81,"depth":183,"text":84},{"id":104,"depth":164,"text":107,"children":1767},[1768],{"id":810,"depth":183,"text":813},{"id":918,"depth":164,"text":921,"children":1770},[1771],{"id":1021,"depth":183,"text":1024},{"id":1376,"depth":164,"text":1379},{"id":1413,"depth":164,"text":1416},{"id":1477,"depth":164,"text":1480},"markdown","content:ru:ai:embedding-drift-vector-db-production.md","content","ru\u002Fai\u002Fembedding-drift-vector-db-production.md","ru\u002Fai\u002Fembedding-drift-vector-db-production","md",1779314640799]