---
title: "Deploy cortex-engine"
description: "Persistent memory for AI agents: belief graph, REST API, your own LLM key"
category: "AI/ML"
url: https://railway.com/deploy/cortex-engine
---

# Deploy cortex-engine

Persistent memory for AI agents: belief graph, REST API, your own LLM key

**[Deploy cortex-engine on Railway](https://railway.com/template/cortex-engine)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/cortex-engine/manifest.json

- **Creator:** IDAPIXL's Projects
- **Category:** AI/ML

## Template content

### cortex-engine

- **Source:** Fozikio/cortex-engine
- **Health check:** /health
- **Public domain:** Yes

## Documentation

# Deploy and Host cortex-engine on Railway

cortex-engine is an open-source (MIT) memory engine for AI agents. Instead of a chat log or a plain vector store, it keeps a semantic graph of beliefs, patterns, observations and open questions, gates new claims by prediction error, checks them against what the agent already believes, lets unused memories fade, and consolidates them in a scheduled dream pass. Built by the Fozikio org and used daily by a persistent agent.

## About Hosting cortex-engine

This template runs the engine's REST server from the official Dockerfile with a SQLite store on a Railway volume mounted at /data. Embeddings are computed in-process, so there is no external embedding service to provision. The LLM-backed tools (reflect, digest, dream, query expansion) use an API-key provider: OpenAI by default, or set CORTEX_LLM to anthropic, gemini or kimi and supply the matching key. The server refuses to start without CORTEX_API_TOKEN, which the template generates for you; clients send it as the x-cortex-token header. The health check hits /health. Expect a few seconds of downtime on redeploys while the volume moves to the new deployment.

## Common Use Cases

- Give a single long-running agent memory that survives sessions and hosts
- Share one memory store between several agents or tools over HTTP
- Experiment with belief revision, contradiction detection and consolidation without running Ollama locally

## Dependencies for cortex-engine Hosting

- An LLM API key (OpenAI by default; Anthropic, Gemini or Kimi are supported)
- One Railway volume mounted at /data for the SQLite store

### Implementation Details

Check the deploy, then write the first observation:

    curl -s https://.up.railway.app/health
    curl -s -H "x-cortex-token: " -H "content-type: application/json" -X POST https://.up.railway.app/api/observe -d '{"text":"The deploy worked."}'

MCP clients cannot point .mcp.json at this URL yet: the REST server exposes no MCP transport (tracked in cortex-engine issue #92). Source, docs and the tool reference: https://github.com/Fozikio/cortex-engine

## Why Deploy cortex-engine 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 cortex-engine 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.

## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [stella](https://railway.com/deploy/stella) — Self-host stella with web, API, Postgres, Redis, and object storage.
- [Hermes Agent | OpenClaw Alternative with Dashboard](https://railway.com/deploy/hermes-agent-or-openclaw-alternative-wit) — Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

Open this page in a browser: https://railway.com/deploy/cortex-engine
