İçeriğe geç

Veri değişince

bir kere (ingest)her sorudaYükleTemizleChunk'laEmbedVector DBSoruEmbedAraRerankPromptCevap
7 yıllık bir çalışanın yıllık izni kaç iş günü?
İngilizce, logların yazdığı gibi: “How many working days of annual leave does an employee with 7 years of service get?”
→ “An employee with 7 years of service gets 24 working days of annual leave [1].” ✓ (2026)
chroma store · chunker section · rerank on · filter edition 2026, access all

İK, izin politikasının 2026 sürümünü yayınladı. Günün sorusunun cevabı değişti. Bilgiyi ağırlıklarına yazmış bir model için bu yeniden eğitim demek. Bizim pipeline’da ne demek?

Chroma · kraken-policies2025 · 60 kayıthr-leave@2025#3 · | 7 | 22 |2026 · 60 kayıthr-leave@2026#3 · | 7 | 24 |✗edition = en yeni2026An employee with 7 years of service gets24 working days of annual leave [1].[1] = hr-leave@2026#3filtre yoksa: 2026#3 (0.619) ve 2025#3 (0.614)prompt’ta 24 ve 22 iş günü
  1. Yeni sürüm geldi

    corpus/2026/: aynı 8 doküman, edition: "2026". İzin tablosunda 5–9. yıllar 22’den 24 iş gününe, 10–14. yıllar 25’ten 26’ya çıktı.

  2. Yeniden eğitim yok, yeniden ingest var

    Ingest yalnızca yeni dosyaları 1-load.ts ile 5-store.ts arasındaki beş adımdan geçirir. Depoda artık 120 kayıt var: 2025’in 60’ı ve 2026’nın 60’ı yan yana.

    npm run ingest -- --edition 2026: log’un sonlarına doğru 120 in the store yazmalı.
  3. Hangi sürüm cevap verecek?

    6-retrieve.ts içindeki metadata filtresi (EDITION_FILTER) varsayılan olarak “latest”: depodaki en yeni sürüm. Filtre aramanın içinde; 2025 kayıtları yarışa hiç girmiyor.

  4. Cevap değişti

    Cevap: “An employee with 7 years of service gets 24 working days of annual leave [1].” Kaynak artık hr-leave@2026#3.

    npm run question: kaynak hangi sürümden?
    Bruno’da 01-chroma → önce collections, sonra count: 120.
  5. Filtre olmasa?

    EDITION_FILTER = "all" olunca iki sürüm yarışıyor: 2026 0.619, 2025 0.614 aldı. İki tablo da prompt’a giriyor; prompt’ta hem 24 hem 22 var. İki işaret de “Annual Leave Policy” diyor. Hangisinin yeni olduğunu hiçbir şey söylemiyor. Model 24 dedi, SOURCE 1’den.

    src/steps/6-retrieve.ts içinde sürüm filtresini "all" yapın ve npm run question: kaynaklarda iki sürüm yan yana mı? Sonra filtreyi yine “latest” yapın.
  6. Silmek mi, filtrelemek mi?

    Eski sürüm geçmişe dönük sorulara ve denetime yarar. Bedeli: filtre her aramada doğru olmalı. replaceEdition yalnızca kendi sürümünü yeniler. 2025’i silmek için ayrı bir silme adımı gerekir; repoda bunun komutu yok.

    npm run ask -- "After how many days must I change my password?": cevap hangi sürümden geldi?

3-chunk.ts çıktısında izin tablosunun 2026 hâline, 5-store.ts çıktısında kayıt sayısına ve sürümlere bakın.

npm run ingest -- --edition 2026 (adım 3'ün çıktısı)
the chunk holding "| 7 |" → hr-leave@2026#3 (sections 3)
│ [Annual Leave Policy › 3. Annual Paid Leave]
│ Part-time staff get the same number as full-time staff. The HR portal shows the balance for each person. Questions go to the unit's HR business partner.
│
│ | Years of service (full years) | Annual paid leave (working days) |
│ |---|---|
│ | 1 | 16 |
│ | 2 | 16 |
│ | 3 | 18 |
│ | 4 | 18 |
│ | 5 | 24 |
│ | 6 | 24 |
│ | 7 | 24 |
│ | 8 | 24 |
│ | 9 | 24 |
│ | 10 | 26 |
│ | 11 | 26 |
│ | 12 | 26 |
│ | 13 | 26 |
│ | 14 | 26 |
│ | 15 or more | 28 |
… aynı komut, adım 4 ve 5
━━ STEP 4/8 · EMBED
IN data/3-chunks.json (60 chunks)
WHAT send each chunk's text to bge-m3 (Ollama /api/embed, 24 per call)
OUT 60 vectors · 1024 numbers each · 0 computed, 60 from cache
announcement-meal-card@2026#1 → [-0.0356, 0.0001, -0.0278, -0.0149, -0.0330, -0.0674, … ]
length (norm) of that vector: 1.000
TIME 49 ms → data/4-vectors.json
━━ STEP 5/8 · STORE
IN data/4-vectors.json (60 vectors, edition 2026)
WHAT replace edition 2026 in Chroma collection "kraken-policies" (HNSW index, cosine)
OUT 60 records added · 120 in the store · editions: 2025, 2026
the day's question, top-5 ids:
JSON (brute force) hr-leave@2026#3 hr-leave@2026#2 hr-leave@2026#7 hr-leave@2026#6 hr-leave@2026#4
chroma hr-leave@2026#3 hr-leave@2026#2 hr-leave@2026#7 hr-leave@2026#6 hr-leave@2026#4
identical ✓ — the database changes the scale, not the ranking
TIME 197 ms → data/5-store.json
Ingest done (edition 2026). Now: npm run question

4-embed.ts burada hiçbir vektörü yeniden hesaplamadı: bu makine bu metinleri daha önce embed etmişti, vektörler .cache/ klasöründen geldi. Sizin ilk çalıştırmanızda 3 computed, 57 from cache görürsünüz. Metni değişen yalnızca 3 chunk var: izin tablosu, şifre kuralı ve seyahat tablosu.

npm run question
$ npm run question
━━ QUESTION OF THE DAY How many working days of annual leave does an employee with 7 years of service get?
HOW chroma store · chunker section · rerank on · filter {"edition":"2026","access":["all"]}
An employee with 7 years of service gets 24 working days of annual leave [1].
[1] hr-leave@2026#3 Annual Leave Policy › §3
[2] hr-leave@2026#7 Annual Leave Policy › §7
[3] hr-leave@2026#4 Annual Leave Policy › §4
LEDGER (.cache/question-ledger.jsonl)
12:52 Typically, an employee with 7 years of servic… bare model, no documents
12:52 An employee with 7 years of service gets at m… chunker fixed · in-memory search (black box) · rerank on · filter {"e…
12:53 An employee with 7 years of service gets 22 w… chunker section · in-memory search (black box) · rerank on · filter {…
12:53 An employee with 7 years of service gets 22 w… chroma store · chunker section · rerank on · filter {"edition":"2025"…
12:57 An employee with 7 years of service gets 24 w… chroma store · chunker section · rerank on · filter {"edition":"2026"…

Filtreyi kapatınca ikisi birden geliyor:

npm run question (toggle: sürüm filtresi EDITION_FILTER = "all")
$ npm run question (EDITION_FILTER = "all")
filter {"access":["all"]}
1 0.619 hr-leave@2026#3 Annual Leave Policy › §3 Part-time staff get the same number as …
2 0.614 hr-leave@2025#3 Annual Leave Policy › §3 Part-time staff get the same number as …
3 0.604 hr-leave@2025#2 Annual Leave Policy › §2 One full year of work, counted from the…
4 0.604 hr-leave@2026#2 Annual Leave Policy › §2 One full year of work, counted from the…
5 0.602 hr-leave@2025#7 Annual Leave Policy › §7 Some unused leave can move to the next …
─ ─ ─ cut: k = 5 ─ ─ ─
6 0.602 hr-leave@2026#7 Annual Leave Policy › §7 Some unused leave can move to the next …
7 0.598 hr-leave@2025#6 Annual Leave Policy › §6 Unpaid leave is for serious personal re…
8 0.598 hr-leave@2026#6 Annual Leave Policy › §6 Unpaid leave is for serious personal re…
With 7 years of service, an employee gets 24 working days of annual leave [1].
[1] hr-leave@2026#3 Annual Leave Policy › §3
[2] hr-leave@2025#3 Annual Leave Policy › §3
[3] hr-leave@2025#7 Annual Leave Policy › §7

Sürüm filtresi 6-retrieve.ts içindeki toggle’da. .env dosyasındaki EDITION ise başka bir şey: 1-load.ts dosyasının hangi corpus/ klasörünü okuyacağını seçer.

src/steps/6-retrieve.ts
// TOGGLE edition filter
const EDITION_FILTER: "latest" | "all" = "latest"; // default — only the newest edition in the store may answer
// const EDITION_FILTER: "latest" | "all" = "all"; // alternative — every edition competes, old ones included

“latest” kodda: retrieve() içinde (await o.store.editions()).at(-1).

1 · Yeni sürümü ekleyin. npm run ingest -- --edition 2026. Log’un sonlarına doğru: 120 in the store · editions: 2025, 2026 (Türkçe gizlilik kuralını yazdıysanız 118).

2 · Günün sorusu. npm run question → 24 iş günü, kaynak hr-leave@2026#3.

3 · Bruno ile bakın. 01-chroma → önce collections, sonra count: 120. count, koleksiyonun id’sini collections isteğinden alır; catchup ya da sıfırlama sonrası bu id değişir. filter on metadata içinde "edition": "2026" yazıp gönderin.

4 · Filtreyi kapatın. src/steps/6-retrieve.ts → TOGGLE edition filter bloğunda "all"; // alternative satırını açın, varsayılanı kapatın. npm run question: kaynaklarda iki sürüm yan yana mı? Toggle’ı geri alın.

5 · Başka bir değişiklik. 2026’da bilgi güvenliği politikasında şifre değiştirme süresi de değişti. npm run ask -- "After how many days must I change my password?": cevap hangi sürümden geldi? Soru İngilizce; kaynak ve cevap hangi dilde? Cevabı aşağıdaki sık sorulanlarda.

Geride kaldıysanız: npm run catchup -- 8, ardından npm run ingest -- --edition 2026.

Her değişiklikte bütün korpusu yeniden mi işleyeceğiz?

Hayır: ingest yalnızca verilen sürümü işler, değişmeyen metinler önbellekten gelir. Gerçek sistemlerde daha ince bir yol var: yalnızca değişen dokümanın chunk’larını silip yeniden yazmak; bunu bu repoda ölçmedik (Performans ve maliyet).

Sürüm numarası olmayan dokümanlar için?

Aynı fikir başka bir alanla çalışır: docId ve bir güncelleme tarihi. Doküman değişince o docId’nin kayıtları silinir ve yenileri yazılır; arama her zaman en güncel kaydı görür.

Fine-tune edilmiş bir modelde bu ne demek olurdu?

Yeni veriyle yeniden eğitim, yeniden değerlendirme, yeniden dağıtım; eski sayıyı modele unutturmak da ayrı bir iş. Burada bir klasör ekleyip bir komut çalıştırdık (RAG mı fine-tune mı?).

Kullanıcı 2025'teki hakkını sorarsa?

“latest” filtresiyle 2025’teki sayı prompt’a hiç gelmez. Sorudaki yılı okuyup filtreye koymak (soru analizi) mümkün ama bu repoda yok; eski sürümü tutmanın faydası ancak böyle bir yolla ortaya çıkar.

İngilizce şifre sorusuna neden Türkçe cevap geliyor?

Soru İngilizce, politika Türkçe. Arama yine de doğru bölümü ilk sıraya koydu (0.665); rerank 10 verdi. bge-m3 iki dili aynı uzayda tutuyor. Cevap: Şifreler 180 günde bir değiştirilmelidir [1]. Model kaynağın dilinde cevap veriyor. Kaynak it-security@2026#2; yani 180, 2026 kuralı.

Model değişmedi; dokümanlar değişti, cevap onları izledi.