<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Infinity on YennJ12 Engineering Blog</title><link>https://yennj12.js.org/yennj12_blog_V4/tags/infinity/</link><description>Recent content in Infinity on YennJ12 Engineering Blog</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Thu, 10 Sep 2026 11:00:00 +0800</lastBuildDate><atom:link href="https://yennj12.js.org/yennj12_blog_V4/tags/infinity/feed.xml" rel="self" type="application/rss+xml"/><item><title>RAGFlow Intro Part 3 — Encode 與 Save — 向量化、索引 Schema 與雙引擎抽象</title><link>https://yennj12.js.org/yennj12_blog_V4/posts/ragflow-intro-part3-embedding-indexing-zh/</link><pubDate>Thu, 10 Sep 2026 11:00:00 +0800</pubDate><guid>https://yennj12.js.org/yennj12_blog_V4/posts/ragflow-intro-part3-embedding-indexing-zh/</guid><description>大多數人處理 RAG 的儲存，是 collection.add(documents=chunks, embeddings=vecs)，然後就不再想這件事。 真正的答案是：索引的 schema 決定了你三個月後能做什麼查詢；相似度函式決定了你的關鍵字檢索是有效還是裝飾；欄位命名決定了你換 embedding 模型要不要重建整個索引。 這些決定在寫入的那一刻就凍結了。 這篇文章拆的是 RAGFlow 在那一刻做的每一個選擇。
前言 Part 2 結束時，我們手上有一組 chunk：純文字、可能帶版面座標、可能帶人工或 LLM 產生的關鍵字與問句。
本篇處理接下來兩步：
chunks ──▶ ① Encode（向量化） ──▶ ② Save（寫進 doc engine + 物件儲存） rag/svr/task_executor.py conf/mapping.json rag/llm/embedding_model.py rag/utils/*_conn.py 這兩步看起來機械，實際上藏了 RAGFlow 最有辨識度的幾個設計。我們從最反直覺的一個開始。
一、Encode：為什麼向量是「檔名 × 0.1 + 內容 × 0.9」 task_executor.py 的 embedding() 函式，核心只有幾行：
1async def embedding(docs, mdl, parser_config=None, callback=None): 2 tts, cnts = [], [] 3 for d in docs: 4 tts.</description></item></channel></rss>