Skip to content

Conversation titles show "user" instead of actual user name #6216

@omi-discord-vector

Description

@omi-discord-vector

Problem

Conversation titles/summaries use generic "user" or "Speaker 0" instead of the user's actual name, even though the system knows it.

Example:

  • Current: "User discussing project with John"
  • Expected: "Aarav discussing project with John"

Root Cause

The conversation structuring prompt in backend/utils/llm/conversation_processing.py (line ~651) doesn't include the user's name. It only uses calendar meeting participant names when available.

Fix

File: backend/utils/llm/conversation_processing.py

Function: get_transcript_structure() (line ~631)

1. Add uid parameter

def get_transcript_structure(
    transcript: str,
    started_at: datetime,
    language_code: str,
    tz: str,
    uid: str,  # ADD THIS
    photos: List[ConversationPhoto] = None,
    calendar_meeting_context: 'CalendarMeetingContext' = None,
) -> Structured:

2. Get user name at start of function

from database.auth import get_user_name

def get_transcript_structure(...):
    # Get user's actual name
    user_name = get_user_name(uid, use_default=True)  # Returns "The User" if no name found
    
    conversation_context = _build_conversation_context(transcript, photos, calendar_meeting_context)
    # ... rest of function

3. Update prompt to include user name (line ~651)

instructions_text = f'''You are an expert content analyzer analyzing content from {user_name}.

IMPORTANT: The user's name is {user_name}. When referring to the user in titles, overviews, or summaries, use their actual name instead of generic "user" or "Speaker 0".

CRITICAL: If CALENDAR MEETING CONTEXT is provided with participant names, you MUST use those names:
- The conversation happened between the named participants
- For the USER specifically, always use "{user_name}"
- Match transcript speakers to participant names

For the title, Write a clear headline (≤ 10 words). When {user_name} is a key participant, include their name (e.g., "{user_name} and John Discuss Q2 Budget").
...
'''

4. Update all callers of get_transcript_structure()

Search for calls and add uid parameter:

cd backend && grep -rn "get_transcript_structure(" --include="*.py"

Likely in:

  • utils/conversations/process_conversation.py
  • Any other conversation processing logic

Impact

Makes all conversation titles/summaries use the user's actual name, significantly improving personalization.

Testing

  1. Create a new conversation
  2. Check the generated title/overview
  3. Verify it uses the user's name (from Firebase Auth or Firestore profile)
  4. If no name is set, should fall back to "The User"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions