Memory & Context

Most assistants forget everything when the chat closes. LexiChat has two ways to carry things forward: context variables for the handful of facts that are always true about you, and a persistent wiki it writes to and reads back on its own. Both are plain files on your own disk.

compare_arrows Two kinds of memory

They solve different problems and are worth keeping separate.

Context variables The wiki
HoldsA few short facts that rarely changeAnything worth keeping, and as much of it as you like
Who writes itYou, by handThe AI, on its own — or you, in any editor
When it's readEvery message, automaticallyWhen the AI decides it's relevant, by searching
ScopePer profileShared by every profile that has it on
Costs contextA few tokens per fact~560 tokens of instructions, plus whatever it reads

A rule of thumb: if you would put it on a business card, it's a context variable. If it's something you told the assistant once and expect it to remember, it belongs in the wiki.

badge Context variables

Name/value pairs attached to a profile, added to every conversation as facts about you. The AI uses them when they're relevant and stays quiet about them when they aren't — you don't have to keep saying where you live.

Find them in Settings → Profiles, in the profile editor under Context Variables. Add a row, give it a name and a value, save the profile.

Name Value What it saves you
locationGravesend, Kent, UK"What's the weather?" works without naming the town
timezoneEurope/LondonTimes in answers land in your day, not UTC
occupationSoftware consultantExplanations pitched at the right level
telegram_chat_id764986304"Send me a Telegram" needs no ID pasted in
Because they are per profile, a work profile and a personal profile can answer to different facts. They also travel with a profile when you export it — so review them before sharing a profile, the same as you would its credentials.

menu_book The wiki — long-term memory

The wiki is a folder of Markdown pages that outlives any single conversation. Tell LexiChat something worth keeping and it files the fact away without being asked; ask about it weeks later in a brand-new chat and it searches the wiki, reads the page back, and answers from it.

groupPeople — who they are, what you last discussed
eventDates — birthdays, anniversaries, deadlines
checklistLists — todos, projects, things in flight
tunePreferences — how you like things done

toggle_on Turning it on

Memory is off until you enable it. There are two levels:

Global default
In Settings → Tools, listed as 🧠 Persistent Wiki Memory. Sets the behaviour for every profile that hasn't chosen for itself.
Per-profile override
In the profile editor. A profile can switch memory on or off regardless of the global default; leave it unset to follow along.
Useful split: memory on for a personal assistant profile, off for a research or scratch profile that would otherwise fill the wiki with one-off findings.
Not to be confused with the Memory setting on the Defaults tab (Standard / Extended). That one sets the model's context window — 32K or 128K — and has nothing to do with the wiki.

folder_open Where the files live

Plain .md files in a folder you own — no database, no cloud, no sync:

macOS~/Library/Application Support/lexichat/wiki
Linux~/.local/share/lexichat/wiki
Windows%LOCALAPPDATA%\lexichat\wiki

Pages are organised into folders as the AI sees fit — people/alice.md, events/birthdays.md, projects/. Two files are special:

index.md
A one-line entry per page. Read at the start of a conversation to get oriented, and kept current as pages are added.
log.md
A dated line for every change, so you can see what was remembered and when — and undo it if it got something wrong.
Edit any of it by hand. The AI reads whatever is there, so correcting a page in your editor corrects what it believes. Deleting a page makes it forget.

psychology What it does on its own

With memory on, LexiChat is told to do these without being prompted:

  • searchSearch before answering anything about a date, plan, person, project or past conversation — rather than guessing from the current chat alone.
  • saveStore durable facts immediately — a name, a date, a preference, a goal — without waiting to be told to remember it.
  • mergeUpdate rather than duplicate — search first, then patch the existing page instead of creating a second one on the same subject.
  • history_eduLog every change to log.md with the date and a one-line reason.
  • cleaning_servicesTidy up occasionally — a lint pass surfaces empty pages, missing index entries and broken links, which it then fixes.

You can also drive it directly: "remember that my sister's birthday is 3 March", "what do you know about the Hartley project?", or "forget what I told you about the old address".

It decides what's worth keeping. That is the point of it, but it does mean the wiki accumulates things you didn't explicitly ask it to save. log.md is the place to check, and every page is a file you can edit or delete.

build The wiki tools

Enabling memory adds eight tools. You rarely need to name them, but they show up in the trace when you're checking what happened:

Tool What it does
wiki_searchFind pages matching keywords. The usual first step.
wiki_readRead a page back in full.
wiki_listList every page in the wiki.
wiki_writeCreate a page, or replace one outright.
wiki_patchChange part of a page, leaving the rest alone.
wiki_appendAdd to the end of a page — how log.md grows.
wiki_deleteRemove a page.
wiki_lintReport empty pages, missing index entries and broken links.

Every path is confined to the wiki folder — these tools cannot read or write anywhere else on your disk, regardless of what the model asks for.

speed What it costs

Memory isn't free, which is why it's opt-in. With it on, every step of every conversation carries roughly 560 tokens of memory instructions plus the eight tool definitions, before your question contributes anything — and the AI spends real time searching and reading pages.

On a small local model with a tight context window that trade can hurt. Two ways to keep it in hand:

  • check_circleEnable memory only on the profiles that benefit from it, rather than globally.
  • check_circlePrefer context variables for the handful of facts that are always true — a few tokens each, and no searching.

The Debug panel breaks down exactly what each step is carrying, so you can see the cost rather than guess at it.

lock Privacy & portability

Everything here stays on your machine. The wiki is Markdown in a local folder; context variables live in the profile. With a local model, nothing you ask it to remember leaves the computer at all.

backupBack it up by copying the folder — it's just files
edit_noteEdit or correct any page in your usual editor
deleteDelete a page to forget it; delete the folder to forget everything
swap_horizMove it to another machine by copying it across
One caveat if you use a hosted model. When the AI reads a wiki page to answer, that page's contents go to whichever model is answering — the same as anything else in the conversation. If a profile points at a remote endpoint, treat the wiki as things you're willing to send there. Local models keep it entirely on the machine.