
Deploy AI Memory
One-click deploy: shared AI agent memory with MCP and authentication.
AI Memory
Just deployed
/data
Deploy and Host AI Memory on Railway
AI Memory is an open-source memory server by Fábio Akita that helps AI coding agents preserve context across sessions. It combines an MCP interface, lifecycle hooks, searchable project knowledge, and Git-backed Markdown history. Connect compatible agents to retain decisions, recover context, and hand off work across tools.
About Hosting AI Memory
This template runs the official AI Memory Docker image with a persistent volume mounted at /data. It exposes HTTP MCP, a browser interface, and hook ingestion for compatible agents. Railway provides HTTPS networking; AI Memory handles browser login and API authentication. A custom start command prepares volume ownership, then runs the server as its unprivileged user. SQLite, configuration, credential state, and Markdown/Git history persist across restarts. Deploy one replica per data directory, configure backups, and connect compatible clients to /mcp. Install supported lifecycle hooks separately to capture session activity automatically. No external PostgreSQL or Redis service is required.
Common Use Cases
- Preserve project decisions and context across AI coding sessions
- Share searchable knowledge between compatible coding agents
- Capture session activity and coordinate supported handoffs across tools
Dependencies for AI Memory Hosting
- Official AI Memory Docker image
- Persistent Railway volume mounted at
/data - Public HTTPS domain and authentication variables
- Compatible MCP clients, with lifecycle hooks for automatic session capture
Documentation: AI Memory GitHub, Installation Guide, Authentication Guide, and Railway Documentation.
Implementation Details
Environment variables
| Variable | Value |
|---|---|
PORT | 49374 |
RAILWAY_RUN_UID | 0 |
AI_MEMORY_AUTH_TOKEN | ${{secret(64, "abcdef0123456789")}} |
AI_MEMORY_ALLOWED_HOSTS | ${{RAILWAY_PUBLIC_DOMAIN}},localhost,127.0.0.1,healthcheck.railway.app |
AI_MEMORY_AUTH__TOKEN_PEPPER | ${{secret(64, "abcdef0123456789")}} |
AI_MEMORY_AUTH__ROOT_USERNAME | admin |
AI_MEMORY_AUTH__SECURE_COOKIE | true |
AI_MEMORY_AUTH__RECOVERY_TOKEN | ${{secret(64, "abcdef0123456789")}} |
AI_MEMORY_AUTH__INITIAL_ROOT_PASSWORD | ${{secret(64, "abcdef0123456789")}} |
Startup permissions: RAILWAY_RUN_UID=0 must be paired with the template’s custom start command. Root prepares the volume; the command then drops privileges and runs AI Memory as UID 1000. Do not remove the privilege-dropping command while keeping this variable enabled.
Storage: Mount and preserve the entire /data directory. Keep AI_MEMORY_AUTH__TOKEN_PEPPER stable across restarts and redeployments; changing it invalidates existing API credentials.
Networking: Point the public HTTPS domain to internal port 49374. Use /web for the browser interface, /mcp for MCP clients, /hook for lifecycle hook ingestion, and /healthz as the healthcheck path.
First login: Open /web, sign in as admin with the generated initial password, and complete the required password change. Remove AI_MEMORY_AUTH__INITIAL_ROOT_PASSWORD afterward. Store the optional recovery token securely.
Agent access: Create individual API credentials instead of sharing the administrative bearer token. Configure MCP registration and supported lifecycle hooks separately.
Scaling and backups: This SQLite-backed deployment requires a single replica per data directory. Scale vertically and configure volume backups; Git history alone does not preserve accounts, credentials, or all operational state.
Why Deploy AI Memory on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying AI Memory on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
For this AI Memory template specifically, keep one replica and scale vertically because it uses SQLite and a persistent volume.
Template created and maintained by Douglas Rubim. AI Memory is developed by Fábio Akita and its contributors.
GitHub: https://github.com/douglasrubims
Template Content
AI Memory
akitaonrails/ai-memory:latest