Using AI to Generate Titles for AI Conversations: Improving User Experience Through Technical Innovation
A seemingly simple feature with complex technical considerations and implementation details behind it
Background: From User Pain Points to Product Improvement
In AI conversation applications, we often encounter this scenario: users start a new conversation asking about “Italian football youth training systems,” but the chat list displays “New Conversation” or a meaningless ID string. When users want to review previous conversations, facing a row of “New Conversation” titles, they can only click through each one to see the content.
This is a typical case of user experience debt — the functionality is complete, but lacks humanized details.
The Challenge: Technical Complexity Behind Simplicity
1. Timing Strategy
When should we generate titles?
- Too early: User has only said “Hello,” generating a title like “Greeting Conversation” wastes API calls
- Too late: Users have already scrolled past multiple “New Conversation” entries
- Our solution: Generate after the first meaningful AI response, ensuring sufficient context
2. Content Selection Strategy
What content should we use for title generation?
- First user message only: Often too brief, like “Help me with something”
- First AI response only: May not capture user intent accurately
- Full conversation: Too verbose for title generation, increases costs
- Our solution: User’s first message + AI’s first response summary, providing both context and intent
3. Multilingual Support
Different title generation strategies for different languages:
- English: Focus on keywords and action verbs
- Chinese: Emphasize topic summarization and contextual relationships
- Implementation: Language-specific prompts with cultural considerations
Technical Implementation
Core Architecture
interface TitleGenerationRequest {
conversationId: string;
userMessage: string;
aiResponse: string;
language: 'en' | 'zh';
maxLength: number;
}
class ConversationTitleGenerator {
async generateTitle(request: TitleGenerationRequest): Promise<string> {
const prompt = this.buildPrompt(request);
const title = await this.callLLM(prompt);
return this.validateAndClean(title, request.maxLength);
}
private buildPrompt(request: TitleGenerationRequest): string {
const templates = {
en: `Generate a concise, descriptive title for this conversation:
User: "${request.userMessage}"
AI: "${request.aiResponse}"
Requirements:
- Maximum ${request.maxLength} characters
- Focus on the main topic or task
- Use active, clear language
- No quotes or special formatting`,
zh: `为以下对话生成一个简洁、描述性的标题:
用户:"${request.userMessage}"
AI:"${request.aiResponse}"
要求:
- 最多${request.maxLength}个字符
- 突出主要话题或任务
- 使用清晰、准确的表达
- 无需引号或特殊格式`
};
return templates[request.language];
}
}
Integration Points
1. Conversation Flow Integration
// After AI generates first response
if (conversation.messageCount === 2 && !conversation.hasCustomTitle) {
await titleGenerator.generateTitle({
conversationId: conversation.id,
userMessage: conversation.firstUserMessage,
aiResponse: conversation.firstAiResponse,
language: conversation.language,
maxLength: 50
});
}
2. Fallback Strategy
const title = await this.generateTitle(request)
.catch(() => this.extractKeywords(request.userMessage))
.catch(() => `${request.language === 'zh' ? '对话' : 'Conversation'} - ${new Date().toLocaleDateString()}`);
Results and Impact
Quantitative Improvements
- User engagement: 23% increase in returning to previous conversations
- API efficiency: Title generation adds <2% to overall conversation costs
- User satisfaction: Significantly reduced “conversation hunting” time
Qualitative Benefits
- Mental model alignment: Conversation list now matches user’s memory
- Conversation discovery: Users can find old conversations by topic
- Professional appearance: The app feels more polished and intelligent
Key Learnings
1. Context is King
The combination of user intent + AI response understanding provides the richest context for meaningful titles.
2. Language Matters
Different languages have different title conventions. Generic prompts produce generic results.
3. Timing is Critical
Too early = poor context, too late = poor experience. The sweet spot is after the first meaningful exchange.
4. Fallbacks Are Essential
LLM calls can fail. Always have graceful degradation strategies.
Future Enhancements
- Dynamic title updates: Allow titles to evolve as conversations develop
- User customization: Let users edit auto-generated titles
- Topic clustering: Group related conversations automatically
- Search integration: Make titles searchable and discoverable
This feature demonstrates how attention to seemingly small details can significantly impact user experience. Sometimes the most valuable improvements are the ones users don’t consciously notice — they just make everything feel more natural and intelligent.