{
  "manifest_version": "1.0.0",
  "template": {
    "id": "e9b269c7-c7a1-4ed0-a93c-2673017fa8f8",
    "slug": "railway-ai-docs-search-cohere-pgvector",
    "name": "Railway AI Docs Search (Cohere + pgvector)",
    "description": "Semantic search engine for your documents, using Cohere embeddings",
    "url": "https://railway.com/deploy/railway-ai-docs-search-cohere-pgvector",
    "upstream": {
      "repo_url": "https://github.com/Sanjeev-Kumar78/railway-ai-search-template"
    }
  },
  "services": [
    {
      "name": "worker",
      "source": {
        "repo": "https://github.com/Sanjeev-Kumar78/railway-ai-search-template"
      },
      "needs_volume": false,
      "http": false
    },
    {
      "name": "backend",
      "source": {
        "repo": "https://github.com/Sanjeev-Kumar78/railway-ai-search-template"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "frontend",
      "source": {
        "repo": "https://github.com/Sanjeev-Kumar78/railway-ai-search-template"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "pgvector",
      "source": {
        "image": "pgvector/pgvector:pg16"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "BATCH_SIZE",
      "service": "worker",
      "description": "\tProcesses 16 chunks per API call; small enough to avoid timeouts, large enough for speed",
      "secret": false,
      "strategy": "default",
      "default": "16"
    },
    {
      "key": "CHUNK_SIZE",
      "service": "worker",
      "description": "~500 characters per chunk; good for semantic search accuracy without excessive token usage",
      "secret": false,
      "strategy": "default",
      "default": "500"
    },
    {
      "key": "POSTGRES_DB",
      "service": "worker",
      "description": "Provide a value for POSTGRES_DB.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DATABASE_URL",
      "service": "worker",
      "description": "Provide a value for DATABASE_URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "CHUNK_OVERLAP",
      "service": "worker",
      "description": "50 characters overlap prevents cutting important context mid-sentence",
      "secret": false,
      "strategy": "default",
      "default": "50"
    },
    {
      "key": "POSTGRES_USER",
      "service": "worker",
      "description": "Provide a value for POSTGRES_USER.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "COHERE_API_KEY",
      "service": "worker",
      "description": "Cohere_Trial_API: https://dashboard.cohere.com/api-keys",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "worker",
      "description": "Provide a value for POSTGRES_PASSWORD.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "NODE_ENV",
      "service": "backend",
      "description": "production or development",
      "secret": false,
      "strategy": "default",
      "default": "production"
    },
    {
      "key": "POSTGRES_DB",
      "service": "backend",
      "description": "Provide a value for POSTGRES_DB.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DATABASE_URL",
      "service": "backend",
      "description": "Postgres connection string for pgvector (private URL, SSL disabled for internal Railway network)",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "FRONTEND_URL",
      "service": "backend",
      "description": "CORS and redirects",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "backend",
      "description": "Provide a value for POSTGRES_USER.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "COHERE_API_KEY",
      "service": "backend",
      "description": "Cohere_Trial_API: https://dashboard.cohere.com/api-keys",
      "secret": true,
      "strategy": "default",
      "default": "<your-cohere-api>"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "backend",
      "description": "Provide a value for POSTGRES_PASSWORD.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PORT",
      "service": "frontend",
      "description": "PORT for the frontend",
      "secret": false,
      "strategy": "default",
      "default": "3000"
    },
    {
      "key": "NEXT_PUBLIC_API_URL",
      "service": "frontend",
      "description": "Public URL of backend service",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "PGDATA",
      "service": "pgvector",
      "description": "Provide a value for PGDATA.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/db1"
    },
    {
      "key": "PGHOST",
      "service": "pgvector",
      "description": "Provide a value for PGHOST.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPORT",
      "service": "pgvector",
      "description": "Provide a value for PGPORT.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGUSER",
      "service": "pgvector",
      "description": "Provide a value for PGUSER.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "pgvector",
      "description": "Provide a value for PGDATABASE.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "pgvector",
      "description": "Provide a value for PGPASSWORD.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "pgvector",
      "description": "Postgres Database Name",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_URL",
      "service": "pgvector",
      "description": "Provide a value for DATABASE_URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_USER",
      "service": "pgvector",
      "description": "Postgres Username",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "PGHOST_PRIVATE",
      "service": "pgvector",
      "description": "Provide a value for PGHOST_PRIVATE.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT_PRIVATE",
      "service": "pgvector",
      "description": "Private port for Postgres is always the default 5432 inside Railway’s private network",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "pgvector",
      "description": "Provide a value for POSTGRES_PASSWORD.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_URL_PRIVATE",
      "service": "pgvector",
      "description": "Provide a value for DATABASE_URL_PRIVATE.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "railway-ai-docs-search-cohere-pgvector"
      }
    },
    "cli": "railway deploy --template railway-ai-docs-search-cohere-pgvector",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "e9b269c7-c7a1-4ed0-a93c-2673017fa8f8",
            "serializedConfig": {
              "services": {
                "1ccdd22c-9889-4a93-9459-b1ff99312e16": {
                  "icon": null,
                  "name": "worker",
                  "deploy": {
                    "startCommand": "npm run start",
                    "healthcheckPath": null
                  },
                  "source": {
                    "repo": "https://github.com/Sanjeev-Kumar78/railway-ai-search-template",
                    "rootDirectory": "/worker"
                  },
                  "variables": {
                    "BATCH_SIZE": {
                      "isOptional": false,
                      "description": "\tProcesses 16 chunks per API call; small enough to avoid timeouts, large enough for speed",
                      "defaultValue": "16"
                    },
                    "CHUNK_SIZE": {
                      "isOptional": false,
                      "description": "~500 characters per chunk; good for semantic search accuracy without excessive token usage",
                      "defaultValue": "500"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "defaultValue": "${{pgvector.POSTGRES_DB}}"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "defaultValue": "${{pgvector.DATABASE_URL}}"
                    },
                    "CHUNK_OVERLAP": {
                      "isOptional": false,
                      "description": "50 characters overlap prevents cutting important context mid-sentence",
                      "defaultValue": "50"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "defaultValue": "${{pgvector.POSTGRES_USER}}"
                    },
                    "COHERE_API_KEY": {
                      "isOptional": false,
                      "description": "Cohere_Trial_API: https://dashboard.cohere.com/api-keys",
                      "defaultValue": "${{backend.COHERE_API_KEY}}"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "defaultValue": "${{pgvector.POSTGRES_PASSWORD}}"
                    }
                  }
                },
                "4571fb94-178a-4fd6-9982-f51204b39346": {
                  "icon": null,
                  "name": "backend",
                  "deploy": {
                    "startCommand": "npm run start",
                    "healthcheckPath": null
                  },
                  "source": {
                    "repo": "https://github.com/Sanjeev-Kumar78/railway-ai-search-template",
                    "rootDirectory": "/backend/"
                  },
                  "variables": {
                    "NODE_ENV": {
                      "isOptional": false,
                      "description": "production or development",
                      "defaultValue": "production"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "defaultValue": "${{pgvector.POSTGRES_DB}}"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Postgres connection string for pgvector (private URL, SSL disabled for internal Railway network)",
                      "defaultValue": "${{pgvector.DATABASE_URL_PRIVATE}}?sslmode=disable"
                    },
                    "FRONTEND_URL": {
                      "isOptional": false,
                      "description": "CORS and redirects",
                      "defaultValue": "https://${{frontend.RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "defaultValue": "${{pgvector.POSTGRES_USER}}"
                    },
                    "COHERE_API_KEY": {
                      "isOptional": false,
                      "description": "Cohere_Trial_API: https://dashboard.cohere.com/api-keys",
                      "defaultValue": "<your-cohere-api>"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "defaultValue": "${{pgvector.POSTGRES_PASSWORD}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  }
                },
                "7c021c39-9956-4ae6-9164-6fcf20f0c5c2": {
                  "icon": null,
                  "name": "frontend",
                  "deploy": {
                    "startCommand": "npm run start",
                    "healthcheckPath": null
                  },
                  "source": {
                    "repo": "https://github.com/Sanjeev-Kumar78/railway-ai-search-template",
                    "rootDirectory": "/frontend/"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "PORT for the frontend",
                      "defaultValue": "3000"
                    },
                    "NEXT_PUBLIC_API_URL": {
                      "isOptional": false,
                      "description": "Public URL of backend service",
                      "defaultValue": "https://${{backend.RAILWAY_PUBLIC_DOMAIN}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  }
                },
                "ae5e67ab-ffc3-4748-972d-71bf24763a62": {
                  "icon": "https://devicons.railway.app/i/postgresql.svg",
                  "name": "pgvector",
                  "deploy": {
                    "startCommand": "/bin/sh -c \"unset PGPORT; docker-entrypoint.sh postgres --port=5432\"",
                    "healthcheckPath": null
                  },
                  "source": {
                    "image": "pgvector/pgvector:pg16"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": true,
                      "description": "",
                      "defaultValue": "/var/lib/postgresql/data/db1"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "defaultValue": "${{RAILWAY_TCP_PROXY_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "defaultValue": "${{RAILWAY_TCP_PROXY_PORT}}"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Postgres Database Name",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "postgresql://${{PGUSER}}:${{PGPASSWORD}}@${{PGHOST}}:${{PGPORT}}/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Postgres Username",
                      "defaultValue": "postgres"
                    },
                    "PGHOST_PRIVATE": {
                      "isOptional": false,
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT_PRIVATE": {
                      "isOptional": false,
                      "description": "Private port for Postgres is always the default 5432 inside Railway’s private network",
                      "defaultValue": "5432"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_URL_PRIVATE": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "postgresql://${{PGUSER}}:${{PGPASSWORD}}@${{PGHOST_PRIVATE}}:5432/${{PGDATABASE}}"
                    }
                  },
                  "volumeMounts": {
                    "ae5e67ab-ffc3-4748-972d-71bf24763a62": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 4,
    "needs_volume": true
  },
  "generated_at": "2026-09-18T16:14:44.724Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-09-16T12:32:20.779Z",
  "success_rate_30d": 0,
  "validation": {
    "last_run_id": "run_c21c371815f24d4bbe2e",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": false,
        "detail": "BUILDING,FAILED,BUILDING,SUCCESS"
      }
    ]
  }
}
