{
  "manifest_version": "1.0.0",
  "template": {
    "id": "e1321684-9f4f-4daf-a286-ab426ed53ea8",
    "slug": "hindsight-agent-memory-secure-slim",
    "name": "Hindsight Memory Server",
    "description": "Long-term memory for AI agents over MCP and REST, with auth and pgvector",
    "url": "https://railway.com/deploy/hindsight-agent-memory-secure-slim",
    "upstream": {
      "image": "ghcr.io/vectorize-io/hindsight-api:0.10.1-slim"
    }
  },
  "services": [
    {
      "name": "Postgres",
      "source": {
        "image": "pgvector/pgvector:pg17"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "hindsight-api",
      "source": {
        "image": "ghcr.io/vectorize-io/hindsight-api:0.10.1-slim"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "hindsight-ui",
      "source": {
        "image": "ghcr.io/vectorize-io/hindsight-control-plane:0.10.1"
      },
      "needs_volume": false,
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Data directory inside the volume",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Database name",
      "secret": false,
      "strategy": "default",
      "default": "hindsight"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "Private connection string used by Hindsight",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Database superuser",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Database password (generated)",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "PORT",
      "service": "hindsight-api",
      "description": "Port Railway routes to",
      "secret": false,
      "strategy": "default",
      "default": "8888"
    },
    {
      "key": "HINDSIGHT_API_HOST",
      "service": "hindsight-api",
      "description": "Listen address (Railway private networks are dual-stack since Oct 2025)",
      "secret": false,
      "strategy": "default",
      "default": "0.0.0.0"
    },
    {
      "key": "HINDSIGHT_API_PORT",
      "service": "hindsight-api",
      "description": "API port",
      "secret": false,
      "strategy": "default",
      "default": "8888"
    },
    {
      "key": "HINDSIGHT_API_WORKER_ID",
      "service": "hindsight-api",
      "description": "Stable worker id so in-flight tasks survive restarts",
      "secret": false,
      "strategy": "default",
      "default": "hindsight-railway"
    },
    {
      "key": "HINDSIGHT_API_LLM_API_KEY",
      "service": "hindsight-api",
      "description": "API key for the LLM provider. With openai it also powers embeddings.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "HINDSIGHT_API_DATABASE_URL",
      "service": "hindsight-api",
      "description": "pgvector Postgres (private network)",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "HINDSIGHT_API_LLM_PROVIDER",
      "service": "hindsight-api",
      "description": "LLM provider: openai, anthropic, gemini, groq, deepseek, openrouter, ... (see Hindsight docs)",
      "secret": false,
      "strategy": "default",
      "default": "openai"
    },
    {
      "key": "HINDSIGHT_API_TENANT_API_KEY",
      "service": "hindsight-api",
      "description": "Your API key. Send it as Authorization: Bearer <key>",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "HINDSIGHT_API_TENANT_EXTENSION",
      "service": "hindsight-api",
      "description": "Require an API key on every request",
      "secret": false,
      "strategy": "default",
      "default": "hindsight_api.extensions.builtin.tenant:ApiKeyTenantExtension"
    },
    {
      "key": "HINDSIGHT_API_RERANKER_PROVIDER",
      "service": "hindsight-api",
      "description": "Reranker: rrf needs no model or key; cohere / tei / openrouter also supported",
      "secret": false,
      "strategy": "default",
      "default": "rrf"
    },
    {
      "key": "HINDSIGHT_API_EMBEDDINGS_PROVIDER",
      "service": "hindsight-api",
      "description": "Embeddings provider (openai reuses the LLM key; set HINDSIGHT_API_EMBEDDINGS_API_KEY if your LLM is not OpenAI)",
      "secret": false,
      "strategy": "default",
      "default": "openai"
    },
    {
      "key": "HINDSIGHT_API_MIGRATION_DATABASE_URL",
      "service": "hindsight-api",
      "description": "Connection used for migrations; fails fast if Postgres is restarting",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PORT",
      "service": "hindsight-ui",
      "description": "Port Railway routes to",
      "secret": false,
      "strategy": "default",
      "default": "9999"
    },
    {
      "key": "HINDSIGHT_CP_HOSTNAME",
      "service": "hindsight-ui",
      "description": "Listen address",
      "secret": false,
      "strategy": "default",
      "default": "0.0.0.0"
    },
    {
      "key": "HINDSIGHT_CP_ACCESS_KEY",
      "service": "hindsight-ui",
      "description": "Password for the web UI",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "HINDSIGHT_CP_DATAPLANE_API_KEY",
      "service": "hindsight-ui",
      "description": "API key the UI uses to talk to the API",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "HINDSIGHT_CP_DATAPLANE_API_URL",
      "service": "hindsight-ui",
      "description": "Hindsight API over the private network",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "hindsight-agent-memory-secure-slim"
      }
    },
    "cli": "railway deploy --template hindsight-agent-memory-secure-slim",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "e1321684-9f4f-4daf-a286-ab426ed53ea8",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "3ca11ff7-e9d0-4f84-8b55-df5a35a82f08": {
                  "icon": "https://devicons.railway.com/i/postgresql.svg",
                  "name": "Postgres",
                  "deploy": {
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "pgvector/pgvector:pg17"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Data directory inside the volume",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Database name",
                      "defaultValue": "hindsight"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Private connection string used by Hindsight",
                      "defaultValue": "postgresql://${{POSTGRES_USER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{POSTGRES_DB}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Database superuser",
                      "defaultValue": "postgres"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Database password (generated)",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    }
                  },
                  "networking": {
                    "tcpProxies": {},
                    "serviceDomains": {}
                  },
                  "volumeMounts": {
                    "64f4f18b-f943-4cf4-970f-7aebf3c4fcee": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                },
                "ca4fe5fb-72eb-4e75-9b7c-8b85eead8854": {
                  "icon": "https://raw.githubusercontent.com/vectorize-io/hindsight/25b539ac99088b865931ce8b295b2b6ff9091795/hindsight-favicon.png",
                  "name": "hindsight-api",
                  "deploy": {
                    "healthcheckPath": "/health",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/vectorize-io/hindsight-api:0.10.1-slim"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port Railway routes to",
                      "defaultValue": "8888"
                    },
                    "HINDSIGHT_API_HOST": {
                      "isOptional": false,
                      "description": "Listen address (Railway private networks are dual-stack since Oct 2025)",
                      "defaultValue": "0.0.0.0"
                    },
                    "HINDSIGHT_API_PORT": {
                      "isOptional": false,
                      "description": "API port",
                      "defaultValue": "8888"
                    },
                    "HINDSIGHT_API_WORKER_ID": {
                      "isOptional": false,
                      "description": "Stable worker id so in-flight tasks survive restarts",
                      "defaultValue": "hindsight-railway"
                    },
                    "HINDSIGHT_API_LLM_API_KEY": {
                      "isOptional": false,
                      "description": "API key for the LLM provider. With openai it also powers embeddings.",
                      "defaultValue": "{{HINDSIGHT_API_LLM_API_KEY}}"
                    },
                    "HINDSIGHT_API_DATABASE_URL": {
                      "isOptional": false,
                      "description": "pgvector Postgres (private network)",
                      "defaultValue": "${{Postgres.DATABASE_URL}}"
                    },
                    "HINDSIGHT_API_LLM_PROVIDER": {
                      "isOptional": false,
                      "description": "LLM provider: openai, anthropic, gemini, groq, deepseek, openrouter, ... (see Hindsight docs)",
                      "defaultValue": "openai"
                    },
                    "HINDSIGHT_API_TENANT_API_KEY": {
                      "isOptional": false,
                      "description": "Your API key. Send it as Authorization: Bearer <key>",
                      "defaultValue": "{{HINDSIGHT_API_TENANT_API_KEY}}"
                    },
                    "HINDSIGHT_API_TENANT_EXTENSION": {
                      "isOptional": false,
                      "description": "Require an API key on every request",
                      "defaultValue": "hindsight_api.extensions.builtin.tenant:ApiKeyTenantExtension"
                    },
                    "HINDSIGHT_API_RERANKER_PROVIDER": {
                      "isOptional": false,
                      "description": "Reranker: rrf needs no model or key; cohere / tei / openrouter also supported",
                      "defaultValue": "rrf"
                    },
                    "HINDSIGHT_API_EMBEDDINGS_PROVIDER": {
                      "isOptional": false,
                      "description": "Embeddings provider (openai reuses the LLM key; set HINDSIGHT_API_EMBEDDINGS_API_KEY if your LLM is not OpenAI)",
                      "defaultValue": "openai"
                    },
                    "HINDSIGHT_API_MIGRATION_DATABASE_URL": {
                      "isOptional": false,
                      "description": "Connection used for migrations; fails fast if Postgres is restarting",
                      "defaultValue": "${{Postgres.DATABASE_URL}}?connect_timeout=10"
                    }
                  },
                  "networking": {
                    "tcpProxies": {},
                    "serviceDomains": {
                      "<hasDomain>:8888": {
                        "port": 8888
                      }
                    }
                  }
                },
                "eb0a00ea-ebe8-4ab2-8453-7632e98b5b04": {
                  "icon": "https://raw.githubusercontent.com/vectorize-io/hindsight/25b539ac99088b865931ce8b295b2b6ff9091795/hindsight-favicon.png",
                  "name": "hindsight-ui",
                  "deploy": {
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/vectorize-io/hindsight-control-plane:0.10.1"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port Railway routes to",
                      "defaultValue": "9999"
                    },
                    "HINDSIGHT_CP_HOSTNAME": {
                      "isOptional": false,
                      "description": "Listen address",
                      "defaultValue": "0.0.0.0"
                    },
                    "HINDSIGHT_CP_ACCESS_KEY": {
                      "isOptional": false,
                      "description": "Password for the web UI",
                      "defaultValue": "{{HINDSIGHT_CP_ACCESS_KEY}}"
                    },
                    "HINDSIGHT_CP_DATAPLANE_API_KEY": {
                      "isOptional": false,
                      "description": "API key the UI uses to talk to the API",
                      "defaultValue": "${{hindsight-api.HINDSIGHT_API_TENANT_API_KEY}}"
                    },
                    "HINDSIGHT_CP_DATAPLANE_API_URL": {
                      "isOptional": false,
                      "description": "Hindsight API over the private network",
                      "defaultValue": "http://${{hindsight-api.RAILWAY_PRIVATE_DOMAIN}}:8888"
                    }
                  },
                  "networking": {
                    "tcpProxies": {},
                    "serviceDomains": {
                      "<hasDomain>:9999": {
                        "port": 9999
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "hindsight-api",
      "method": "GET",
      "path": "/health",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 3,
    "needs_volume": true
  },
  "generated_at": "2026-09-25T16:14:54.488Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-25T13:37:27.117Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_b45014c93d854e35824e",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 58,
    "typical_build_seconds": 0,
    "typical_start_seconds": 10,
    "slowest_service": "hindsight-ui"
  }
}
