Conversations
Pass the messages as your framework already holds them. Who said what is kept, so "I prefer mornings" from the user becomes a fact about the user, not about your assistant.
mem.memories.add(messages=history)await mem.memories.add({ messages });curl https://api.geniffy.com/v1/memories \
-H "Authorization: Bearer $GENIFFY_API_KEY" \
-H "X-Geniffy-Space: customer_1042" \
-H "Content-Type: application/json" \
-d '{"messages": [{"role": "user", "content": "I prefer mornings."},
{"role": "assistant", "content": "Noted, I will book you before noon."}]}'- Messages from OpenAI, Anthropic, Gemini, LangChain and the Vercel AI SDK go in as they are:
contentas a string or as a list of blocks or parts, orpartson its own. - System and developer messages are skipped: they are instructions to the model, not something anyone said.
- Up to 500 messages in one call. A conversation is listed as
Conversationunless you give it a title.
Whole sessions, tool calls included
An agent's session is more than what was said. Save it as it goes: the tools your assistant called and what came
back go in too, in whichever shape your framework holds them (OpenAI's tool_calls and tool messages,
Anthropic's tool_use and tool_result blocks, the Vercel AI SDK's tool parts, Gemini's functionCall and
functionResponse, LangChain's tool messages).
run = mem.session(session_id, labels={"project": "checkout"})
run.save(agent_history) # after every turn: only the new turns are sentconst run = mem.session(sessionId, { labels: { project: "checkout" } });
await run.save(agentHistory); // after every turn: only the new turns are sentcurl https://api.geniffy.com/v1/memories \
-H "Authorization: Bearer $GENIFFY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"session": "run-42", "labels": {"project": "checkout"},
"messages": [{"role": "user", "content": "Refunds over 10,000 fail. Find out why."}]}'- Each call adds its turns to one memory for the whole session, however long it gets. Over the API, send only the
turns that are new since your last call;
save()in the SDKs works that out, 500 messages a call. - Facts come only from what people and assistants said. A tool's output is never taken for a fact about anyone; it tells Geniffy what happened, so it can keep where the project stands, the lessons learned and the promises made.
- Keys, tokens, passwords and private keys are removed before anything is kept, and a tool's long output is kept as its start and its end.
- Label each session with its
project(a repository, a customer account, a ticket queue): where things stand is kept per project, and the briefing reads it back by that name. - A short conversation you keep in your own records can go whole instead, under an
external_id: sent again as it grows, only the new turns are learned.
Conversations from the past
When you bring in a conversation that happened before today, say when with said_at: an ISO 8601 date or
time. What it teaches is dated by it, so "we moved the launch to May", said last March, is not taken for
something said this morning, and a newer conversation replaces what an older one said.
from datetime import datetime, timezone
mem.memories.add(messages=history, said_at=datetime(2025, 3, 4, 9, 30, tzinfo=timezone.utc))await mem.memories.add({ messages, saidAt: new Date("2025-03-04T09:30:00Z") });curl https://api.geniffy.com/v1/memories \
-H "Authorization: Bearer $GENIFFY_API_KEY" \
-H "X-Geniffy-Space: customer_1042" \
-H "Content-Type: application/json" \
-d '{"messages": [{"role": "user", "content": "We moved the launch to May."}],
"said_at": "2025-03-04T09:30:00Z"}'- Left out, it was said now. A date alone (
2025-03-04) is taken as the middle of that day, in UTC; a time with a zone is kept as the moment it names. - It works the same for a note, and for each item of a batch. A date in the future is refused, and so is
said_atwith a web page, which is read as it is today.