
Deploy cortex-engine
Persistent memory for AI agents: belief graph, REST API, your own LLM key
cortex-engine
Just deployed
/data
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.
Template Content
cortex-engine
Fozikio/cortex-engineOPENAI_API_KEY
Your OpenAI API key, used when CORTEX_LLM=openai. For another provider, set CORTEX_LLM and add that provider's key variable as named in the cortex-engine README.
