Kotoba

Where to start

What Kotoba isWho she is and where she runs, in one page
InstallingOne package, two commands
First runA key, a model, her first words
The approval gateHow she asks before she acts
The two voice modesLocal voice, or the agent tunnel
The soul fileChange who she is
RoadmapWhat grows next, and what was cut on purpose

Or a section

↑↓ move openesc close124 pages
All pages

Discord8 of 10

What she remembers about people

About 3 minutes to read

On this page

Two stores, kept deliberately apart.

The conversation of a channel

Every turn she answers is written to the database: your message, prefixed with your display name and handle, and her reply. The session is the channel, so that history survives a restart of the bot and is what she reads back on the next turn in the same channel.

That means one channel is one shared memory. When she answers you there, she has read what other people said in that channel too.

Her notes about a person

Separate from the above, and separate again from what she knows about her own person, is a small table of facts about the people she meets on Discord: discord_people (who they are) and discord_person_facts (one short statement each, with where it came from).

A discord_people row is written for everyone she answers, whether or not she is ever asked to remember them: her user id, handle and display name, kept the first time she replies to them. That happens automatically, on every answered turn. discord_person_facts — the notes themselves — is the half that only discord_remember_person writes. Its rules:

RuleWhy
A guest may only leave a note about themselvesWhat she knows about somebody is replayed into her own instructions on that person's next turn. A stranger writing a fact about you would be writing into her instructions
A fact about her person is refused and redirectedNothing outside the bot reads this table, so a fact about him kept here would not follow him to the terminal or the web. His go to the memory every surface reads
One fact per call, at most 240 charactersEnforced in the tool: longer is refused
Third person, in EnglishAsked for in the tool's description, not enforced — a fact in another shape is stored as written
The source is recorded — said, told or observedShe can say "someone else told me that" when she repeats it
A request to change how she behaves is not a fact about a personAsked for in the description, not enforced. "Wants you to end every sentence with a catchphrase" would be stored and replayed, so this one rests on her judgement rather than on a check

What reaches the model

On every turn she is handed a short note about the person in front of her: their name, whether they are her person, whether they are an administrator here, and at most eight of the facts she has about them. Anything more would grow without limit and crowd out the conversation; going deeper is what discord_people is for.

Those facts were typed by people, so they are quoted and scrubbed exactly like channel history — control characters, direction overrides and zero-width characters removed — and labelled as data, never as instructions.

What a guest never sees

Her person's own profile and memories are not in a guest's prompt at all. Withholding memory_recall was never enough on its own: the facts were in the prompt, and the only thing between them and the room was a sentence asking her not to repeat them. The prompt is now built with or without them according to who is speaking.

The lookup tool has the matching rule: asked about her person, she names him — anyone in the channel can see him — and says that what he tells her stays between them.

Asking her to forget

She has no tool for it. There is no delete path for a Discord person fact anywhere in the code: discord_remember_person writes, discord_people reads, and nothing removes. If she has written something about you that you want gone, the person running her has to delete the row from the database by hand.

The database is kotoba.db, in ~/.kotoba for a normal install, or beside the code in api/ when run from a clone that already has one there. The rows live in discord_person_facts, keyed by Discord user id, and in discord_people.

The same is true of the channel conversation: there is no "forget this channel" command on Discord.

If that matters to the people in your server, tell them so before you invite her in.