{
  "docVersion": 1,
  "id": "template-production-rag-platform",
  "name": "Production RAG platform",
  "purpose": "A RAG system with production posture: continuous chunk-and-embed ingestion, hybrid dense+sparse retrieval fused and re-ranked, ACL-filtered results, a semantic cache and freshness-driven re-indexing.",
  "nodes": {
    "docs": {
      "type": "storage",
      "label": "Docs · wikis · tickets",
      "x": 20,
      "y": 90,
      "runtime": "the knowledge"
    },
    "etl": {
      "type": "etl",
      "label": "Chunk & embed",
      "x": 270,
      "y": 90,
      "runtime": "split → embed → upsert",
      "notes": "Chunking strategy decides answer quality more than the model does. Embeds with the same model version end-to-end."
    },
    "vdb": {
      "type": "vectordb",
      "label": "Vector index",
      "x": 520,
      "y": 90,
      "runtime": "dense · HNSW",
      "patterns": [
        "replicated"
      ]
    },
    "kidx": {
      "type": "search",
      "label": "Keyword index",
      "x": 520,
      "y": 300,
      "runtime": "sparse · BM25"
    },
    "cron": {
      "type": "cron",
      "label": "Freshness loop",
      "x": 270,
      "y": 300,
      "runtime": "re-embeds changed docs only"
    },
    "user": {
      "type": "user",
      "label": "User",
      "x": 20,
      "y": 470,
      "runtime": "asks in prose"
    },
    "api": {
      "type": "k8s",
      "label": "RAG API",
      "x": 270,
      "y": 470,
      "runtime": "auth → retrieve → generate",
      "color": "blue",
      "patterns": [
        "stateless",
        "autoscale"
      ],
      "notes": "Carries the user's identity through retrieval — ACL filtering happens in the index query, not after generation."
    },
    "scache": {
      "type": "cache",
      "label": "Semantic cache",
      "x": 520,
      "y": 470,
      "runtime": "similar-question hits",
      "color": "green",
      "notes": "Embeds the question and looks for a near-duplicate already answered. FAQ traffic never reaches the LLM."
    },
    "rerank": {
      "type": "gpu",
      "label": "Re-ranker",
      "x": 770,
      "y": 200,
      "runtime": "cross-encoder · top-50 → top-8"
    },
    "llm": {
      "type": "agent",
      "label": "LLM",
      "x": 1020,
      "y": 200,
      "runtime": "answers WITH citations",
      "color": "purple"
    }
  },
  "edges": {
    "e1": {
      "from": "docs",
      "to": "etl",
      "fromSide": "right",
      "toSide": "left",
      "label": "ingest",
      "patterns": [
        "batch"
      ]
    },
    "e2": {
      "from": "etl",
      "to": "vdb",
      "fromSide": "right",
      "toSide": "left",
      "label": "embeddings upsert"
    },
    "e3": {
      "from": "etl",
      "to": "kidx",
      "fromSide": "bottom",
      "toSide": "left",
      "label": "terms"
    },
    "e4": {
      "from": "cron",
      "to": "etl",
      "fromSide": "top",
      "toSide": "bottom",
      "label": "changed docs only",
      "style": "dashed"
    },
    "e5": {
      "from": "user",
      "to": "api",
      "fromSide": "right",
      "toSide": "left",
      "label": "question",
      "animated": true
    },
    "e6": {
      "from": "api",
      "to": "scache",
      "fromSide": "right",
      "toSide": "left",
      "label": "semantic lookup first",
      "animated": true,
      "patterns": [
        "cache-aside"
      ]
    },
    "e7": {
      "from": "api",
      "to": "vdb",
      "fromSide": "top",
      "toSide": "bottom",
      "label": "dense top-50 · ACL filter",
      "patterns": [
        "authenticated"
      ]
    },
    "e8": {
      "from": "api",
      "to": "kidx",
      "fromSide": "right",
      "toSide": "bottom",
      "label": "sparse top-50",
      "patterns": [
        "authenticated"
      ]
    },
    "e9": {
      "from": "vdb",
      "to": "rerank",
      "fromSide": "right",
      "toSide": "left",
      "label": "candidates"
    },
    "e10": {
      "from": "kidx",
      "to": "rerank",
      "fromSide": "right",
      "toSide": "left",
      "label": "fuse (RRF)"
    },
    "e11": {
      "from": "rerank",
      "to": "llm",
      "fromSide": "right",
      "toSide": "left",
      "label": "top-8 + prompt",
      "animated": true,
      "patterns": [
        "timeout"
      ]
    }
  },
  "boxes": {
    "b1": {
      "x": -10,
      "y": 30,
      "w": 800,
      "h": 380,
      "label": "ingestion & retrieval — where RAG quality actually lives",
      "color": "blue",
      "opacity": 0.03
    }
  },
  "texts": {
    "t1": {
      "x": 780,
      "y": 420,
      "text": "the model is the LAST box for a reason:\nbad retrieval + great model = confident nonsense.\nGreat retrieval + decent model = cited answers.",
      "color": "purple",
      "size": 12
    }
  },
  "meta": {
    "createdAt": "2026-07-13T09:00:00.000Z",
    "modifiedAt": "2026-07-13T09:00:00.000Z"
  }
}