Memory
Loach can remember lasting facts about you - your role, the projects you work on, how you like answers - and bring them into later chats. There are two kinds: Space memory, kept separately for each Space, and global memories, which follow you into every chat. Facts stay in Loach’s local database, and you can review, edit or undo every one of them.
Space memory and global memories
| Space memory | Global memories | |
|---|---|---|
| Switched on with | The Memory switch on the Space’s Settings tab - on for every new Space | Settings → Features → Global memories, or the Pick your defaults step of setup - off by default |
| Learns from | Chats inside that Space | Chats outside any Space |
| Sent with | Chats inside that Space | Every chat, inside or outside a Space |
| Edited in | The Space’s Memory tab | Settings → Features → Manage global memories |
| Switched off | Stops learning; facts already saved are still sent | Stops learning and stops sending |
A chat in a Space gets both lists when global memories are on: the global facts, then the Space’s, with a note to the model that the Space facts win when the two disagree. Space chats never write to the global list - their extractor sees the global facts as read-only, so it doesn’t copy them into the Space.
How facts are captured
After each finished reply, Loach makes a second, hidden call to the same provider and model you’re chatting with and asks it to pick out durable facts about you - things that would still be true, and worth knowing, in an unrelated chat a month from now. It runs in the background once the model is free: while another message is queued or about to be sent, the turn waits. Whenever a reply finishes with the model free - in any chat - the extractor works through every chat with turns waiting, the one that has waited longest first, reading the latest three turns of each. If you send another message while it’s still working, it stops so your reply isn’t slowed down, and the turns it was reading wait for the next run.
- Which chats - a chat in a Space whose memory is on writes to that Space; a chat outside any Space writes to global memories when they’re on. Private Chat never does. Where a turn’s facts go is settled when you send it, so moving the chat to another Space afterwards doesn’t redirect them. Switching that memory off while a turn waits, or while it’s being read, saves nothing from it.
- Only complete replies - a reply you stopped, or one that ended in an error, is skipped. Turns still waiting to be read survive a restart: Loach notes which messages they are (not their text) and picks them up at the next launch, dropping any whose chat was deleted or whose memory is now off.
- Only what you typed - the extractor reads your message and the reply, not the files you attached or the pages Loach fetched for the turn. Text you didn’t write isn’t a fact about you, and it’s exactly where an injected “remember that I…” would hide.
- Facts, not requests - what you ask for (“write me a Python script”) is a task, not a fact about you. The extractor is told to leave tasks out, and Loach also drops any fact that just reports a request (“User requested a config file…”). Most turns produce nothing, and that’s expected.
- No duplicates - a new fact that only rephrases one you already have is dropped. Word order counts, so “prefers A over B” isn’t mistaken for “prefers B over A”, and a negated fact is never treated as a copy of the positive one.
- No secrets - memory is stored in plain text and goes into later prompts, so the extractor is told never to record a password, PIN, API key, access token or any other credential, even one you shared about yourself. Loach also drops any fact it saves or rewrites that looks like one - a key such as
sk-…orghp_…, “my Wi-Fi password is …”, or a long random-looking token. Facts you add yourself aren’t filtered.
Facts that change
The extractor sees the facts it saved before, so when a turn shows one has changed - you moved city, reversed a preference, renamed a project - it rewrites that fact instead of adding a second one that contradicts it, and it removes a fact that no longer holds and has no replacement.
Facts you added yourself, in the editor or with /remember, are read-only to it: it avoids repeating them but never rewrites or removes them. Only you can change those.
One run saves at most five new facts and rewrites or removes at most three existing ones. A fact the extractor saves or rewrites is rejected if it’s longer than 280 characters; facts you type yourself have no length limit.
Undo on every change
Every change the extractor makes shows a toast with the fact and an Undo button, for about seven seconds:
- Saved to memory - a new fact. Undo deletes it.
- Updated memory - a rewritten fact. Undo restores the previous wording.
- Removed memory - a retired fact. Undo puts it back where it was, with its original date.
Rewrites and removals are shown last, so their Undo stays on screen even when the same run also saved new facts.
The memory editor
A Space’s Memory tab and the Global memories dialog (Settings → Features → Manage global memories, which shows the count in brackets) use the same editor:
- Add a memory - type a fact and press Enter or click Add. Unavailable while that memory is switched off.
- Edit - click a fact’s text. Enter or clicking away saves; Esc cancels the edit (in the Global memories dialog too, without closing it).
- Delete - hover a row and click its trash icon. This is immediate, with no undo.
- Search - filter by text. The list shows the newest facts first.
- Saved date and source chat - each row shows when the fact was saved and, if it came from a chat that still exists, that chat’s title. Click it to open the chat.
- Clear all - deletes every fact after a confirmation. With a search typed, the button reads Clear N shown and deletes only the matches. This can’t be undone.
Deleting a chat doesn’t delete the facts learned from it; the row just loses its link.
Saving a fact yourself: /remember
Type /remember <fact> in the composer to save a fact directly. In a chat inside a Space it goes to that Space’s memory, and so it does while a Space is active - one you’re viewing or picked with /space; anywhere else it goes to global memories. It follows the same switches: if that Space’s memory is off, or global memories are off, Loach tells you so - and where to turn it on - and saves nothing.
Two related commands work on the same scope: /list memories shows the facts with a short id each, and /forget <id|query> removes one by its id or by matching text - when several facts match, it lists them so you can re-run it with an id. See Slash commands.
What the model sees
Facts go into the system prompt of each message as short bulleted lists: a --- Global memory --- block and, in a Space, a --- Space memory --- block, after your instructions. Each list sends the newest facts that fit within 60 facts and about 6,000 characters (roughly 1,500 tokens), so a long list can’t crowd a small context window. Older facts stay in the editor, marked not sent, until newer ones are removed. The extractor is shown the same facts, so anything the model is told can still be corrected.
The context-usage bar counts the facts in its Memories row.
Privacy
- Stored locally - facts live in Loach’s local database. They’re included in a backup export and removed by Settings → Data → Erase… (Remove my data or Factory reset); see Data management. Deleting a Space deletes its memory.
- Cloud providers - with an OpenAI-compatible provider, the extraction call (your message, the reply and the facts already saved) goes to that provider like any other request. Global memories go with every chat whichever provider it uses, so a fact learned while talking to a local model also reaches a cloud one.
- Private Chat - never reads or writes memory of either kind.
The extractor is the model you’re chatting with. Very small models often return nothing, or save the wrong things - keep an eye on the toasts while you get a feel for it. If memory isn’t behaving, see Troubleshooting: Spaces & memory.