feat: add optional conversation title generation on conversation crea…#986
Conversation
🦋 Changeset detectedLatest commit: 069a00e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This comment has been minimized.
This comment has been minimized.
📝 WalkthroughWalkthroughIntroduces a new optional feature to automatically generate conversation titles upon creation. The title is derived from the first user message, respects configurable length and model parameters, and integrates with the Memory configuration and Agent lifecycle through a titleGenerator function passed to the MemoryManager. Changes
Sequence DiagramsequenceDiagram
participant Agent
participant MemoryMgr as MemoryManager
participant Memory
participant LLMSpan as LLM Span
participant Model as Language Model
Agent->>Agent: createConversationTitleGenerator(memory)
Agent->>MemoryMgr: new MemoryManager(..., titleGenerator)
Note over Agent,Model: User message saved to new conversation
MemoryMgr->>MemoryMgr: saveMessage(context, userMessage)
MemoryMgr->>MemoryMgr: ensureConversationExists(context, userId, convId, input)
MemoryMgr->>MemoryMgr: resolveConversationTitle(context, input, "Conversation")
alt generateTitle enabled
MemoryMgr->>LLMSpan: createLLMSpan(op: "generateTitle", label: "Generate Conversation Title")
LLMSpan->>Model: generateText(systemPrompt, firstUserMessage, maxTokens)
Model-->>LLMSpan: generated title text
LLMSpan-->>MemoryMgr: title (sanitized & length-limited)
else generateTitle disabled
MemoryMgr->>MemoryMgr: return fallback title "Conversation"
end
MemoryMgr->>Memory: createConversation(title)
Memory-->>MemoryMgr: conversation created
MemoryMgr-->>Agent: save complete
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying voltagent with
|
| Latest commit: |
069a00e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://136418bc.voltagent.pages.dev |
| Branch Preview URL: | https://feat-conversation-title.voltagent.pages.dev |
…tion #981
PR Checklist
Please check if your PR fulfills the following requirements:
Bugs / Features
What is the current behavior?
What is the new behavior?
fixes (issue)
Notes for reviewers
Summary by cubic
Adds optional auto-generation of conversation titles at creation using the first user message. Titles use the agent’s model by default (or an override), respect max length, and align with Linear issue #981.
New Features
Migration
Written for commit 069a00e. Summary will update on new commits.
Summary by CodeRabbit
Release Notes
New Features
generateTitleoption in Memory construction.Documentation
✏️ Tip: You can customize this high-level summary in your review settings.