v0.2.0 — M2: Citation Engine, Anonymization Layer, Azure OpenAI
The M2 release of LQ.AI. Three flagship capabilities ship in this version: a four-stage Citation Engine that verifies every model-emitted citation against its source document before rendering; an Anonymization Layer that pseudonymizes sensitive entities in the Inference Gateway before requests leave for the model provider; and an Azure OpenAI provider adapter that unblocks Azure-tenant enterprise deployments.
Highlights
Citation Engine — 4-stage cascade
A model-emitted "<quote>" (Source: [N]) runs through staged verification: exact match → tolerant match → paraphrase judge → optional ensemble. The first stage to verify wins. Failed citations render as "unverified" rather than as confident-looking wrong text. Stage 4 ensemble runs parallel multi-judge dispatch with strict/majority aggregation and persists the tier envelope per row. Per-judge cost calibration uses a rolling average over the inference routing log (replaces the M2-D1 conservative flat constant with measured numbers).
Anonymization Layer — pre/post middleware
The Inference Gateway pseudonymizes detected entities (PERSON, ORGANIZATION, EMAIL_ADDRESS, PHONE_NUMBER, LOCATION, US_BANK_NUMBER + custom CASE_NUMBER / MATTER_NUMBER recognizers) before requests leave for the provider, then rehydrates on the response. Per-request PseudonymMapper is in-memory only — never persisted, never logged. Streaming-aware rehydration with bounded tail buffer. Privileged-project chats skip the layer entirely (Decision A — rewriting privileged work product risks corrupting it); retrieved source documents stay un-pseudonymized so the model has intact source quotes for citation grounding.
Honest validation posture: custom recognizers and middleware integration are tested; Presidio default-recognizer recall/precision on legal-document corpus is empirically unmeasured. Operators with high-confidentiality requirements should read docs/security/anonymization.md §"What's validated vs unvalidated" and consider Tier 1 (Ollama local) routing for matters where the unvalidated risk is unacceptable. Community contribution invited via DE-282.
Azure OpenAI provider adapter
AzureOpenAIAdapter subclasses OpenAIAdapter, sharing the wire format with overrides for the deployment-scoped URL (/openai/deployments/<deployment-id>/chat/completions?api-version=<v>) and api-key auth header. Required api_version field — no silent default because Azure rolls features per api-version. API-key auth ships in v0.2; Azure AD (managed identity / service principal) tracked at DE-278.
Scope reframes (closed without code)
- M2-F1 Citation Engine acceptance corpus → closed via scope reframe. Existing unit + integration + Cypress + browser + round-trip + edge-case tests already pin the load-bearing behavior. Citation type 2 (case-citation validation) and type 3 (case-content accuracy) tracked at DE-279 + DE-280.
- M2-F2 Anonymization acceptance corpus → closed via transparency-first deferral. Pre-deployment validation against legal-document corpus is genuinely open work the maintainer team lacks practice-specific judgment to do alone. Honest disclosure + community-friendly DE-282 invites contribution from practitioners across personal-injury / employment / healthcare / immigration / international practices.
New deferred enhancements filed during M2
DE-274, DE-275, DE-276, DE-277 (M2 cycle) · DE-278, DE-279, DE-280, DE-281, DE-282, DE-283 (M2-E / M2-F closeout). See PRD §9 for the full list.
Test deltas (M1 → M2)
| Suite | M1 baseline | v0.2.0 | Delta |
|---|---|---|---|
api/ |
~700 | 1013 | +313 |
gateway/ |
~300 | 515 | +215 |
web/ vitest |
~400 | 456 | +56 |
| Cypress E2E suites | 6 | 7 | +1 |
Provider adapters at v0.2.0
Anthropic · OpenAI · Azure OpenAI · Ollama. Google Vertex AI (DE-034) and AWS Bedrock (DE-035) remain spec'd as contributor-friendly work units on the deferred-enhancement list.
Pre-release validation
Fresh-install validation pass against the m2-development tip from a clean clone (volumes destroyed, images removed). All 7 services healthy; migrations applied through 0029; all probes return expected responses; both new Learn-tab playgrounds (/lq-ai/learn/how §5 Citation Engine cascade + §6 Anonymization Layer pre/post) serve cleanly. One UX paper-cut surfaced — DE-283 (fresh-install login messaging) — filed as a community-friendly DE rather than blocking the release.
Upgrade
LQ.AI is self-hosted; bring-your-own-keys; runs in the operator's environment. The quickstart at docs/quickstart.md walks the full deployment in under 20 minutes against a sample NDA. For operators upgrading from v0.1.0: read docs/HONEST-STATE.md for the per-capability shipped catalog and docs/security/anonymization.md for the honest validation framing on the new privacy controls.
Full per-task detail
docs/M2-IMPLEMENTATION-PLAN.md documents every M2 task with shipped-status and closeout reasoning. 22 commits across PRs #22–#42.