---
title: "Switch models in Cursor without losing what your agent knows"
slug: switch-models-in-cursor-without-losing-what-your-agent-knows
date: 2026-11-01
author: Semurg
section: how-to
tags: [cursor, mcp, agents, memory, how-to]
summary: Connect Cursor to your own Semurg node once. The memory lives in your node, not in the model, so every model you pick in Cursor reaches the same memory tools, the same facts and the same scope.
status: published
covers: [route:POST /v1/memory/remember, route:POST /v1/memory/recall, route:POST /v1/mcp, mcp:memory_remember, mcp:memory_recall]
constants: [3, 2, 4000, 24.04]
evidence:
  - release:r11.142.20261030.e037138
---
> Last checked on r11.142.20261030.e037138 (30 Oct 2026): every command below ran on a fresh node of that release. The current release is r11.143.20261102.b5a9758 (2 Nov 2026), and the commands have not been re-checked on it yet.

> Tested with `Cursor CLI 2026.10.22` on the release published on 30 October 2026: in a clean container, after the setup below, the CLI's own
> MCP client showed `semurg` ready and listed every Semurg memory tool.[^1] No model ran in that test, so which tool a model chooses to call is not part of what it tested. The
> [agents page](/agents#cursor) shows the release it last ran on.

Cursor lets you pick a different model for each chat, and a new chat starts without anything the last one was told. This page connects
Cursor to a Semurg node on your own machine, so a fact one model is told is a fact another model can ask for.

The reason is one plain sentence: the memory lives in your Semurg node, not in the model. The entry in Cursor's `mcp.json` is the same
whichever model is selected, so every model reaches the same memory tools, the same store and the same scope.

> Diagram cursor-switch: Model A in one Cursor chat remembers a fact through the Semurg memory tools; your node keeps it in the scope cursor-demo on your own disk; in a new chat a different model asks the same scope and gets the fact back.

## Connect Cursor in 3 steps

1. **Start a node on your machine.** The [install page](/install) has the one command; the first node is free. On Ubuntu 24.04 (x86_64), with sudo:

```bash
curl -fsSL https://one.semurg.io/install | sudo bash
```

   Keep the API token it stores, in a file only you can read, and have every new terminal load it:

```bash
mkdir -p ~/.config/semurg
(umask 077; sudo grep '^SEMURG_API_TOKEN=' /etc/semurg/semurg.env | cut -d= -f2- > ~/.config/semurg/token)
echo 'export SEMURG_API_TOKEN="$(cat ~/.config/semurg/token)"' >> ~/.bashrc
export SEMURG_API_TOKEN="$(cat ~/.config/semurg/token)"
```

2. **Tell Cursor where the node is.** Cursor and the Cursor CLI read one file, `~/.cursor/mcp.json`. Add this entry (the file keeps a reference to the token, never the token itself):

```json
{
  "mcpServers": {
    "semurg": {
      "url": "http://127.0.0.1:4000/v1/mcp",
      "headers": {
        "Authorization": "Bearer ${env:SEMURG_API_TOKEN}",
        "X-Semurg-Scope": "cursor-demo"
      }
    }
  }
}
```

3. **Start Cursor from a shell that has the token.** Cursor expands `${env:SEMURG_API_TOKEN}` when it starts, so open the editor, or run the Cursor CLI, from the shell where you exported the token above. To check the connection without any model, run `agent mcp list` (it should show `semurg` ready) and `agent mcp list-tools semurg` (it lists the memory tools). The CLI installs with `curl https://cursor.com/install -fsS | bash`.

The address is `127.0.0.1`, not `localhost`: on Ubuntu `localhost` can resolve to the IPv6 address first, and the node listens on IPv4 loopback only. The `X-Semurg-Scope` header names the memory these chats share: everything below uses the scope `cursor-demo`.

## What the node does with a fact

The node serves nine memory tools; two do the work in this page, remember and recall, and each is one call on your node. Here they are with no model in the loop. The first is the remember call: a fact, and where it came from.

```bash runnable kind=shell-node needs=token
export SEMURG_API_TOKEN=<your token>
curl -sS http://localhost:4000/v1/memory/remember \
  -H "Authorization: Bearer $SEMURG_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"scope": "cursor-demo",
       "source": "cursor chat one",
       "facts": {
         "entities": [{"name": "Dana", "type": "Person"},
                      {"name": "Acme", "type": "Company"}],
         "relations": [{"source": "Dana", "target": "Acme",
                        "type": "WORKS_AT"}]}}'
```

```expect
expect: a JSON answer with "ok": true
assert: json:.ok==true
```

And the second is the recall call, from any client in the same scope, whichever model sits behind it:

```bash runnable kind=shell-node needs=token
export SEMURG_API_TOKEN=<your token>
curl -sS http://localhost:4000/v1/memory/recall \
  -H "Authorization: Bearer $SEMURG_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"scope":"cursor-demo","subject":"Dana"}'
```

```expect
expect: "state": "answered", with the WORKS_AT fact that connects Dana to Acme
assert: json:.ok==true and .state=="answered" and ([..|strings|ascii_downcase|select(contains("acme"))]|length>0)
```

A scope that holds nothing answers that it holds nothing, instead of guessing:

```bash runnable kind=shell-node needs=token
export SEMURG_API_TOKEN=<your token>
curl -sS http://localhost:4000/v1/memory/recall \
  -H "Authorization: Bearer $SEMURG_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"scope":"cursor-demo-empty","subject":"Dana"}'
```

```expect
expect: "state": "nothing_stored" and no items: an empty answer that says it is empty
assert: json:.state=="nothing_stored"
```

## Try it yourself

1. In Cursor, pick a model, open a chat and write: **"Remember that Dana works at Acme. Use the semurg memory tools, scope cursor-demo."** The first time a model uses a tool, Cursor asks your permission.
2. Pick a different model, ideally from another lab, and open a **new chat**, so the new model has none of the earlier conversation.
3. Write: **"Who does Dana work for? Ask the semurg memory first."** The model has only the node to ask, and the node answers from the scope the first chat wrote to.
4. To see the same fact without any model, run the recall call above. It reads the same scope, so it returns the same fact.

A model decides for itself when to call a memory tool, which is why the prompts above say to use it. When nothing stored matches, the node says `nothing_stored`, so a model can tell "I do not know" from a fact.

We are preparing a run of exactly this test, with two models from different labs; when it has been run, the exact models, versions, prompts and tool-call output will be added to this page.

## Why switching models does not lose anything

A model is the part that decides which memory tool to call and writes the answer. The facts are stored by your node, under the scope, with the source each one came from. A new chat, or a different model from a different lab, starts with none of the earlier conversation and asks the node.

## Troubleshooting

- `agent mcp list` does not show `semurg` ready: Cursor expands `${env:SEMURG_API_TOKEN}` from its own environment when it starts, so the variable must be set in the shell that starts it. Export the token again as in the token commands above, then start Cursor again from that shell.
- A tool answers with an authorisation error (`401`): the token is wrong or belongs to another node. Read it again from the node with the token commands above.
- Nothing answers: check that the node is running with `curl -s http://127.0.0.1:4000/api/health`, and use `127.0.0.1` rather than `localhost`.
- A model never reaches for the memory: say so in the prompt, as the prompts above do, and name the scope.

## Next

- [Give your agent persistent memory with MCP in five minutes](/blog/agent-memory-mcp-five-minutes): the nine memory tools and the same calls over plain HTTP.
- [One memory per end user](/blog/one-memory-per-end-user): keep your users apart, and delete one on request.
- [Persistent memory for Claude Code, on your own machine](/blog/claude-code-persistent-memory): the same node from another agent.

*This post was written with AI assistance. Every result in it is checked against a published release or record before the post goes out.*
