Skip to main content

ADR-004: Per-org corrections dataset in Haystack

Date: 2026-05-13 Status: Accepted Issue: #303

Context

Correction-derived KB documents have different semantics (error→fix pairs), lifecycle (continuous accumulation), and retrieval patterns compared to uploaded business docs (default-kb) or conversation history (conversations).

Decision

Create a third Haystack dataset per org: corrections. The correction→KB refinement processor (#303) writes to this dataset. HaystackRetrievalService.search() supports source: "corrections" and source: "all" options.

Consequences

  • Clean separation: KB docs, conversations, and corrections are independently queryable
  • The Haystack metadata model preserves 3 logical datasets per org (default-kb, conversations, corrections) without provisioning per-org infrastructure
  • Existing documents can be replayed with api/scripts/haystack-reingest.ts