Skip to content

Contact Memory Tool

The get_contact_memory tool gives the assistant read-only access to a contact’s saved memory note. Memory notes capture preferences, history, and context that the system accumulates over time — the assistant loads them before drafting messages or analyzing contacts.

FieldValue
Tool nameget_contact_memory
PermissionsContact:Instance:View + ContactNote:Collection:List
DirectionRead-only
UI label”Loading contact memory”

The tool takes a single parameter:

{
"contact_id": "uuid — the contact whose memory to retrieve"
}
{
"contact_id": "550e8400-e29b-41d4-a716-446655440000",
"deep_link": "/contacts/550e8400-e29b-41d4-a716-446655440000",
"has_memory": true,
"note_id": "a1b2c3d4-...",
"memory_note": "Prefers texts over calls. Last discussed pricing on March 15.",
"updated_at": "2026-04-02 09:00 UTC"
}

When no memory exists, has_memory is false and note_id, memory_note, and updated_at are null.

The tool is only registered when the user’s session has both:

  1. Contact view permission (same gate as get_contact_details)
  2. ContactNote:Collection:List permission
tool_registry_service.rs
if can_view_contacts
&& has_any_of(session, &[Permission::ContactNote(
ContactNotePermission::Collection(
ContactNoteCollectionPermission::List,
),
)])
{
tools.push(build_get_contact_memory_tool(session.clone()));
}

At execution time, the handler also calls check_contact_access to verify instance-level view permission on the specific contact.

When get_contact_memory is available, the system prompt builder injects two workflow blocks that guide the assistant to load memory proactively.

Memory is loaded before conversation history so the assistant has full context when composing:

  1. Load contact memory with get_contact_memory
  2. Load recent conversation with get_contact_messages
  3. Compose the message using the memory note, conversation context, and user instructions
  4. Preview with send_sms (confirmed=false)

When analyzing or recommending for a contact:

  1. Load get_contact_memory to ground in the contact’s saved context
  2. Optionally load get_contact_messages if the request depends on recent outreach or tone
  3. Base analysis and recommendations on the memory note plus user-provided context

The result formatter classifies get_contact_memory as a detail tool. Summaries include the has_memory flag and updated_at timestamp but exclude the note body to keep conversation history compact.

Tool get_contact_memory loaded contact memory for contact-1: has memory, updated 2026-04-02 09:00 UTC.
FilePurpose
assistant/tools/contacts/ai_get_contact_memory_tool.rsTool builder and handler
assistant/services/tool_registry_service.rsPermission-gated registration
assistant/services/build_system_prompt_service.rsWorkflow injection
assistant/tool_result_formatter.rsSummary formatting
assistant/types/assistant_tool_name_type.rsGetContactMemory enum variant