Korely

Coding agents

Codex

Give Codex memory that survives the session. One entry in config.toml connects the Korely MCP server over Streamable HTTP, no OAuth dance, no package to install, just your API key in a header.

Codex forgets everything between sessions. Connect Korely's MCP server and it doesn't: before answering, Codex can pull the active typed facts and relevant memories it has stored, and write new ones as it learns. The intelligence, entity and typed-fact extraction, contradiction resolution, bi-temporal validity, runs server-side. Codex just calls the tools.

Prerequisites

  • A Korely API key (kor_live_...). The hobby tier is free.
  • Codex CLI installed (codex --version). Remote Streamable HTTP MCP servers need a current build.

Add the Korely MCP server

Korely's agent memory is a remote MCP server at https://api.korely.ai/agent/mcp (Streamable HTTP), authenticated with your key in a header, no browser login. Codex reads the key from an environment variable at connect time, so export it first:

Terminal window
export KORELY_API_KEY=kor_live_...
codex mcp add korely \
--url https://api.korely.ai/agent/mcp \
--bearer-token-env-var KORELY_API_KEY

Or add it to ~/.codex/config.toml directly:

[mcp_servers.korely]
url = "https://api.korely.ai/agent/mcp"
bearer_token_env_var = "KORELY_API_KEY"

Then export the key in the same shell before launching Codex:

Terminal window
export KORELY_API_KEY=kor_live_...
codex

It's the env-var name, not the token. bearer_token_env_var takes the name of an environment variable, not the literal key. Codex reads that variable's value at connect time and sends it as Authorization: Bearer <value>. So export KORELY_API_KEY=kor_live_... must run in the same shell/session that launches Codex. The CLI command and the config.toml block are two ways to register the same server, use one, not both.

What Codex can do

Once connected, Codex has four memory tools:

ToolWhat it does
korely_get_contextThe recall path: assembles the active typed facts plus the most relevant memories into a prompt-ready block. Pure retrieval, no model runs on the read path.
korely_addStore a memory. Typed (subject, predicate, object) facts are extracted server-side and contradictions are superseded automatically.
korely_searchSemantic search over stored memories, ranked.
korely_get_factsThe typed bi-temporal facts known about a user, with point-in-time (as_of) queries.

Use it

Now Codex reaches for memory on its own. Tell it something durable and it calls korely_add; ask it something personal and it calls korely_get_context first:

You › Remember that this repo deploys to Hetzner, not Render.
→ korely_add("This repo deploys to Hetzner, not Render")
# next session, days later
You › How do we deploy this?
→ korely_get_context("deploy") → "This repo deploys to Hetzner..."
Codex › This repo deploys to Hetzner (you told me earlier), not Render. ...

Scoping

Every tool accepts an optional user_id so one key can serve many end users, a memory written for "user-a" never surfaces for "user-b". Omit it and everything is scoped to the key's default.

Why this is more than a notepad. Korely doesn't store raw chat logs, it extracts typed facts with bi-temporal validity. When something changes ("we moved off Render"), the old fact is superseded, not duplicated, so korely_get_context returns what's true now, and as_of can still replay what was true before. EU-hosted.

Server not detected? Streamable HTTP remote MCP support landed in a recent Codex release. Older builds gated it behind experimental_use_rmcp_client = true in config.toml, upgrade Codex, or set that flag as a fallback. Also confirm KORELY_API_KEY is exported in the same shell that launches Codex.

Related