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:
Lars committed 2026-01-12 07:45:54 +01:00
1 parent b19f91c3ee
commit 742792770c
18 files changed
+1110 -119

No files matched your search

+22 -10
View File
@@ -353,14 +353,26 @@ class DecisionEngine:
return result
except (ValueError, KeyError) as template_error:
# Fallback auf direkten Prompt, falls Template nicht existiert
logger.warning(f"⚠️ [FALLBACK] Template 'fallback_synthesis' nicht gefunden: {template_error}. Verwende direkten Prompt.")
logger.debug(f" -> Direkter Prompt mit Context-Länge: {len(fallback_context)}")
# WP-24c v4.5.9: Fallback auf generisches Template mit variables
# Nutzt Lazy-Loading aus WP-25b für modell-spezifische Fallback-Prompts
logger.warning(f"⚠️ [FALLBACK] Template 'fallback_synthesis' nicht gefunden: {template_error}. Versuche generisches Template.")
logger.debug(f" -> Fallback-Profile: {profile}, Context-Länge: {len(fallback_context)}")
result = await self.llm_service.generate_raw_response(
prompt=f"Beantworte: {query}\n\nKontext:\n{fallback_context}",
system=system_prompt, priority="realtime", profile_name=profile
)
logger.info(f"✅ [FALLBACK] Direkter Prompt erfolgreich (Antwort-Länge: {len(result) if result else 0})")
return result
try:
# WP-24c v4.5.9: Versuche generisches Template mit variables (Lazy-Loading)
result = await self.llm_service.generate_raw_response(
prompt_key="fallback_synthesis_generic", # Fallback-Template
variables={"query": query, "context": fallback_context},
system=system_prompt, priority="realtime", profile_name=profile
)
logger.info(f"✅ [FALLBACK] Generisches Template erfolgreich (Antwort-Länge: {len(result) if result else 0})")
return result
except (ValueError, KeyError) as fallback_error:
# WP-24c v4.5.9: Letzter Fallback - direkter Prompt (nur wenn beide Templates fehlen)
logger.error(f"❌ [FALLBACK] Auch generisches Template nicht gefunden: {fallback_error}. Verwende direkten Prompt als letzten Fallback.")
result = await self.llm_service.generate_raw_response(
prompt=f"Beantworte: {query}\n\nKontext:\n{fallback_context}",
system=system_prompt, priority="realtime", profile_name=profile
)
logger.info(f"✅ [FALLBACK] Direkter Prompt erfolgreich (Antwort-Länge: {len(result) if result else 0})")
return result