Context Stability

Many-to-Many Relationships and AI: What Can Go Wrong

Many‑to‑many relationships can produce unexpected filter behavior for AI queries.

Bridge Table
Rendering diagram...
Dimension → bridge → fact path.
Bridge tables create a single, clear path for filters.

TL;DR

  • • Many‑to‑many relationships amplify ambiguity.
  • • Bridge tables create safer, deterministic paths.

The problem (layman)

  • • Multiple records on each side create unclear filter paths.
  • • AI can’t reason about which path is intended.

Why it matters

  • • Incorrect context leads to wrong answers.
  • • Explanations may cite the wrong segments.

Symptoms

  • • Totals vary when grouping by related dimensions.
  • • AI answers differ depending on the phrasing.

Root causes

  • • Direct many‑to‑many relationships without a bridge.
  • • Lack of clarity on the “driving” table.

What good looks like

  • • Bridge tables with clear relationship direction.
  • • Filters flow predictably from dimensions to facts.

How to fix (steps)

  • • Replace direct many‑to‑many relationships with a bridge.
  • • Document the intended filter direction.
  • • Test with deterministic queries.

Pitfalls

  • • Using bidirectional filters to patch issues.
  • • Ignoring effect on AI queries.

Checklist

  • • Bridge tables for many‑to‑many cases.
  • • Documented filter direction.
  • • Context tests pass.