001How grounding works

Vectors approximate.
The graph doesn't.

Most RAG systems treat nearest-neighbor search as the whole answer. MsgStack treats it as one of two layers: vectors for exploration and thematic search, deterministic graph traversal for anything governance-critical. The tier on each entry decides which path a query takes.

Vector layer

APPROXIMATE BY DESIGN

Turbovec — a local, in-process quantized index. Embed, query, filter, rerank by keyword overlap. Ideal for exploratory and thematic queries. Zero external services; the whole index lives in a single file next to your database.

embed(query)
  → turbovec.query()      <0.1ms, local
  → metadata filter
  → keyword rerank

Graph layer

DETERMINISTIC ✦

A typed knowledge graph — domains, entries, pillars, personas, channels, objections — traversed by edge type, never by similarity. Locked claims and Tier 1 entries route here exclusively: exact retrieval, verbatim return.

traverse(entry_441B)
  -[:CONTAINS]->  pillar
  -[:TARGETS]->   persona: CISO
  -[:RESOLVES]->  objection 12
  → verbatim ✦ no approximation
002The hybrid pipeline — in action

Part 2 — Retrieval Engine

How Hybrid Grounding Works

Most AI tools fail because they rely solely on Vector Approximation. When a query is made, they find "similar" text but don't understand the relationship between a root policy and a specific claim.

01

Deterministic Graph Traversal

For verbatim match requirements (taglines, legal disclaimers, pricing caps), MsgStack traverses the knowledge graph to retrieve version-locked nodes. Zero paraphrasing allowed.

02

Semantic Vector Search

For exploratory queries, embedding-based semantic search finds relevant context across the broader canon, filtered by departmental domain boundaries.

03

Retrieval Fusion

The final grounding set synthesizes locked claims and relevant context, ranked by the Grounding Contract so the most authoritative truth always takes precedence.

grounding_engine_v0.8
003Retrieval modes & routing

Every query declares its mode.

Agents pass retrieval_mode per query — and tier enforcement overrides it where it matters: a Tier 1 entry answers via the graph no matter what was asked. If the vector index is missing, retrieval falls back to keyword search; graph traversal works regardless.

Full architecture ✦
RECORD — retrieval_mode
hybridDEFAULTVector first, graph for related context — the default
graphPure traversal: governance queries, locked claims, exact taglines
vectorSemantic-only: exploration, thematic similarity
keywordFull-text fallback when no vector index exists
004Provenance — the chain of citation

Every output traces back to its source.

Generated artifacts carry their grounded messages: which entries informed which sections, from which source documents. Alignment scoring closes the loop — anything that can't cite an entry gets flagged before it ships.

01

Source document

positioning_deck.pdf · ingested, extracted, conflict-checked

02

Canon entry

441-B · LOCKED ✦ · Tier 1 · DRI: Product Marketing

03

Generated artifact

sales_email_v3 · alignment 100 · cites 4 entries