Implement Phase 3 Agentic Edge Validation in ingestion_processor.py and related documentation updates
Introduce a new method for persisting rejected edges for audit purposes, enhancing traceability and validation logic. Update the decision engine to utilize a generic fallback template for improved error handling during LLM validation. Revise documentation across multiple files to reflect the new versioning, context, and features related to Phase 3 validation, including automatic mirror edges and note-scope zones. This update ensures better graph integrity and validation accuracy in the ingestion process.
This commit is contained in:
1 parent
b19f91c3ee
commit
742792770c
18 files changed
+1110
-119
No files matched your search
@@ -1,7 +1,8 @@
|
||||
# LLM-Validierung von Links in Notizen
|
||||
# LLM-Validierung von Links in Notizen (Phase 3 Agentic Edge Validation)
|
||||
|
||||
**Version:** v4.1.0
|
||||
**Status:** Aktiv
|
||||
**Version:** v4.5.8
|
||||
**Status:** Aktiv
|
||||
**Aktualisiert:** WP-24c Phase 3 Agentic Edge Validation mit Kontext-Optimierung
|
||||
|
||||
## Übersicht
|
||||
|
||||
@@ -34,9 +35,9 @@ Diese Links werden **sofort** in den Graph übernommen, ohne LLM-Validierung:
|
||||
|
||||
**Hinweis:** Explizite Links haben immer Vorrang und werden nicht validiert.
|
||||
|
||||
## Global Pool Links (mit LLM-Validierung)
|
||||
## Validierte Links (Phase 3 - candidate: Präfix) - WP-24c v4.5.8
|
||||
|
||||
Links, die vom LLM validiert werden sollen, müssen in einer speziellen Sektion am Ende der Notiz definiert werden.
|
||||
Links, die vom LLM validiert werden sollen, müssen in einer speziellen Sektion am Ende der Notiz definiert werden. Diese Links erhalten das `candidate:` Präfix und durchlaufen **Phase 3 Agentic Edge Validation**.
|
||||
|
||||
### Format
|
||||
|
||||
@@ -105,16 +106,19 @@ types:
|
||||
enable_smart_edge_allocation: true # ← Aktiviert LLM-Validierung
|
||||
```
|
||||
|
||||
### Validierungsprozess
|
||||
### Phase 3 Validierungsprozess (WP-24c v4.5.8)
|
||||
|
||||
1. **Extraktion:** Links aus der "Unzugeordnete Kanten" Sektion werden extrahiert
|
||||
2. **Provenance:** Erhalten `provenance: "global_pool"`
|
||||
3. **Validierung:** Für jeden Link wird geprüft:
|
||||
- Ist der Link semantisch relevant für den Chunk-Kontext?
|
||||
2. **candidate: Präfix:** Erhalten `candidate:` Präfix in `rule_id` oder `provenance`
|
||||
3. **Kontext-Optimierung:**
|
||||
- **Note-Scope (`scope: note`):** LLM nutzt `note_summary` (Top 5 Chunks) oder `note_text` (aggregierter Gesamttext)
|
||||
- **Chunk-Scope (`scope: chunk`):** LLM nutzt spezifischen Chunk-Text, falls verfügbar, sonst Note-Text
|
||||
4. **Validierung:** LLM prüft semantisch (via `ingest_validator` Profil, Temperature 0.0):
|
||||
- Ist der Link semantisch relevant für den Kontext?
|
||||
- Passt die Relation (`kind`) zum Ziel?
|
||||
4. **Ergebnis:**
|
||||
- ✅ **YES** → Link wird in den Graph übernommen
|
||||
- ❌ **NO** → Link wird verworfen
|
||||
5. **Ergebnis:**
|
||||
- ✅ **VERIFIED:** `candidate:` Präfix wird entfernt, Kante wird in den Graph übernommen
|
||||
- 🚫 **REJECTED:** Kante wird **nicht** in die Datenbank geschrieben (verhindert "Geister-Verknüpfungen")
|
||||
|
||||
### Validierungs-Prompt
|
||||
|
||||
@@ -201,29 +205,36 @@ related_to:Ziel-Notiz
|
||||
python3 -m scripts.import_markdown --vault ./vault --apply
|
||||
```
|
||||
|
||||
## Logging & Debugging
|
||||
## Logging & Debugging (Phase 3)
|
||||
|
||||
Während der Ingestion sehen Sie im Log:
|
||||
|
||||
```
|
||||
🚀 [PHASE 3] Validierung: Note-A -> Ziel-Notiz (related_to) | Scope: chunk | Kontext: Chunk-Scope (c00)
|
||||
⚖️ [VALIDATING] Relation 'related_to' -> 'Ziel-Notiz' (Profile: ingest_validator)...
|
||||
✅ [VALIDATED] Relation to 'Ziel-Notiz' confirmed.
|
||||
✅ [PHASE 3] VERIFIED: Note-A -> Ziel-Notiz (related_to) | rule_id: explicit
|
||||
```
|
||||
|
||||
oder
|
||||
|
||||
```
|
||||
🚫 [REJECTED] Relation to 'Ziel-Notiz' irrelevant for this chunk.
|
||||
🚀 [PHASE 3] Validierung: Note-A -> Ziel-Notiz (related_to) | Scope: note | Kontext: Note-Scope (aggregiert)
|
||||
⚖️ [VALIDATING] Relation 'related_to' -> 'Ziel-Notiz' (Profile: ingest_validator)...
|
||||
🚫 [PHASE 3] REJECTED: Note-A -> Ziel-Notiz (related_to)
|
||||
```
|
||||
|
||||
**Hinweis:** Phase 3 Logs zeigen auch die Kontext-Optimierung (Note-Scope vs. Chunk-Scope) und den finalen Status (VERIFIED/REJECTED).
|
||||
|
||||
## Technische Details
|
||||
|
||||
### Provenance-System
|
||||
### Provenance-System (WP-24c v4.5.8)
|
||||
|
||||
- `explicit`: Explizite Links (keine Validierung)
|
||||
- `global_pool`: Global Pool Links (mit Validierung)
|
||||
- `explicit`: Explizite Links (keine Validierung, höchste Priorität)
|
||||
- `explicit:note_zone`: Note-Scope Links aus `## Smart Edges` (keine Validierung)
|
||||
- `candidate:`: Links aus `### Unzugeordnete Kanten` (Phase 3 Validierung erforderlich)
|
||||
- `semantic_ai`: KI-generierte Links
|
||||
- `rule`: Regel-basierte Links (z.B. aus types.yaml)
|
||||
- `structure`: System-generierte Spiegelkanten (automatische Invers-Logik)
|
||||
|
||||
### Code-Referenzen
|
||||
|
||||
@@ -240,14 +251,32 @@ A: Nein, explizite Links werden direkt übernommen.
|
||||
A: Ja, nutzen Sie explizite Links (`[[rel:kind|target]]` oder `> [!edge]`).
|
||||
|
||||
**Q: Was passiert, wenn das LLM nicht verfügbar ist?**
|
||||
A: Bei transienten Fehlern (Netzwerk) werden Links erlaubt. Bei permanenten Fehlern werden sie verworfen.
|
||||
A: Das System unterscheidet zwischen:
|
||||
- **Transienten Fehlern (Netzwerk, Timeout):** Kante wird erlaubt (Integrität vor Präzision - verhindert Datenverlust)
|
||||
- **Permanenten Fehlern (Config, Validation):** Kante wird abgelehnt (Graph-Qualität schützen)
|
||||
|
||||
**Q: Was ist der Unterschied zwischen expliziten und validierten Links?**
|
||||
A:
|
||||
- **Explizite Links:** Sofortige Übernahme, höchste Priorität, keine Validierung, `confidence: 1.0`
|
||||
- **Validierte Links:** Phase 3 Prüfung, `candidate:` Präfix, können abgelehnt werden, höhere Graph-Qualität
|
||||
|
||||
**Q: Warum sollte ich explizite Links nutzen statt validierte?**
|
||||
A: Explizite Links haben:
|
||||
- ✅ Sofortige Übernahme (keine Wartezeit)
|
||||
- ✅ Höchste Priorität (werden immer beibehalten)
|
||||
- ✅ Keine Validierungs-Kosten (keine LLM-Aufrufe)
|
||||
- ✅ Höhere Confidence-Werte
|
||||
|
||||
Nutze validierte Links nur, wenn du unsicher bist, ob die Verbindung wirklich passt.
|
||||
|
||||
**Q: Kann ich mehrere Links in einer Zeile angeben?**
|
||||
A: Nein, jeder Link muss in einer eigenen Zeile stehen: `kind:target`.
|
||||
|
||||
## Zusammenfassung
|
||||
## Zusammenfassung (WP-24c v4.5.8)
|
||||
|
||||
- ✅ **Explizite Links:** `[[rel:kind|target]]` oder `> [!edge]` → Keine Validierung
|
||||
- ✅ **Global Pool Links:** Sektion `### Unzugeordnete Kanten` → Mit LLM-Validierung
|
||||
- ✅ **Aktivierung:** `enable_smart_edge_allocation: true` in Chunk-Config
|
||||
- ✅ **Format:** `kind:target` (eine pro Zeile)
|
||||
- ✅ **Explizite Links:** `[[rel:kind|target]]`, `> [!edge]` oder `## Smart Edges` → Keine Validierung, höchste Priorität
|
||||
- ✅ **Validierte Links:** Sektion `### Unzugeordnete Kanten` → Phase 3 Validierung mit `candidate:` Präfix
|
||||
- ✅ **Phase 3 Validierung:** LLM prüft semantisch mit Kontext-Optimierung (Note-Scope vs. Chunk-Scope)
|
||||
- ✅ **Ergebnis:** VERIFIED (Präfix entfernt, persistiert) oder REJECTED (nicht in DB geschrieben)
|
||||
- ✅ **Format:** `kind:target` (eine pro Zeile in `### Unzugeordnete Kanten`)
|
||||
- ✅ **Automatische Spiegelkanten:** Explizite Kanten erzeugen automatisch Invers-Kanten (beide Richtungen durchsuchbar)
|
||||
Reference in new issue
Block a user