Skip to content

v1.21.0 — Latency campaign, semantic-layer governance, ReAct turn isolation (ADR-090/091)

Choose a tag to compare

@jgouviergmail jgouviergmail released this 02 Jul 15:47

v1.21.0 — Latency campaign, semantic-layer governance, ReAct turn isolation

Architecture decisions: ADR-090 — Semantic Layer Governance · ADR-091 — Response-Context Prefetch

⚡ Latency campaign (ADR-091)

  • Response-context prefetch: the response node's user-context injections (embedding, memory, user/system RAG, journal, portrait, psyche) are prefetched from the initiative node, overlapping its ~12s LLM evaluation in BOTH pipeline and ReAct modes — identical inline fallback on any miss. ~0.5–2s off every enriched turn.
  • Rich-HTML CSS externalized: the LLM no longer emits a ~550-token inline <style> block per rich reply (~3–4s of streaming saved) — the .lia-response rules ship once in the app stylesheet.
  • LLM instance cache: client instances reused across calls (httpx pool keep-alive, no TCP/TLS handshake per call), invalidated on API-key/capabilities reloads.
  • Reasoning-stream negative cache: kills the silent SECOND full LLM call per turn on buffered structured-output paths (observed on query_analyzer: +1.3–2.5s TTFT, double cost).
  • Non-blocking contacts warmup · RAG query-embedding cache + single-flight · reducer tiktoken memoization · frontend SSE token batching (per animation frame, order-preserving).

🧠 Semantic layer governance (ADR-090)

  • Type↔tool links = ontology ∪ live manifest annotations (rename-proof, covers MCP tools), shared by the planner, the initiative and the ReAct prompt.
  • 12 phantom tool names fixed (~50% of used_in_tools, v3.2 rename drift) — dead initiative bridges resurrected (contact → places/weather/route).
  • 5 test-enforced integrity locks make naming drift impossible by construction.
  • Initiative <SemanticBridges>: pre-computed connection candidates so smaller models can act on cross-domain opportunities without frontier-grade inference.

🛠️ ReAct fixes (field bugs)

  • Cross-turn data leak: the previous turn's results (e.g. "my next 4 events") no longer re-appear inside the next answer — per-turn registry purge + passthrough fix.
  • Exact values over approximations: PRECISION rule + cross-domain type map in the ReAct prompt — routes now use the contact's exact address, not a city recalled from memory.

🎁 Also

  • Skill badge on assistant messages now visible to all users (was debug-panel-only).
  • Shared Redis rate limiter singleton + NOSCRIPT retry (ends the permanent fail-open after a Redis restart).
  • Reliability batch: GC-safe fire-and-forget (5 call-sites), response-language fallback, timezone centralization, .env parsing crash, FOR_EACH unbound-variable guard.

📊 Quality

Ruff / Black / MyPy strict clean · 8469 backend unit tests green (+~60 new) · verified live in the running container · FAQ changelog + technical FAQ refreshed in 6 locales · no schema change, no migration · 4 new optional env vars.