---
title: "Decision: Inline graph_data in bundle URLs"
url: https://memory.wiki/yIpXMsqc
updated: 2026-05-14T18:15:49.480Z
hub: https://memory.wiki/hub/demo
concept_count: 12
source: "memory.wiki"
---
# Decision: Inline graph_data in bundle URLs

> Companion to the public spec version at /spec. This is the engineering-side version with the receipts.

## What we do

Every bundle URL (e.g. `mdfy.app/b/wpwVCSDF`) returns markdown with the bundle's `graph_data` JSON inlined as a fenced code block at the top of the response. The receiving AI fetches the URL once and inherits themes, insights, document summaries, and the concept graph in a single round trip.

## The alternative we rejected

Lazy / on-demand: ship the URL with just the doc list, let the caller pull `/api/bundles/{id}/graph` separately if they want analysis.

That's simpler. We chose against it because:

1. **AI agents don't make a second call by default.** Claude Code, Cursor, Codex all fetch a URL once and consume what they get. If the analysis isn't in the response, they don't see it.
2. **The graph is small.** Median ~3KB per bundle. We measured. Pasting a 3KB JSON block into a 100KB doc response is a 3% size hit and a 0% latency hit.
3. **The graph is the differentiator.** Without it, mdfy bundles look like "a list of markdown files concatenated." With it, they look like "synthesised intelligence." We want every AI on the planet to see the second.

## The query knobs

We added two `?` params so callers can dial cost:

- `?graph=0` — omit the graph_data block (recall scenarios where the model just wants the prose)
- `?full=1` — inline every member doc inside the response (max-context scenarios)

Default is `graph_data inlined, member docs as URL stubs.`

## What this commits us to

Bundle analysis has to stay current. The "stale" badge on the analysed pill in the UI is the user-visible commitment to keep it that way. Auto-analyse on member-doc changes is Pro-only; free tier sees the badge and clicks "Re-analyse" manually.


---

## Concepts in this document
- **mdfy** _(entity)_
  A tool that stores project context and decision history, integrated into Cursor via custom rules.
- **Supabase** _(entity)_
  Backend-as-a-service providing authentication, database, and row-level security without separate auth overhead.
- **Vendor consolidation** _(concept)_
  The operational principle of reducing authentication surfaces, SDKs, and control planes by keeping vector search within the existing Postgres infrastructure.
- **pgvector** _(entity)_
  PostgreSQL extension providing vector data type and HNSW indexing for efficient similarity search.
- **Cursor** _(entity)_
  Code editor that consumes mdfy bundles as context for chat and composer sessions.
- **Anthropic** _(entity)_
  Incumbent AI vendor mentioned as competitive threat with integrated memory and user lock-in.
- **Performance Optimization** _(concept)_
  Critical performance considerations driving technical architecture decisions.
- **Claude Code** _(entity)_
  AI coding feature mentioned as a primary context for AI-native developer adoption.
- **AI-First Architecture** _(concept)_
  Design philosophy that assumes AI capabilities replace traditional manual processes.
- **Supabase Postgres** _(entity)_
  The existing database infrastructure that pgvector extends, serving as the single unified platform for relational and vector queries.
- **comrak** _(entity)_
  The Rust markdown parser selected for production use due to GFM compliance and performance.
- **Cost Optimization** _(tag)_
  Financial considerations in technology and vendor selection decisions.

## Concept relations (within this doc's concepts)
- **AI-First Architecture** synergizes with **Vendor consolidation**
- **Performance Optimization** balanced priorities **Cost Optimization**
- **Vendor consolidation** reduces complexity costs **Cost Optimization**
- **Anthropic** supports strategy **Vendor consolidation**
- **Supabase** enables approach **Vendor consolidation**
- **Supabase** hosts **pgvector**
- **Supabase** exemplifies approach **Vendor consolidation**
- **Supabase** reduces complexity **Vendor consolidation**
- **Supabase** integrates **pgvector**
- **Supabase** exemplifies strategy **Vendor consolidation**
- **Vendor consolidation** guides **Supabase**
- **mdfy** integrates with **Cursor**
- **mdfy** integrated into **Cursor**

_Hub canonical:_ https://memory.wiki/hub/demo
_Concept digest:_ https://memory.wiki/raw/hub/demo?digest=1&compact=1
