{
  "manifest_version": "1.0.0",
  "template": {
    "id": "6b1adb22-4c81-42c1-8112-28bdf7f96e90",
    "slug": "mem0-self-hosted-1",
    "name": "Mem0 self-hosted",
    "description": "Private AI memory platform with dashboard and persistent pgvector storage.",
    "url": "https://railway.com/deploy/mem0-self-hosted-1",
    "upstream": {
      "repo_url": "https://github.com/tech-progress/railway-template-mem0"
    }
  },
  "services": [
    {
      "name": "Mem0 Dashboard",
      "source": {
        "repo": "https://github.com/tech-progress/railway-template-mem0"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "Mem0 PostgreSQL",
      "source": {
        "image": "pgvector/pgvector:pg17@sha256:7ae6051efd0e60444282c27c7e141af07f322ce033300e727a49c3dd11075e38"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "Mem0 API",
      "source": {
        "repo": "https://github.com/tech-progress/railway-template-mem0"
      },
      "needs_volume": true,
      "volume_mount_path": "/app/history",
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "Mem0 Dashboard",
      "description": "Dashboard HTTP port used by Railway routing and health checks.",
      "secret": false,
      "strategy": "default",
      "default": "3000"
    },
    {
      "key": "API_INTERNAL_URL",
      "service": "Mem0 Dashboard",
      "description": "Private API URL used by dashboard server-side requests.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "NEXT_PUBLIC_API_URL",
      "service": "Mem0 Dashboard",
      "description": "Public API URL used by the browser.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "NEXT_PUBLIC_INSTANCE_NAME",
      "service": "Mem0 Dashboard",
      "description": "Display name shown in the dashboard.",
      "secret": false,
      "strategy": "default",
      "default": "Mem0"
    },
    {
      "key": "PGDATA",
      "service": "Mem0 PostgreSQL",
      "description": "PostgreSQL data directory inside the Railway volume.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Mem0 PostgreSQL",
      "description": "Database used for vectors; the API creates a separate mem0_app database for users and settings.",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Mem0 PostgreSQL",
      "description": "PostgreSQL role used by Mem0.",
      "secret": false,
      "strategy": "default",
      "default": "mem0"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Mem0 PostgreSQL",
      "description": "Generated password for the private pgvector database.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "PORT",
      "service": "Mem0 API",
      "description": "HTTP port used by Railway routing and health checks.",
      "secret": false,
      "strategy": "default",
      "default": "8000"
    },
    {
      "key": "JWT_SECRET",
      "service": "Mem0 API",
      "description": "Generated secret that signs dashboard access and refresh tokens.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "APP_DB_NAME",
      "service": "Mem0 API",
      "description": "Database used for Mem0 users, API keys, settings, and request logs.",
      "secret": false,
      "strategy": "default",
      "default": "mem0_app"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Mem0 API",
      "description": "Reference to the vector database name.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "ADMIN_API_KEY",
      "service": "Mem0 API",
      "description": "Generated bootstrap API key for administrative and programmatic access.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "AUTH_DISABLED",
      "service": "Mem0 API",
      "description": "Keep false on Railway so API and dashboard authentication remain enabled.",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "DASHBOARD_URL",
      "service": "Mem0 API",
      "description": "Public dashboard origin allowed by the API CORS policy.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "POSTGRES_HOST",
      "service": "Mem0 API",
      "description": "Private Railway hostname of the pgvector service.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_PORT",
      "service": "Mem0 API",
      "description": "Private PostgreSQL port.",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Mem0 API",
      "description": "Username reference for the private pgvector service.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "MEM0_TELEMETRY",
      "service": "Mem0 API",
      "description": "Disables upstream anonymous onboarding telemetry by default.",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "OPENAI_API_KEY",
      "service": "Mem0 API",
      "description": "Required provider key for memory extraction and embeddings.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "HISTORY_DB_PATH",
      "service": "Mem0 API",
      "description": "SQLite memory-history file stored on the Mem0 history volume.",
      "secret": false,
      "strategy": "default",
      "default": "/app/history/history.db"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Mem0 API",
      "description": "Password reference for the private pgvector service.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "MEM0_DEFAULT_LLM_MODEL",
      "service": "Mem0 API",
      "description": "Default OpenAI model for memory extraction.",
      "secret": false,
      "strategy": "default",
      "default": "gpt-4.1-nano-2025-04-14"
    },
    {
      "key": "POSTGRES_COLLECTION_NAME",
      "service": "Mem0 API",
      "description": "pgvector collection used for memory embeddings.",
      "secret": false,
      "strategy": "default",
      "default": "memories"
    },
    {
      "key": "REQUEST_LOG_RETENTION_DAYS",
      "service": "Mem0 API",
      "description": "Retention target used by Mem0's request-log pruning command.",
      "secret": false,
      "strategy": "default",
      "default": "30"
    },
    {
      "key": "MEM0_DEFAULT_EMBEDDER_MODEL",
      "service": "Mem0 API",
      "description": "Default OpenAI embedding model for new memories and searches.",
      "secret": false,
      "strategy": "default",
      "default": "text-embedding-3-small"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "mem0-self-hosted-1"
      }
    },
    "cli": "railway deploy --template mem0-self-hosted-1",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "6b1adb22-4c81-42c1-8112-28bdf7f96e90",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "1fd0692e-d55a-4f60-96b4-b003bc835e6a": {
                  "icon": null,
                  "name": "Mem0 Dashboard",
                  "build": {
                    "builder": "DOCKERFILE",
                    "watchPatterns": [
                      "/**",
                      "!/FINDINGS.md"
                    ],
                    "dockerfilePath": "Dockerfile.dashboard"
                  },
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/api/health",
                    "restartPolicyType": "ON_FAILURE",
                    "healthcheckTimeout": 300,
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "tech-progress/railway-template-mem0",
                    "branch": "release-v1",
                    "rootDirectory": "/"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Dashboard HTTP port used by Railway routing and health checks.",
                      "defaultValue": "3000"
                    },
                    "API_INTERNAL_URL": {
                      "isOptional": false,
                      "description": "Private API URL used by dashboard server-side requests.",
                      "defaultValue": "http://${{Mem0 API.RAILWAY_PRIVATE_DOMAIN}}:8000"
                    },
                    "NEXT_PUBLIC_API_URL": {
                      "isOptional": false,
                      "description": "Public API URL used by the browser.",
                      "defaultValue": "https://${{Mem0 API.RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "NEXT_PUBLIC_INSTANCE_NAME": {
                      "isOptional": false,
                      "description": "Display name shown in the dashboard.",
                      "defaultValue": "Mem0"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {
                        "port": 3000
                      }
                    }
                  }
                },
                "4d227065-5baa-4508-a052-f58cdbf48c73": {
                  "icon": null,
                  "name": "Mem0 PostgreSQL",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "healthcheckTimeout": null,
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "pgvector/pgvector:pg17@sha256:7ae6051efd0e60444282c27c7e141af07f322ce033300e727a49c3dd11075e38"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "PostgreSQL data directory inside the Railway volume.",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Database used for vectors; the API creates a separate mem0_app database for users and settings.",
                      "defaultValue": "postgres"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "PostgreSQL role used by Mem0.",
                      "defaultValue": "mem0"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Generated password for the private pgvector database.",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "4d227065-5baa-4508-a052-f58cdbf48c73": {
                      "sizeMB": 5000,
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                },
                "64e3cb31-1023-463f-808c-7342a96f17e6": {
                  "icon": null,
                  "name": "Mem0 API",
                  "build": {
                    "builder": "DOCKERFILE",
                    "watchPatterns": [
                      "/**",
                      "!/FINDINGS.md"
                    ],
                    "dockerfilePath": "Dockerfile.api"
                  },
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/docs",
                    "restartPolicyType": "ON_FAILURE",
                    "healthcheckTimeout": 300,
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "tech-progress/railway-template-mem0",
                    "branch": "release-v1",
                    "rootDirectory": "/"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "HTTP port used by Railway routing and health checks.",
                      "defaultValue": "8000"
                    },
                    "JWT_SECRET": {
                      "isOptional": false,
                      "description": "Generated secret that signs dashboard access and refresh tokens.",
                      "defaultValue": "{{JWT_SECRET}}"
                    },
                    "APP_DB_NAME": {
                      "isOptional": false,
                      "description": "Database used for Mem0 users, API keys, settings, and request logs.",
                      "defaultValue": "mem0_app"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Reference to the vector database name.",
                      "defaultValue": "${{Mem0 PostgreSQL.POSTGRES_DB}}"
                    },
                    "ADMIN_API_KEY": {
                      "isOptional": false,
                      "description": "Generated bootstrap API key for administrative and programmatic access.",
                      "defaultValue": "{{ADMIN_API_KEY}}"
                    },
                    "AUTH_DISABLED": {
                      "isOptional": false,
                      "description": "Keep false on Railway so API and dashboard authentication remain enabled.",
                      "defaultValue": "false"
                    },
                    "DASHBOARD_URL": {
                      "isOptional": false,
                      "description": "Public dashboard origin allowed by the API CORS policy.",
                      "defaultValue": "https://${{Mem0 Dashboard.RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "POSTGRES_HOST": {
                      "isOptional": false,
                      "description": "Private Railway hostname of the pgvector service.",
                      "defaultValue": "${{Mem0 PostgreSQL.RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "POSTGRES_PORT": {
                      "isOptional": false,
                      "description": "Private PostgreSQL port.",
                      "defaultValue": "5432"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Username reference for the private pgvector service.",
                      "defaultValue": "${{Mem0 PostgreSQL.POSTGRES_USER}}"
                    },
                    "MEM0_TELEMETRY": {
                      "isOptional": false,
                      "description": "Disables upstream anonymous onboarding telemetry by default.",
                      "defaultValue": "false"
                    },
                    "OPENAI_API_KEY": {
                      "isOptional": false,
                      "description": "Required provider key for memory extraction and embeddings.",
                      "defaultValue": "{{OPENAI_API_KEY}}"
                    },
                    "HISTORY_DB_PATH": {
                      "isOptional": false,
                      "description": "SQLite memory-history file stored on the Mem0 history volume.",
                      "defaultValue": "/app/history/history.db"
                    },
                    "OPENAI_BASE_URL": {
                      "isOptional": true,
                      "description": "Optional OpenAI-compatible API base URL; leave blank for OpenAI.",
                      "defaultValue": ""
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Password reference for the private pgvector service.",
                      "defaultValue": "${{Mem0 PostgreSQL.POSTGRES_PASSWORD}}"
                    },
                    "MEM0_DEFAULT_LLM_MODEL": {
                      "isOptional": false,
                      "description": "Default OpenAI model for memory extraction.",
                      "defaultValue": "gpt-4.1-nano-2025-04-14"
                    },
                    "POSTGRES_COLLECTION_NAME": {
                      "isOptional": false,
                      "description": "pgvector collection used for memory embeddings.",
                      "defaultValue": "memories"
                    },
                    "REQUEST_LOG_RETENTION_DAYS": {
                      "isOptional": false,
                      "description": "Retention target used by Mem0's request-log pruning command.",
                      "defaultValue": "30"
                    },
                    "MEM0_DEFAULT_EMBEDDER_MODEL": {
                      "isOptional": false,
                      "description": "Default OpenAI embedding model for new memories and searches.",
                      "defaultValue": "text-embedding-3-small"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {
                        "port": 8000
                      }
                    }
                  },
                  "volumeMounts": {
                    "64e3cb31-1023-463f-808c-7342a96f17e6": {
                      "sizeMB": 1000,
                      "mountPath": "/app/history"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "Mem0 Dashboard",
      "method": "GET",
      "path": "/api/health",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 3,
    "needs_volume": true
  },
  "generated_at": "2026-09-20T16:14:49.616Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-20T01:19:45.397Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_d2ca8da5bd524842be06",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 164,
    "typical_build_seconds": 103,
    "typical_start_seconds": 10,
    "slowest_service": "Mem0 Dashboard"
  }
}
