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.
Tool Summary
Section titled “Tool Summary”| Field | Value |
|---|---|
| Tool name | get_contact_memory |
| Permissions | Contact:Instance:View + ContactNote:Collection:List |
| Direction | Read-only |
| UI label | ”Loading contact memory” |
The tool takes a single parameter:
{ "contact_id": "uuid — the contact whose memory to retrieve"}Output
Section titled “Output”{ "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.
Permission Gating
Section titled “Permission Gating”The tool is only registered when the user’s session has both:
- Contact view permission (same gate as
get_contact_details) ContactNote:Collection:Listpermission
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.
System Prompt Workflows
Section titled “System Prompt Workflows”When get_contact_memory is available, the system prompt builder injects two workflow blocks that guide the assistant to load memory proactively.
SMS Drafting
Section titled “SMS Drafting”Memory is loaded before conversation history so the assistant has full context when composing:
- Load contact memory with
get_contact_memory - Load recent conversation with
get_contact_messages - Compose the message using the memory note, conversation context, and user instructions
- Preview with
send_sms(confirmed=false)
Contact Analysis
Section titled “Contact Analysis”When analyzing or recommending for a contact:
- Load
get_contact_memoryto ground in the contact’s saved context - Optionally load
get_contact_messagesif the request depends on recent outreach or tone - Base analysis and recommendations on the memory note plus user-provided context
Tool Result Summary
Section titled “Tool Result Summary”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.Implementation Reference
Section titled “Implementation Reference”| File | Purpose |
|---|---|
assistant/tools/contacts/ai_get_contact_memory_tool.rs | Tool builder and handler |
assistant/services/tool_registry_service.rs | Permission-gated registration |
assistant/services/build_system_prompt_service.rs | Workflow injection |
assistant/tool_result_formatter.rs | Summary formatting |
assistant/types/assistant_tool_name_type.rs | GetContactMemory enum variant |