KB article
Many-to-Many Relationships and AI: What Can Go Wrong
Many‑to‑many relationships can produce unexpected filter behavior for AI queries.
arf-kbcontext-stabilitymany-to-manybridge-tablerelationship-path
TL;DR
- Many‑to‑many relationships amplify ambiguity.
- Bridge tables create safer, deterministic paths.
The problem
- 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
- 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.
Framework placement
Primary ARF layer: Context Stability. Diagnostic bridge: data-movement-reliability, semantic-reliability, execution-reliability.