RAG, recapped in 100 words
Retrieval-Augmented Generation works like this: take a corpus of documents, chunk each one into ~500-token pieces, run each piece through an embedding model, store the vectors. At query time, embed the user question, find the closest chunks by cosine similarity, paste those chunks into the prompt, let the LLM answer.
It works very well for text — policy docs, manuals, knowledge bases. The vector index decouples retrieval from the model, so the agent can answer questions over a corpus too large to fit in context.
Where RAG breaks
Structured data isn't text. A spreadsheet of sales numbers, a log of API errors, a list of MCP servers — these have rows and columns, not paragraphs. Treating them as text loses three things RAG can't recover:
- Freshness. Chunks are embedded at index time. A row added today won't surface until the next reindex.
- Lineage. A "sales-q2.pdf" chunk doesn't tell the agent which row, which version, or who produced it.
- Query semantics. "Top three regions by revenue" is a SQL query, not a similarity search.
You can hack around this — re-embed nightly, stuff lineage into chunk metadata, ask the model to reason over the chunks — but the hack stack gets large fast.
What MAG is
Mesh-Augmented Generation treats structured data as a first-class retrieval target. The agent doesn't search "documents"; it searches a mesh of grids — each grid is a versioned, schema-typed, citable table at a stable URL.
| RAG | MAG |
|---|---|
| Chunks of text | Rows of structured data |
| Embedded once, reindex periodically | Live — latest push is what the agent reads |
| Provenance per chunk (file path) | Provenance per row (grid UUID + version + SHA) |
| Cosine similarity over text | Semantic + keyword search over grid metadata, plus query/filter on the rows themselves |
| Best for: PDFs, docs, transcripts | Best for: metrics, lists, logs, tables |
What it looks like in practice
The agent gets a question:
"Compare LangGraph and CrewAI on MCP support."
A RAG pipeline would search a documentation corpus and hope someone has compared them in prose. A MAG-flavored agent calls instamesh_search("AI agent frameworks MCP support"), finds a public grid (e.g. showcase/agent-frameworks-2026), reads the relevant rows via instadash_read, and answers from structured columns with citation.
"LangGraph supports MCP as of v0.2.40 (2026-02). CrewAI is in beta as of 2026-04.
Source: showcase/agent-frameworks-2026 · v17 · last updated 2026-05-08."
When to use each
- Pure RAG: knowledge bases, policy lookup, code-context retrieval, summarization of long docs.
- Pure MAG: dashboards on demand, ops monitoring questions, comparison of structured options, anything where "row X, column Y" is the actual answer.
- Both: an agent answering a multi-part question — RAG for the prose context, MAG for the numbers.
For Instadash's full design rationale, see /docs/mag. The wire-level details on how the mesh discovers grids and serves search are in /docs/mesh-protocol.