{
  "$schema": "../../../skill/references/schemap.schema.json",
  "kind": "dataflow",
  "title": "RAG pipeline",
  "subtitle": "Documents in, grounded answers out",
  "groups": [{ "id": "ingest", "label": "Ingest (batch)" }, { "id": "query", "label": "Query (live)" }],
  "nodes": [
    {
      "id": "docs",
      "type": "storage",
      "group": "ingest",
      "card": { "title": "Source docs", "subtitle": "Notion, PDFs, repos" }
    },
    {
      "id": "chunk",
      "type": "service",
      "group": "ingest",
      "card": {
        "title": "Chunker",
        "rows": [{ "label": "Size", "value": "800 tokens" }, { "label": "Overlap", "value": "100" }]
      }
    },
    { "id": "embed", "type": "external", "group": "ingest", "card": { "title": "Embedding model" } },
    { "id": "vdb", "type": "database", "card": { "title": "Vector store", "subtitle": "pgvector, HNSW" } },
    { "id": "user", "type": "client", "group": "query", "card": { "title": "Question" } },
    {
      "id": "retrieve",
      "type": "service",
      "group": "query",
      "card": { "title": "Retriever", "subtitle": "top-k 8 + rerank" }
    },
    {
      "id": "llm",
      "type": "external",
      "group": "query",
      "card": { "title": "LLM", "subtitle": "answers with citations" }
    },
    { "id": "answer", "type": "client", "group": "query", "card": { "title": "Answer" } }
  ],
  "edges": [
    { "id": "e1", "from": "docs", "to": "chunk", "tone": "main" },
    { "id": "e2", "from": "chunk", "to": "embed", "tone": "main" },
    { "id": "e3", "from": "embed", "to": "vdb", "label": "vectors", "tone": "main" },
    { "id": "e4", "from": "user", "to": "retrieve", "tone": "main" },
    { "id": "e5", "from": "vdb", "to": "retrieve", "label": "nearest chunks" },
    { "id": "e6", "from": "retrieve", "to": "llm", "label": "prompt + context", "tone": "main" },
    { "id": "e7", "from": "llm", "to": "answer", "tone": "main" }
  ]
}
