Commit graph

3 commits

Author SHA1 Message Date
Zaious
0d8a6437a0 fix: minimize runtime intervention by scoping query capture to retriever
Replace over-broad on_chain_start with on_retriever_start to capture
the query embedding as late and as safely as possible in the RetrievalQA
flow, minimizing framework footprint.

Addresses maintainer review feedback for minimal & safe implementation.
2026-03-11 11:45:49 +08:00
Zaious
b53de5acd2 fix: capture query embedding before retriever callback and guard empty source_nodes
LangChain: Add on_chain_start to capture query embedding before
on_retriever_end fires in RetrievalQA flow. on_llm_start retained
as fallback for non-chain invocations.

LlamaIndex: Double guard on source_nodes — check both attribute
existence AND non-empty list before computing average ΔS, preventing
ZeroDivisionError on responses without retrieved nodes.

Addresses Codex automated review feedback
2026-03-10 09:14:53 +08:00
Zaious
cf78311a25 feat: Introduce LangChain and LlamaIndex Semantic Firewall adapters 2026-03-10 04:30:30 +08:00