Korely

Get Started

Korely MCP

Your agent memory as MCP tools, connect with a URL and a key.

Korely MCP exposes your agent memory store over the Model Context Protocol (MCP), so any MCP-capable client (Claude Code, Cursor, Windsurf, VS Code, Codex) can recall and remember through tools. It's a hosted Streamable HTTP endpoint, nothing to install, authenticated by your API key, which starts with kor_live_. What it stores are facts with dates, not a transcript.

This is the agent store, keyed. Korely MCP lives at https://api.korely.ai/agent/mcp and takes a kor_live_ bearer, or an OAuth sign-in (Connect with OAuth). Use exactly this URL: /mcp on the API host is not an MCP server and answers 410.

Quick setup

A key you give an MCP client is one your agent can use through tools, so it must not be able to manage the account: make it on the dashboard's API keys page, without the admin permission. The page ticks memories:read and memories:write and leaves admin off (what each permission opens).

  1. Sign in at agent.korely.ai. New here? Create an account first (how).
  2. Open API Keys, make a key and copy it: it is shown once. On a new account the home page's Create my key card makes the same kind of key.
  3. Use it in your client, below.

A key made on the dashboard lasts 90 days unless you pick another length. The API keys page starts the length field at 90 days. On the Cloud it offers 30, 60, 90 and 180 (a Self-hosted install also offers Never expires); the Expires column shows the date. After that date the key is refused like any key that is not live: the client gets a 401, with the same words for an expired, revoked and unknown key, and the memory stops answering. Nothing in the editor warns you. To avoid it, rotate the key before the date: press Rotate on the key (the button is in the dashboard of 1.0.27 and later; before that, call POST /admin/keys/{key_id}/rotate), copy the new secret (it is shown once) and paste it where the old one is. An expired key cannot be rotated: make a new key instead. The old secret keeps working for a while you choose (24 hours by default), so the editor does not break in between. Each answer of the API carries the date in the header Korely-Key-Expires-At, and the webhooks key.expiring (14 days before) and key.expired tell it too. Key lifetime and rotation has the rules.

Signed up as an agent, with no dashboard login? The key that korely init --agent saves (Sign up as an agent) has the admin permission until you connect it to a dashboard login, which takes it away (the key keeps working). An admin key never goes in a tool your agent can call. Connect the key first, then make the client's key on the API keys page as above.

Point your client at the endpoint with that key as a bearer token:

Terminal window
claude mcp add --transport http korely https://api.korely.ai/agent/mcp \
--header "Authorization: Bearer kor_live_..."

Restart the client and the six Korely tools appear.

For Claude Code, Codex and Cursor, korely init --tool also installs hooks that save each work session to the repository's memory. See Connect a coding assistant.

Connect with OAuth

Some MCP clients (the app you connect from, such as Claude or ChatGPT with a custom connector) do not take a pasted key. They sign you in instead, with the standard sign-in flow called OAuth (see MCP in the Glossary). Korely MCP supports it at the same URL:

https://api.korely.ai/agent/mcp

Before you start: you need a login to the Korely dashboard (the web app at agent.korely.ai). If you made your key with korely init --agent, you have no login yet: sign in to the dashboard once, and on its Account page paste that key under "Bring in a key made without a login". Skip this and the connected app would use a new, empty account.

  1. In your client, add a remote MCP server (some clients call it a custom connector) and paste the URL. Leave the key field empty: after you allow access, Korely gives the client its own key.
  2. When the client asks, sign in to Korely in the browser window it opens, with the method you use for your account.
  3. Korely shows a consent page named after the app. Choose the project the app may use and its permissions (memories:read, memories:write). You can also confine it to some end users. Click Allow.
  4. Back in the client, the six tools listed below are available. Ask it to recall something to check.

The menu names differ from client to client, so follow your client's own guide for the first step, for example Claude's custom connectors guide. Tested by Korely with Claude, ChatGPT, Hermes and Grok. Other clients that support remote MCP with OAuth should work; we have not tested them all.

What the client receives. A key for the project you chose, with only the permissions you allowed (never admin), so it reads and writes that project and nothing else. The key lasts one hour, and the client asks Korely for a new one by itself. If the client goes 90 days without asking, it is disconnected. The memories it writes go to the project you chose.

Disconnect. Each connected app is one row in the API Keys page of the dashboard, named "<app> via OAuth". Revoke that key and the app is disconnected. The app can also disconnect itself.

Key or OAuth? Use OAuth when the client asks you to sign in or cannot take a header. Use the pasted API key for scripts, servers and anything that runs without a person at the keyboard.

Available tools

ToolWhat it does
korely_get_context The recall call. Assembles the end user's currently valid typed facts most relevant to the query plus the most relevant memories into a prompt-ready block. Call before answering. known_as_of (ISO date) rebuilds the block as Korely could have built it then.
korely_add Remember a decision, preference, or fact, Korely extracts the typed triples. Call after something durable is settled. It lists the facts it extracted; since 1.0.29 each ends with its id, (fct_...).
korely_get_facts Read the typed (subject, predicate, object) facts. as_of reconstructs what was true at a point in time; known_as_of what Korely knew then, so a change told later is not in it; include_invalidated shows superseded facts. Since 1.0.29 each fact ends with its id, (fct_...), the one to pass to korely_correct_fact. Where to read an id.
korely_search Semantic vector search over the raw memories, when you want the source rather than the assembled block. Takes min_score like POST /v1/memories/search. types adds the facts true now: memories (the default), facts or memories,facts, one text where REST takes a list. full_text=true shows each result's whole text instead of its first 280 characters. Each line ends with the id of its result, mem_ or fct_; a fact's id is the one korely_correct_fact takes.
korely_correct_fact Fix a wrong fact. Takes the fact_id (an id of the form fct_..., where to read it) and the new subject, predicate or object; the old fact is closed and a new one is written, never edited in place, so as_of and include_invalidated still show the old one. With close=true it closes the fact instead. Only a current fact can be corrected. The same as PATCH /v1/facts/{id}.
korely_forget_memory Retract a wrong memory by memory_id. It drops out of every read and the facts only it stated are closed; with erase=true it is removed for good. The answer counts the facts closed or removed. The same as DELETE /v1/memories/{id}.

Where to read the id of a fact

korely_correct_fact takes the id of a current fact: fct_ and 32 hex characters. The ids a tool returns are these:

  • korely_search with types=facts (or types=memories,facts): each line ends with the id of its result, mem_ for a memory or fct_ for a fact.
  • korely_get_facts and korely_add: since 1.0.29 each fact they print ends with (fct_...) on its first line, as korely_search prints it. Before 1.0.29 their lines had no id, so an agent that only read the facts had nothing to correct them with.
  • REST: GET /v1/facts returns facts[].id (Get facts).

The server's instructions send an agent to "the ids korely_get_facts and korely_search return", and since 1.0.29 both print them. Before 1.0.29 only korely_search printed one, and the description of korely_correct_fact called them fact_ ids, while the prefix is fct_ (the description says fct_ since 1.0.29). The tool answers No fact with that id. to an id that is not a fct_ id, as it does to one it cannot find.

What each tool takes

A tool refuses an argument it does not list here. The meaning of each argument is the one of its REST twin (Get context, Add a memory, Search, Get facts, Correct a fact, Delete a memory).

ToolNeedsRequiredOptional
korely_get_contextmemories:readqueryuser_id, agent_id, token_budget (800 by default, from 50 to 8000), known_as_of, exclude_sessions, and two for agent notices: reader, changes
korely_addmemories:writecontentuser_id, agent_id, run_id, timestamp, kind (note by default)
korely_searchmemories:readqueryuser_id, agent_id, limit (15 by default, at most 50), min_score, exclude_sessions, types, full_text
korely_get_factsmemories:readnoneuser_id, agent_id, entity, subject, predicate, predicate_family, as_of, include_invalidated, limit (50 by default), known_as_of, exclude_sessions, reader
korely_correct_factmemories:writefact_idsubject, predicate, object, close, at
korely_forget_memorymemories:writememory_iderase

A key without the scope a tool needs is refused for that tool, as it is on REST: a read-only key can recall and cannot add.

korely_search follows the rules of the REST search for types and full_text (Facts and whole text): with the facts, min_score is refused, and a memory comes first at equal rank. With full_text=true an answer holds 8,000 tokens of whole texts at most, the size of the largest korely_get_context block: past that, a result shows what is left (never less than its first 280 characters), its line says [cut], and a NOTE closes the answer. Since 1.0.22 the NOTE names a way to read a cut result whole only when there is one: for a memory, GET /v1/memories/{id}; for a fact no route reads one by its id, so it says only to ask with a smaller limit (before, it named the memory route whatever it had cut). REST's content has no such bound.

Line breaks in a text. korely_search, korely_get_facts and korely_add (the facts it extracted) print one item a line. Every line of a memory's or a fact's text after its first is indented by four spaces, with or without types and full_text, so a line at the margin is always an item of its own: a text cannot add a line that looks like a fact, a score or a NOTE. Only a text with a line break (a line feed, a carriage return, a form feed, or Unicode's line and paragraph separators) reads differently from 1.0.12; the result's id stays at the end of its last line. REST answers JSON and does not change. Since 1.0.16 the context block (korely_get_context, GET /v1/context) follows the same rule for its memories and facts: before, it printed a memory's line breaks as they were.

The first four tools take an optional user_id to scope to one end user. The two write tools, korely_correct_fact and korely_forget_memory, need a key with the memories:write scope, as their REST twins do, and treat the ids of another project (or, for a confined key, of another end user) as not found. A client lists the tools again on its next session to see them. The three read tools, korely_get_context, korely_search and korely_get_facts, also take an optional agent_id, to read one agent's namespace, and korely_get_facts takes predicate (for example works_at), as their REST twins do. korely_add takes an agent_id and a run_id too, as its REST twin does; what it writes when it gets no id is under Writes and identity. Under a burst from one account, korely_search and korely_get_context wait their turn, up to 20 seconds for a slot on the account and up to 20 more for the embedder (about 40 seconds at worst). If the wait runs out, korely_search answers a tool error, search_unavailable, and korely_get_context answers the block it could build, with a note that a part could not be read (an error only when the block is empty). A tool refuses an argument it does not declare, as a REST body refuses an unknown field: it answers error: invalid_request, <name> is not an argument of <tool>; it takes: .... The tools map onto the same REST endpoints the SDK uses, one store, every surface.

Writes and identity

Over REST every write must say whose memory it is, with a user_id or an agent_id (why). The hosted MCP asks nothing more of an assistant, so a client that connected for the first time keeps working.

  • An id passed. korely_add with a user_id, an agent_id or both writes under them, as REST does.
  • No id passed. The memory goes where it always went: the project's shared memory, the one with no end user. Who wrote it is the name the assistant gave when it connected (the protocol requires one). Korely keeps that name on the memory as client and in the audit trail beside the key. Reads, the limits of a confined key and the contradiction check see such a memory as before, so what an assistant wrote before 1.0.19 and after it is one memory. If a client gave no usable name, the write is refused with 422 identity_required.
  • Several agents, one shared memory. Without an agent_id they all count as one writer. Have each pass its own.
  • A confined key. A key confined to several end users still answers 403 and asks for a user_id.
  • The local korely-mcp talks to REST, so it follows the REST rule. Its korely_add sends the user_id or agent_id the model passes; else the server's --user-id, --repo-scope or --agent-id (Python 0.1.29); else the id that korely init --user-id saved for its profile, only with the key saved next to it. With none of them it answers an error and sends nothing, and the tool's description tells the model to pass one. korely init --tool starts it with --repo-scope, which needs nothing more inside a git repository.

Sessions and limits

An MCP client opens a session when it connects. The service keeps these bounds on them (Korely 1.0.31):

  • Open sessions. A key may hold 25 at once and an account 100, whatever its keys. Past that, opening one answers 429 with Retry-After: 1800. End one (DELETE on the MCP address with its mcp-session-id header) or let one go idle.
  • Idle time. A session with no request for 30 minutes is closed; the client connects again.
  • Calls at once. An account runs four tool calls at the same time. A fifth waits its turn and is not refused.
  • Request size. A request body over 4 MiB is refused with 413.
  • Rate limit. Opening a session counts as a request against the account's per-minute limit, like a tool call (Rate limits and quotas).

Verify it

A quick reachability + auth check, the same key as a bearer:

Terminal window
curl https://api.korely.ai/v1/ping \
-H "Authorization: Bearer kor_live_..."
# {"ok": true, "tier": "hobby", "region": "eu-hel1", "processing_region": "global", "scopes": [...]}

In your client, ask it to recall something for a user, then to remember a new fact, then recall again, it should call korely_get_context and korely_add on its own.

Local stdio server (alternative)

Prefer a local process over the hosted endpoint, for a client that only speaks stdio? The first four tools above ship as a stdio server, korely-mcp, in the Python package. It is a thin client, not an offline store: every tool call goes to the REST API at api.korely.ai with your key, so it needs the network like the hosted endpoint. Since 0.1.16 it needs no extra dependency (the [mcp] extra is kept, empty) and runs on Python 3.9 or later:

Terminal window
pip install 'korely-memory[mcp]'

korely-mcp reads the key from ~/.korely/config.json (written by korely init) or KORELY_API_KEY. The same four tools and the same store, with fewer options: the local reading tools take no agent_id (korely_add does), no predicate and no exclude_sessions, and korely_search returns 10 hits by default. The local stdio server does not send types or full_text yet. Its korely_get_context and korely_get_facts take known_as_of from version 0.1.22. On the remote server both tools take reader since 1.0.15 (see Agent notices); the local server does not send it yet. See Vibecoding for the full coding-assistant walkthrough.

What's next