{
  "manifest_version": "1.0.0",
  "template": {
    "id": "cd009578-4c02-45ad-8491-f0f1857d0571",
    "slug": "r2r-rag-backend",
    "name": "R2R RAG backend",
    "description": "Authenticated R2R retrieval with pgvector ingestion and cited RAG.",
    "url": "https://railway.com/deploy/r2r-rag-backend",
    "upstream": {
      "image": "sciphiai/r2r-dashboard:1.0.3@sha256:ba9bcb43c5e7d7d4eb9fe38970f976f6a0842297f3da078cb6223d1f078741d1"
    }
  },
  "services": [
    {
      "name": "R2R Dashboard",
      "source": {
        "image": "sciphiai/r2r-dashboard:1.0.3@sha256:ba9bcb43c5e7d7d4eb9fe38970f976f6a0842297f3da078cb6223d1f078741d1"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "R2R API",
      "source": {
        "repo": "https://github.com/tech-progress/railway-template-r2r"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "R2R PostgreSQL",
      "source": {
        "image": "pgvector/pgvector:pg16@sha256:a36250871de0833b8757561c72f2477ef1ddd1101afa4e617fb552e0de514c6b"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "R2R Graph Clustering",
      "source": {
        "image": "ragtoriches/cluster-prod@sha256:53bcbcc114fe08906b6df6b4d3863644145b1efa240fd6643ef65986593938b6"
      },
      "needs_volume": false,
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "R2R Dashboard",
      "description": "Railway HTTP routing port for the dashboard.",
      "secret": false,
      "strategy": "default",
      "default": "3000"
    },
    {
      "key": "NEXT_PUBLIC_R2R_DEFAULT_EMAIL",
      "service": "R2R Dashboard",
      "description": "Non-secret administrator email shown by the dashboard login form.",
      "secret": false,
      "strategy": "default",
      "default": "admin@example.com"
    },
    {
      "key": "NEXT_PUBLIC_R2R_DEPLOYMENT_URL",
      "service": "R2R Dashboard",
      "description": "Public HTTPS URL of the R2R API used by browser clients.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "R2R_DASHBOARD_DISABLE_TELEMETRY",
      "service": "R2R Dashboard",
      "description": "Disables dashboard telemetry for this self-hosted deployment.",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "PORT",
      "service": "R2R API",
      "description": "Railway HTTP routing port for the R2R API.",
      "secret": false,
      "strategy": "default",
      "default": "7272"
    },
    {
      "key": "R2R_HOST",
      "service": "R2R API",
      "description": "Network interface on which R2R accepts requests.",
      "secret": false,
      "strategy": "default",
      "default": "0.0.0.0"
    },
    {
      "key": "R2R_PORT",
      "service": "R2R API",
      "description": "R2R API listening port.",
      "secret": false,
      "strategy": "default",
      "default": "7272"
    },
    {
      "key": "R2R_LOG_LEVEL",
      "service": "R2R API",
      "description": "R2R application logging level.",
      "secret": false,
      "strategy": "default",
      "default": "INFO"
    },
    {
      "key": "OPENAI_API_KEY",
      "service": "R2R API",
      "description": "Required OpenAI API key for embeddings, ingestion summaries, retrieval, and RAG answers.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "R2R_SECRET_KEY",
      "service": "R2R API",
      "description": "Generated signing key for R2R authentication tokens.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "R2R_ADMIN_EMAIL",
      "service": "R2R API",
      "description": "Initial administrator email used to sign in to the dashboard and API.",
      "secret": false,
      "strategy": "default",
      "default": "admin@example.com"
    },
    {
      "key": "R2R_PROJECT_NAME",
      "service": "R2R API",
      "description": "PostgreSQL schema namespace used by this R2R deployment.",
      "secret": false,
      "strategy": "default",
      "default": "railway_r2r"
    },
    {
      "key": "R2R_POSTGRES_HOST",
      "service": "R2R API",
      "description": "Private Railway hostname of the PostgreSQL service.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "R2R_POSTGRES_PORT",
      "service": "R2R API",
      "description": "Private PostgreSQL port.",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "R2R_POSTGRES_USER",
      "service": "R2R API",
      "description": "Database role referenced from PostgreSQL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "R2R_ADMIN_PASSWORD",
      "service": "R2R API",
      "description": "Generated initial administrator password; read it from this service after deployment.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "R2R_POSTGRES_DBNAME",
      "service": "R2R API",
      "description": "Database name referenced from PostgreSQL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "R2R_POSTGRES_PASSWORD",
      "service": "R2R API",
      "description": "Database password referenced from PostgreSQL and redacted from R2R startup logs.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "CLUSTERING_SERVICE_URL",
      "service": "R2R API",
      "description": "Private graph-clustering service endpoint.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "HATCHET_CLIENT_TLS_STRATEGY",
      "service": "R2R API",
      "description": "Compatibility setting for R2R's simple local orchestration mode.",
      "secret": false,
      "strategy": "default",
      "default": "none"
    },
    {
      "key": "R2R_POSTGRES_MAX_CONNECTIONS",
      "service": "R2R API",
      "description": "R2R database pool ceiling for this single-replica topology.",
      "secret": false,
      "strategy": "default",
      "default": "64"
    },
    {
      "key": "R2R_POSTGRES_STATEMENT_CACHE_SIZE",
      "service": "R2R API",
      "description": "Prepared-statement cache size per R2R database connection.",
      "secret": false,
      "strategy": "default",
      "default": "100"
    },
    {
      "key": "PGDATA",
      "service": "R2R PostgreSQL",
      "description": "PostgreSQL data directory beneath the Railway volume mount.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "POSTGRES_DB",
      "service": "R2R PostgreSQL",
      "description": "Database used by R2R for documents, chunks, vectors, files, users, and metadata.",
      "secret": false,
      "strategy": "default",
      "default": "r2r"
    },
    {
      "key": "POSTGRES_USER",
      "service": "R2R PostgreSQL",
      "description": "PostgreSQL role used only by the private R2R service.",
      "secret": false,
      "strategy": "default",
      "default": "r2r"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "R2R PostgreSQL",
      "description": "Generated PostgreSQL password shared with R2R through a service reference.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "PORT",
      "service": "R2R Graph Clustering",
      "description": "Railway health-routing port for the private graph-clustering service.",
      "secret": false,
      "strategy": "default",
      "default": "7276"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "r2r-rag-backend"
      }
    },
    "cli": "railway deploy --template r2r-rag-backend",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "cd009578-4c02-45ad-8491-f0f1857d0571",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "839ba802-9246-43fc-a831-249606926a05": {
                  "icon": null,
                  "name": "R2R Dashboard",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/",
                    "restartPolicyType": "ON_FAILURE",
                    "healthcheckTimeout": 180,
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "sciphiai/r2r-dashboard:1.0.3@sha256:ba9bcb43c5e7d7d4eb9fe38970f976f6a0842297f3da078cb6223d1f078741d1"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Railway HTTP routing port for the dashboard.",
                      "defaultValue": "3000"
                    },
                    "NEXT_PUBLIC_R2R_DEFAULT_EMAIL": {
                      "isOptional": false,
                      "description": "Non-secret administrator email shown by the dashboard login form.",
                      "defaultValue": "admin@example.com"
                    },
                    "NEXT_PUBLIC_R2R_DEPLOYMENT_URL": {
                      "isOptional": false,
                      "description": "Public HTTPS URL of the R2R API used by browser clients.",
                      "defaultValue": "https://${{R2R API.RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "R2R_DASHBOARD_DISABLE_TELEMETRY": {
                      "isOptional": false,
                      "description": "Disables dashboard telemetry for this self-hosted deployment.",
                      "defaultValue": "true"
                    },
                    "NEXT_PUBLIC_R2R_DEFAULT_PASSWORD": {
                      "isOptional": true,
                      "description": "Intentionally blank because NEXT_PUBLIC values are visible to every browser.",
                      "defaultValue": ""
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {
                        "port": 3000
                      }
                    }
                  }
                },
                "a300c350-5d00-4282-b3f1-c3f8d71a2f88": {
                  "icon": null,
                  "name": "R2R API",
                  "build": {
                    "builder": "DOCKERFILE",
                    "watchPatterns": [
                      "/**",
                      "!/FINDINGS.md"
                    ],
                    "dockerfilePath": "Dockerfile"
                  },
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/v3/health",
                    "restartPolicyType": "ON_FAILURE",
                    "healthcheckTimeout": 300,
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "tech-progress/railway-template-r2r",
                    "branch": "release-v1",
                    "rootDirectory": "/"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Railway HTTP routing port for the R2R API.",
                      "defaultValue": "7272"
                    },
                    "R2R_HOST": {
                      "isOptional": false,
                      "description": "Network interface on which R2R accepts requests.",
                      "defaultValue": "0.0.0.0"
                    },
                    "R2R_PORT": {
                      "isOptional": false,
                      "description": "R2R API listening port.",
                      "defaultValue": "7272"
                    },
                    "R2R_LOG_LEVEL": {
                      "isOptional": false,
                      "description": "R2R application logging level.",
                      "defaultValue": "INFO"
                    },
                    "OPENAI_API_KEY": {
                      "isOptional": false,
                      "description": "Required OpenAI API key for embeddings, ingestion summaries, retrieval, and RAG answers.",
                      "defaultValue": "{{OPENAI_API_KEY}}"
                    },
                    "R2R_SECRET_KEY": {
                      "isOptional": false,
                      "description": "Generated signing key for R2R authentication tokens.",
                      "defaultValue": "{{R2R_SECRET_KEY}}"
                    },
                    "OPENAI_API_BASE": {
                      "isOptional": true,
                      "description": "Optional OpenAI-compatible base URL used by LiteLLM embeddings; leave blank for OpenAI.",
                      "defaultValue": ""
                    },
                    "OPENAI_BASE_URL": {
                      "isOptional": true,
                      "description": "Optional OpenAI-compatible base URL used by the OpenAI completion client; keep aligned with OPENAI_API_BASE.",
                      "defaultValue": ""
                    },
                    "R2R_ADMIN_EMAIL": {
                      "isOptional": false,
                      "description": "Initial administrator email used to sign in to the dashboard and API.",
                      "defaultValue": "admin@example.com"
                    },
                    "R2R_PROJECT_NAME": {
                      "isOptional": false,
                      "description": "PostgreSQL schema namespace used by this R2R deployment.",
                      "defaultValue": "railway_r2r"
                    },
                    "R2R_POSTGRES_HOST": {
                      "isOptional": false,
                      "description": "Private Railway hostname of the PostgreSQL service.",
                      "defaultValue": "${{R2R PostgreSQL.RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "R2R_POSTGRES_PORT": {
                      "isOptional": false,
                      "description": "Private PostgreSQL port.",
                      "defaultValue": "5432"
                    },
                    "R2R_POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Database role referenced from PostgreSQL.",
                      "defaultValue": "${{R2R PostgreSQL.POSTGRES_USER}}"
                    },
                    "R2R_ADMIN_PASSWORD": {
                      "isOptional": false,
                      "description": "Generated initial administrator password; read it from this service after deployment.",
                      "defaultValue": "{{R2R_ADMIN_PASSWORD}}"
                    },
                    "R2R_POSTGRES_DBNAME": {
                      "isOptional": false,
                      "description": "Database name referenced from PostgreSQL.",
                      "defaultValue": "${{R2R PostgreSQL.POSTGRES_DB}}"
                    },
                    "R2R_POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Database password referenced from PostgreSQL and redacted from R2R startup logs.",
                      "defaultValue": "${{R2R PostgreSQL.POSTGRES_PASSWORD}}"
                    },
                    "CLUSTERING_SERVICE_URL": {
                      "isOptional": false,
                      "description": "Private graph-clustering service endpoint.",
                      "defaultValue": "http://${{R2R Graph Clustering.RAILWAY_PRIVATE_DOMAIN}}:7276"
                    },
                    "HATCHET_CLIENT_TLS_STRATEGY": {
                      "isOptional": false,
                      "description": "Compatibility setting for R2R's simple local orchestration mode.",
                      "defaultValue": "none"
                    },
                    "R2R_POSTGRES_MAX_CONNECTIONS": {
                      "isOptional": false,
                      "description": "R2R database pool ceiling for this single-replica topology.",
                      "defaultValue": "64"
                    },
                    "R2R_POSTGRES_STATEMENT_CACHE_SIZE": {
                      "isOptional": false,
                      "description": "Prepared-statement cache size per R2R database connection.",
                      "defaultValue": "100"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {
                        "port": 7272
                      }
                    }
                  }
                },
                "b5b258ef-59d4-4fde-ab49-eb56b7176b48": {
                  "icon": null,
                  "name": "R2R PostgreSQL",
                  "deploy": {
                    "startCommand": "/bin/sh -ec 'exec docker-entrypoint.sh postgres -c max_connections=256'",
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "healthcheckTimeout": null,
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "pgvector/pgvector:pg16@sha256:a36250871de0833b8757561c72f2477ef1ddd1101afa4e617fb552e0de514c6b"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "PostgreSQL data directory beneath the Railway volume mount.",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Database used by R2R for documents, chunks, vectors, files, users, and metadata.",
                      "defaultValue": "r2r"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "PostgreSQL role used only by the private R2R service.",
                      "defaultValue": "r2r"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Generated PostgreSQL password shared with R2R through a service reference.",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "b5b258ef-59d4-4fde-ab49-eb56b7176b48": {
                      "sizeMB": 5000,
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                },
                "f3ab0378-1b8c-4896-a793-aa40e38660aa": {
                  "icon": null,
                  "name": "R2R Graph Clustering",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/health",
                    "restartPolicyType": "ON_FAILURE",
                    "healthcheckTimeout": 120,
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ragtoriches/cluster-prod@sha256:53bcbcc114fe08906b6df6b4d3863644145b1efa240fd6643ef65986593938b6"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Railway health-routing port for the private graph-clustering service.",
                      "defaultValue": "7276"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "R2R Dashboard",
      "method": "GET",
      "path": "/",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 4,
    "needs_volume": true
  },
  "generated_at": "2026-09-10T16:14:52.212Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-08T18:54:29.991Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_bef7952258ef4071ad4d",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 180,
    "typical_build_seconds": 0,
    "typical_start_seconds": 10,
    "slowest_service": "R2R Dashboard"
  }
}
