Skip to main content
Status: Live in Playground · Try it: synap.maximem.ai/playground Open the playground and pick AI Companion to see the reference implementation. (This recipe replaces the previous Tinder Dating Support example.)
A personal companion that pays attention. It learns how the user likes to be talked to, what’s going on in their life, what they care about, and what’s off-limits, and brings that context forward conversation after conversation without making the user repeat themselves.

What you’ll build

A conversational agent that:
  • Tracks personal context: name, pronouns, life events, ongoing situations, communication style
  • Adapts tone to the user (formal vs casual, brief vs warm, emoji vs plain)
  • Respects boundaries: topics the user has marked off-limits stay off-limits
  • Holds threads across sessions: picks up open conversations without recap prompts
Est. build time: 20-30 minutes. This is the simplest recipe in the Cookbook by surface area, but the highest-leverage memory.

When to use this recipe

Build this if:
  • The product is a 1:1 conversational experience (companion, journaling buddy, lifestyle assistant)
  • Personalization across sessions is the core value, not tool execution
  • The user owns their context: strict per-user isolation
  • You want minimal tools; the memory does the heavy lifting

Architecture at a glance

Memory is the agent. Tools are optional.

Stack

Prerequisites

  • A Synap API key. See Authentication
  • Python: Python 3.11+
  • TypeScript: Node 18+ and Python 3.11+ on the host
TypeScript recipe runs on Node only. Pin Next.js route handlers to export const runtime = "nodejs". See Installation → JavaScript / TypeScript SDK.

Install

Configure

Build it

1. Identity & scoping

  • customer_id = "companion": single tenant (your app)
  • user_id = <stable user ID>: strict per-user isolation; no cross-user leakage
  • conversation_id = <session UUID>: one per app session
Use a long-lived conversation_id (per app install, not per app open) if you want the companion to feel like one continuous relationship rather than a series of standalone chats.
conversation_id, user_id, and customer_id must be valid UUIDs. Generate ids with crypto.randomUUID() (JS) or str(uuid.uuid4()) (Python), as shown below.

2. System prompt

The prompt is most of the work here: it shapes how memory gets used.
System prompt

3. Wire memory + LLM

4. The “forget” hook

A trust-grade companion needs a way to forget. Expose this from your app.
Wire this to a user-facing “forget what we talked about Mondays” or “delete everything about my ex” affordance. Trust in a companion app is mostly about giving users this control.

Run & verify

Day 1
Day 8 (fresh session, same user)
Day 14

Customize / extend

  • Voice channel → adapt this for phone using Voice Concierge. Tone matters even more in voice.
  • Wellness flavor → if the companion is goal-driven (workouts, sleep, journaling), see AI Coach for the goal-tracking shape.
  • Multi-modal → image generation, voice notes, photo recognition: all stack on top; memory is unchanged.
  • End-to-end encryption → memories at rest aren’t encrypted per-user by default. If your trust model requires it, encrypt the document field client-side before calling memories.create.

Troubleshooting

Companion forgets things the user told it last week
  • Confirm ingestion is firing. Log inside the asyncio.create_task block during development: the fire-and-forget pattern swallows errors silently.
  • Increase maxResults in the search adapter so important memories aren’t crowded out.
Companion volunteers sensitive memories unprompted
  • Sharpen the system prompt’s “never volunteer unprompted” line.
  • Consider tagging sensitive memories with metadata.sensitivity = "high" and filtering them out of default search.
Tone drift over a long session
  • Long histories can let the model regress to LLM-default voice. Re-inject the user’s tone preference into the system prompt at the start of each session, pulled from a “communication-style” memory.