Give your app a memory
Store what your users tell you, put what is known in front of your model, and get a plain answer when nothing is known. Every fact keeps the line it came from.
pip install geniffy
1
Remember
mem.memories.add("Priya Nair signs the Lumen renewal, and it comes up in March.")
Priya Nair signs the Lumen renewal.
The Lumen renewal comes up in March 2027. "March", said in October, kept as a date
2
Recall, for your prompt
print(mem.context("Who signs the Lumen renewal?"))
- Priya Nair signs the Lumen renewal. [note, 2026-10-05]
- The Lumen renewal comes up in March 2027. [note, 2026-10-05]
3
Nothing known, nothing made up
mem.ask("What is Priya's home address?")
answer = NoneNothing you have added says that yet, so Geniffy won't guess.
1
Remember
await mem.memories.add({ text: "Priya Nair signs the Lumen renewal, and it comes up in March." });
Priya Nair signs the Lumen renewal.
The Lumen renewal comes up in March 2027. "March", said in October, kept as a date
2
Recall, for your prompt
console.log(await mem.context("Who signs the Lumen renewal?"));
- Priya Nair signs the Lumen renewal. [note, 2026-10-05]
- The Lumen renewal comes up in March 2027. [note, 2026-10-05]
3
Nothing known, nothing made up
const { answer } = await mem.ask("What is Priya's home address?");
answer === nullNothing you have added says that yet, so Geniffy won't guess.
Geniffy recalled 3 memories for this session.
which package manager do we use here?
pnpm. You said so on 1 Oct, working on acme-api:
For acme-api we use pnpm, never npm.
remember that staging deploys wait for a green CI run
Saved to your Geniffy memory.
Each turn is saved as you go. Keys and passwords never leave your laptop.
who reviews the billing changes?
Your memory doesn't say, so I won't guess. Who should I note down?
Your memory, in the tools you already use
One sign-in. The same memory in each. Nothing to install.
In your app
Give each of your users a memory of their own, from Python, TypeScript or any language over HTTPS.
In your AI tools
Claude, ChatGPT, Cursor, VS Code and Codex read and add to one memory, with your approval.
Through your coding agent
Paste one prompt into Claude Code, Cursor or Codex, inside your project. It wires memory into your code.
Agent promptAdd long-term memory to this project with Geniffy (docs: https://docs.geniffy.com).
Add long-term memory to this project with Geniffy (docs: https://docs.geniffy.com).
1. Install the SDK for this project's language: `pip install geniffy` (Python) or `npm install geniffy`
(TypeScript/JavaScript). Read the key from the GENIFFY_API_KEY environment variable; never hard-code
it, never send it to a browser, and never log it.
2. Create one client for the process and reuse it: `Geniffy()` in Python (or `AsyncGeniffy()` in async
code), `new Geniffy()` in TypeScript.
3. Give every end user their own memory. Where this app knows which user a request is for, bind a client
to them once: `mem = client.space(f"user_{user_id}")` in Python, `const mem = client.space(`user_${userId}`)`
in TypeScript, and use only `mem` below that point. A space is created by the first write to it.
Never call memory methods on the unbound client for an end user's data: that writes to the account
owner's own memory, where every user would be mixed together.
4. Save what is worth remembering. After a user tells the app something about themselves, their work or
their plans, call `mem.memories.add(text)`. To save a whole conversation, pass it as the framework
holds it: `mem.memories.add(messages=history)` / `mem.memories.add({ messages: history })`. Files:
`memories.add_file(path)` / `memories.addFile(blob, { filename })` (PDF or Word .docx). Web pages:
`memories.add(url=...)` / `memories.add({ url })`.
5. Use it before the model answers. Open each turn with `mem.briefing(cue=user_message)` (Python) or
`mem.briefing({ cue: userMessage })` (TypeScript) and put the string it returns above the user's message in
the prompt. It is read without a model call, so it is fast enough for every turn. When nothing is known yet
it comes back empty: then put a line saying nothing is known about this user yet, so the model says so
rather than guessing. Where an answer must be checked, use `mem.context(question)` instead, which is never
empty (pass it through as is), or `mem.ask(question)`; when its `answer` is null, say nothing is known.
6. Let users be forgotten. Wherever this app deletes a user or their data, also call
`client.forget_space(f"user_{user_id}")` / `client.forgetSpace(`user_${userId}`)`.
7. Handle errors: catch `AuthenticationError` (a wrong or revoked key) and `UnreadableError` (a file or
link that could not be read; `error.source.error` says why). The SDK already retries busy and network
errors. Log the `X-Request-ID` of any failed call: it finds the call on the Requests page.
8. Add one small test that writes a note into a test space, waits with `mem.sources.wait(id)`, checks that
`mem.briefing(cue=...)` mentions it, then erases the test space.
Keep the change minimal and match this project's style.- APIA session opens where the last one stoppedThe briefing now leads with the status of the work and the next steps in the order they were said, then what happened last time. In the minute after a session ends, before Geniffy has read it, the next one opens on the last words as they were said. A bug stays an open item, never a rule that applies.
- APIDates read the way people mean them"12 March" said in October is next March, "next month" said on 31 January is February, and "tomorrow" said late in the evening in Los Angeles is the next day there. Every date is worked out by code on the person's own clock: send timezone with a save, or set a user's zone once with PUT /v1/timezone. A promise says its day and whether it is overdue.
- APIThe graph shows who is whoEach person, company, project and place now appears as what it is, linked by what memories say about them, such as who works where. A change moves a link instead of adding one, and two records that may be the same person are asked about, never merged on a name alone.
- APIWhen something ends, memory stops serving itA later word that says access was removed, a plan was cancelled or a rule no longer applies now ends the old memory, rule, promise or line of where things stand, and keeps it as history; a rumour or an end still to come changes nothing. GET /v1/changes says what changed since a briefing's cursor.