{
  "manifest_version": "1.0.0",
  "template": {
    "id": "cfd63ba9-a964-4f5d-b7f9-504e63f3730f",
    "slug": "hermes-agent-with-hindsight-memory",
    "name": "Hermes Agent with Hindsight Memory",
    "description": "Hermes Agent with self-hosted Hindsight memory. One OpenRouter key for both",
    "url": "https://railway.com/deploy/hermes-agent-with-hindsight-memory",
    "upstream": {
      "image": "nousresearch/hermes-agent:latest"
    }
  },
  "services": [
    {
      "name": "Postgres",
      "source": {
        "image": "pgvector/pgvector:pg17"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "hermes-agent",
      "source": {
        "image": "nousresearch/hermes-agent:latest"
      },
      "needs_volume": true,
      "volume_mount_path": "/opt/data",
      "http": true
    },
    {
      "name": "hindsight-api",
      "source": {
        "image": "ghcr.io/vectorize-io/hindsight-api:0.10.1-slim"
      },
      "needs_volume": false,
      "http": false
    }
  ],
  "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": "hermes-agent",
      "description": "Port Railway routes to and healthchecks (the API server)",
      "secret": false,
      "strategy": "default",
      "default": "8642"
    },
    {
      "key": "API_SERVER_KEY",
      "service": "hermes-agent",
      "description": "Bearer key for the API (generated). Anyone with it can use your agent",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "HERMES_API_URL",
      "service": "hermes-agent",
      "description": "Base URL for OpenAI-compatible clients (model: hermes-agent)",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "HINDSIGHT_MODE",
      "service": "hermes-agent",
      "description": "Use the Hindsight service in this project",
      "secret": false,
      "strategy": "default",
      "default": "local_external"
    },
    {
      "key": "API_SERVER_HOST",
      "service": "hermes-agent",
      "description": "Listen on all interfaces so Railway can route to it",
      "secret": false,
      "strategy": "default",
      "default": "0.0.0.0"
    },
    {
      "key": "API_SERVER_PORT",
      "service": "hermes-agent",
      "description": "API server port",
      "secret": false,
      "strategy": "default",
      "default": "8642"
    },
    {
      "key": "HINDSIGHT_API_KEY",
      "service": "hermes-agent",
      "description": "Key for the Hindsight service",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "HINDSIGHT_API_URL",
      "service": "hermes-agent",
      "description": "Hindsight over the private network",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "HINDSIGHT_BANK_ID",
      "service": "hermes-agent",
      "description": "Memory bank Hermes reads and writes",
      "secret": false,
      "strategy": "default",
      "default": "hermes"
    },
    {
      "key": "API_SERVER_ENABLED",
      "service": "hermes-agent",
      "description": "OpenAI-compatible API on the public domain",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "OPENROUTER_API_KEY",
      "service": "hermes-agent",
      "description": "OpenRouter API key: runs Hermes's model and Hindsight's memory (openrouter.ai/keys)",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "PORT",
      "service": "hindsight-api",
      "description": "Port of the Hindsight API (private network only)",
      "secret": false,
      "strategy": "default",
      "default": "8888"
    },
    {
      "key": "HINDSIGHT_API_HOST",
      "service": "hindsight-api",
      "description": "Listen address",
      "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_LLM_MODEL",
      "service": "hindsight-api",
      "description": "Model for fact extraction (cheap is fine here)",
      "secret": false,
      "strategy": "default",
      "default": "openai/gpt-4o-mini"
    },
    {
      "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": "Uses the OpenRouter key from the hermes-agent service",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "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 that extracts facts from what Hermes stores",
      "secret": false,
      "strategy": "default",
      "default": "openrouter"
    },
    {
      "key": "HINDSIGHT_API_TENANT_API_KEY",
      "service": "hindsight-api",
      "description": "Key Hermes uses to talk to Hindsight (generated)",
      "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",
      "secret": false,
      "strategy": "default",
      "default": "rrf"
    },
    {
      "key": "HINDSIGHT_API_EMBEDDINGS_PROVIDER",
      "service": "hindsight-api",
      "description": "Embeddings through OpenRouter",
      "secret": false,
      "strategy": "default",
      "default": "openrouter"
    },
    {
      "key": "HINDSIGHT_API_MIGRATION_DATABASE_URL",
      "service": "hindsight-api",
      "description": "Migrations fail fast while Postgres restarts",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "HINDSIGHT_API_EMBEDDINGS_OPENROUTER_MODEL",
      "service": "hindsight-api",
      "description": "Embedding model. Don't change it after memories exist",
      "secret": false,
      "strategy": "default",
      "default": "openai/text-embedding-3-small"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "hermes-agent-with-hindsight-memory"
      }
    },
    "cli": "railway deploy --template hermes-agent-with-hindsight-memory",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "cfd63ba9-a964-4f5d-b7f9-504e63f3730f",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "040b48c3-79ee-48fe-b9db-02c00939af48": {
                  "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": {
                    "4723583f-d52a-450c-b854-065a3898b6f8": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                },
                "13617bfc-bf98-4724-9a51-891ca1aeae79": {
                  "icon": "https://raw.githubusercontent.com/NousResearch/hermes-agent/5307e93252ac655cd13fadbd561c0995142138c6/apps/desktop/assets/icon.png",
                  "name": "hermes-agent",
                  "deploy": {
                    "startCommand": "/opt/hermes/docker/entrypoint-dispatch.sh sh -c 'if [ -n \"${HINDSIGHT_API_URL:-}\" ]; then if [ ! -d \"${HERMES_HOME:-/opt/data}/plugins/hindsight\" ]; then hermes plugins install hindsight </dev/null >/tmp/hindsight-plugin.log 2>&1 || cat /tmp/hindsight-plugin.log; fi; hermes config set memory.provider hindsight; fi; if [ -n \"${MODEL:-}\" ]; then hermes config set model \"$MODEL\"; fi; exec hermes gateway run'",
                    "healthcheckPath": "/health",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "nousresearch/hermes-agent:latest"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port Railway routes to and healthchecks (the API server)",
                      "defaultValue": "8642"
                    },
                    "MODEL": {
                      "isOptional": true,
                      "description": "Optional: Hermes's model, e.g. anthropic/claude-sonnet-4.6. Applied on every start; empty keeps Hermes's default (Claude Opus)",
                      "defaultValue": ""
                    },
                    "API_SERVER_KEY": {
                      "isOptional": false,
                      "description": "Bearer key for the API (generated). Anyone with it can use your agent",
                      "defaultValue": "{{API_SERVER_KEY}}"
                    },
                    "HERMES_API_URL": {
                      "isOptional": false,
                      "description": "Base URL for OpenAI-compatible clients (model: hermes-agent)",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}/v1"
                    },
                    "HINDSIGHT_MODE": {
                      "isOptional": false,
                      "description": "Use the Hindsight service in this project",
                      "defaultValue": "local_external"
                    },
                    "API_SERVER_HOST": {
                      "isOptional": false,
                      "description": "Listen on all interfaces so Railway can route to it",
                      "defaultValue": "0.0.0.0"
                    },
                    "API_SERVER_PORT": {
                      "isOptional": false,
                      "description": "API server port",
                      "defaultValue": "8642"
                    },
                    "HINDSIGHT_API_KEY": {
                      "isOptional": false,
                      "description": "Key for the Hindsight service",
                      "defaultValue": "${{hindsight-api.HINDSIGHT_API_TENANT_API_KEY}}"
                    },
                    "HINDSIGHT_API_URL": {
                      "isOptional": false,
                      "description": "Hindsight over the private network",
                      "defaultValue": "http://${{hindsight-api.RAILWAY_PRIVATE_DOMAIN}}:8888"
                    },
                    "HINDSIGHT_BANK_ID": {
                      "isOptional": false,
                      "description": "Memory bank Hermes reads and writes",
                      "defaultValue": "hermes"
                    },
                    "API_SERVER_ENABLED": {
                      "isOptional": false,
                      "description": "OpenAI-compatible API on the public domain",
                      "defaultValue": "true"
                    },
                    "OPENROUTER_API_KEY": {
                      "isOptional": false,
                      "description": "OpenRouter API key: runs Hermes's model and Hindsight's memory (openrouter.ai/keys)",
                      "defaultValue": "{{OPENROUTER_API_KEY}}"
                    },
                    "TELEGRAM_BOT_TOKEN": {
                      "isOptional": true,
                      "description": "Optional: token from @BotFather to chat with Hermes on Telegram",
                      "defaultValue": ""
                    },
                    "TELEGRAM_ALLOWED_USERS": {
                      "isOptional": true,
                      "description": "Telegram user IDs allowed to use the bot, comma-separated (ask @userinfobot for yours)",
                      "defaultValue": ""
                    }
                  },
                  "networking": {
                    "tcpProxies": {},
                    "serviceDomains": {
                      "<hasDomain>:8642": {
                        "port": 8642
                      }
                    }
                  },
                  "volumeMounts": {
                    "a80ec717-7dfb-4897-ad7b-0bb5bf64549e": {
                      "mountPath": "/opt/data"
                    }
                  }
                },
                "f98b0d0a-4fdb-4a15-936b-5603f9f2e717": {
                  "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 of the Hindsight API (private network only)",
                      "defaultValue": "8888"
                    },
                    "HINDSIGHT_API_HOST": {
                      "isOptional": false,
                      "description": "Listen address",
                      "defaultValue": "0.0.0.0"
                    },
                    "HINDSIGHT_API_PORT": {
                      "isOptional": false,
                      "description": "API port",
                      "defaultValue": "8888"
                    },
                    "HINDSIGHT_API_LLM_MODEL": {
                      "isOptional": false,
                      "description": "Model for fact extraction (cheap is fine here)",
                      "defaultValue": "openai/gpt-4o-mini"
                    },
                    "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": "Uses the OpenRouter key from the hermes-agent service",
                      "defaultValue": "${{hermes-agent.OPENROUTER_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 that extracts facts from what Hermes stores",
                      "defaultValue": "openrouter"
                    },
                    "HINDSIGHT_API_TENANT_API_KEY": {
                      "isOptional": false,
                      "description": "Key Hermes uses to talk to Hindsight (generated)",
                      "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",
                      "defaultValue": "rrf"
                    },
                    "HINDSIGHT_API_EMBEDDINGS_PROVIDER": {
                      "isOptional": false,
                      "description": "Embeddings through OpenRouter",
                      "defaultValue": "openrouter"
                    },
                    "HINDSIGHT_API_MIGRATION_DATABASE_URL": {
                      "isOptional": false,
                      "description": "Migrations fail fast while Postgres restarts",
                      "defaultValue": "${{Postgres.DATABASE_URL}}?connect_timeout=10"
                    },
                    "HINDSIGHT_API_EMBEDDINGS_OPENROUTER_MODEL": {
                      "isOptional": false,
                      "description": "Embedding model. Don't change it after memories exist",
                      "defaultValue": "openai/text-embedding-3-small"
                    }
                  },
                  "networking": {
                    "tcpProxies": {},
                    "serviceDomains": {}
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "hermes-agent",
      "method": "GET",
      "path": "/health",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 3,
    "needs_volume": true
  },
  "generated_at": "2026-09-26T16:14:55.683Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-09-25T16:10:49.307Z",
  "success_rate_30d": 0,
  "validation": {
    "last_run_id": "run_9d4444135e8043a3962a",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": false,
        "detail": "SUCCESS,SUCCESS,FAILED"
      }
    ]
  }
}
