{
  "manifest_version": "1.0.0",
  "template": {
    "id": "58e8ec97-9136-41a2-ba61-f5d8eb9a0fe1",
    "slug": "mem0",
    "name": "Mem0 | The Memory Layer for Personalized AI",
    "description": "Self Host Mem0. Give your AI agents persistent memory",
    "url": "https://railway.com/deploy/mem0",
    "upstream": {
      "image": "mem0/mem0-api-server:latest"
    }
  },
  "services": [
    {
      "name": "Mem0",
      "source": {
        "image": "mem0/mem0-api-server:latest"
      },
      "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": "PORT",
      "service": "Mem0",
      "description": "HTTP server listening port",
      "secret": false,
      "strategy": "default",
      "default": "8000"
    },
    {
      "key": "JWT_SECRET",
      "service": "Mem0",
      "description": "JWT token signing secret",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "APP_DB_NAME",
      "service": "Mem0",
      "description": "Application database name",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Mem0",
      "description": "Database name",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "ADMIN_API_KEY",
      "service": "Mem0",
      "description": "API authentication key",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "AUTH_DISABLED",
      "service": "Mem0",
      "description": "Keep authentication enabled",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "POSTGRES_HOST",
      "service": "Mem0",
      "description": "Internal hostname for pgvector service",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_PORT",
      "service": "Mem0",
      "description": "PostgreSQL port",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Mem0",
      "description": "Database username from pgvector",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "MEM0_TELEMETRY",
      "service": "Mem0",
      "description": "Disable telemetry",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "OPENAI_API_KEY",
      "service": "Mem0",
      "description": "OpenAI API key for LLM and embeddings",
      "secret": true,
      "strategy": "default",
      "default": "sk-your-openai-api-key"
    },
    {
      "key": "HISTORY_DB_PATH",
      "service": "Mem0",
      "description": "SQLite history storage path",
      "secret": false,
      "strategy": "default",
      "default": "/app/history/history.db"
    },
    {
      "key": "PYTHONUNBUFFERED",
      "service": "Mem0",
      "description": "Unbuffered Python output for logs",
      "secret": false,
      "strategy": "default",
      "default": "1"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Mem0",
      "description": "Database password from pgvector",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "MEM0_DEFAULT_LLM_MODEL",
      "service": "Mem0",
      "description": "LLM model for memory extraction",
      "secret": false,
      "strategy": "default",
      "default": "gpt-4.1-nano-2025-04-14"
    },
    {
      "key": "PYTHONDONTWRITEBYTECODE",
      "service": "Mem0",
      "description": "Skip .pyc file generation",
      "secret": false,
      "strategy": "default",
      "default": "1"
    },
    {
      "key": "MEM0_DEFAULT_EMBEDDER_MODEL",
      "service": "Mem0",
      "description": "Embedding model for vector search",
      "secret": false,
      "strategy": "default",
      "default": "text-embedding-3-small"
    },
    {
      "key": "PGDATA",
      "service": "pgvector",
      "description": "Data directory subdirectory",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "POSTGRES_DB",
      "service": "pgvector",
      "description": "Database name",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "POSTGRES_USER",
      "service": "pgvector",
      "description": "Database username",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "RAILWAY_RUN_UID",
      "service": "pgvector",
      "description": "Run as root for volume permissions",
      "secret": false,
      "strategy": "default",
      "default": "0"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "pgvector",
      "description": "Database password",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "mem0"
      }
    },
    "cli": "railway deploy --template mem0",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "58e8ec97-9136-41a2-ba61-f5d8eb9a0fe1",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "cd5a800f-374c-41bd-b713-0ecae5d19e07": {
                  "icon": "https://raw.githubusercontent.com/mem0ai/mem0/main/docs/logo/favicon.png",
                  "name": "Mem0",
                  "deploy": {
                    "startCommand": "/bin/sh -c 'pip install psycopg-binary && mkdir -p /app/history && alembic upgrade head && uvicorn main:app --host 0.0.0.0 --port 8000'",
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "mem0/mem0-api-server:latest"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "HTTP server listening port",
                      "defaultValue": "8000"
                    },
                    "JWT_SECRET": {
                      "isOptional": false,
                      "description": "JWT token signing secret",
                      "defaultValue": "{{JWT_SECRET}}"
                    },
                    "APP_DB_NAME": {
                      "isOptional": false,
                      "description": "Application database name",
                      "defaultValue": "postgres"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Database name",
                      "defaultValue": "postgres"
                    },
                    "ADMIN_API_KEY": {
                      "isOptional": false,
                      "description": "API authentication key",
                      "defaultValue": "{{ADMIN_API_KEY}}"
                    },
                    "AUTH_DISABLED": {
                      "isOptional": false,
                      "description": "Keep authentication enabled",
                      "defaultValue": "false"
                    },
                    "POSTGRES_HOST": {
                      "isOptional": false,
                      "description": "Internal hostname for pgvector service",
                      "defaultValue": "${{pgvector.RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "POSTGRES_PORT": {
                      "isOptional": false,
                      "description": "PostgreSQL port",
                      "defaultValue": "5432"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Database username from pgvector",
                      "defaultValue": "${{pgvector.POSTGRES_USER}}"
                    },
                    "MEM0_TELEMETRY": {
                      "isOptional": false,
                      "description": "Disable telemetry",
                      "defaultValue": "false"
                    },
                    "OPENAI_API_KEY": {
                      "isOptional": false,
                      "description": "OpenAI API key for LLM and embeddings",
                      "defaultValue": "sk-your-openai-api-key"
                    },
                    "HISTORY_DB_PATH": {
                      "isOptional": false,
                      "description": "SQLite history storage path",
                      "defaultValue": "/app/history/history.db"
                    },
                    "PYTHONUNBUFFERED": {
                      "isOptional": false,
                      "description": "Unbuffered Python output for logs",
                      "defaultValue": "1"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Database password from pgvector",
                      "defaultValue": "${{pgvector.POSTGRES_PASSWORD}}"
                    },
                    "MEM0_DEFAULT_LLM_MODEL": {
                      "description": "LLM model for memory extraction",
                      "defaultValue": "gpt-4.1-nano-2025-04-14"
                    },
                    "PYTHONDONTWRITEBYTECODE": {
                      "isOptional": false,
                      "description": "Skip .pyc file generation",
                      "defaultValue": "1"
                    },
                    "MEM0_DEFAULT_EMBEDDER_MODEL": {
                      "description": "Embedding model for vector search",
                      "defaultValue": "text-embedding-3-small"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  }
                },
                "e21746f7-bc5e-4d3d-9d8f-b07668a0ea80": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/postgres.svg",
                  "name": "pgvector",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "pgvector/pgvector:pg16"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Data directory subdirectory",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Database name",
                      "defaultValue": "postgres"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Database username",
                      "defaultValue": "postgres"
                    },
                    "RAILWAY_RUN_UID": {
                      "isOptional": false,
                      "description": "Run as root for volume permissions",
                      "defaultValue": "0"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Database password",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "e21746f7-bc5e-4d3d-9d8f-b07668a0ea80": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-21T22:14:44.200Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-09-20T13:12:00.466Z",
  "success_rate_30d": 0,
  "validation": {
    "last_run_id": "run_cc3cb9b92c9f4d8eaf85",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": false,
        "detail": "FAILED,SUCCESS"
      }
    ]
  }
}
