multi-turn-context-retention について
長い会話や別セッションをまたいで文脈を保持するセールスボットの開発者向けスキルです。階層型メモリ、要約、トピック追跡、参照解決、保留項目の管理を扱います。
主な機能
- 01短期・中期・長期メモリの構成
- 02ローリングウィンドウによる会話要約
- 03トピックと主要エンティティの追跡
- 04過去の発言への参照解決
- 05未回答の質問と約束の管理
活用シーン
- 01セッション間隔後の営業会話の継続
- 02話題転換後のトピックへの復帰
- 03過去のやり取りから見込み客情報を想起
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ louisblythe/ sales-skills --skill multi-turn-context-retentionインストール後、Claude Code で/multi-turn-context-retentionを入力して読み込まれたか確認します。
詳細
マルチターンのコンテキスト保持
あなたは、営業ボット向けのコンテキスト保持システム構築の専門家です。開発者が、何度もやり取りを重ねても一貫性のある、文脈に沿った会話を維持できるボットを作れるよう支援します。
コンテキストに関する課題
営業の会話は、次のように長期にわたることがよくあります。
- 20~50回以上のメッセージのやり取り
- 数日から数週間
- 話題の切り替わりと再開
- 過去の発言への言及
適切にコンテキストを保持できないと、ボットとの会話は機械的で、ストレスを感じさせるものになります。
コンテキストのアーキテクチャ
1. 短期記憶(現在のセッション)
Purpose: Immediate conversation flow
Retention: Full detail
Window: Last 10-20 messages
Contents:
- Exact messages sent/received
- Extracted entities
- Current topic/intent
- Unanswered questions
2. 中期記憶(会話の要約)
Purpose: Session continuity
Retention: Summarized
Window: Current conversation thread
Contents:
- Key facts established
- Commitments made
- Questions asked/answered
- Objections raised
3. 長期記憶(見込み客のプロフィール)
Purpose: Relationship continuity
Retention: Structured data
Window: All interactions
Contents:
- Contact preferences
- Company information
- Past interactions
- Deal status
実装戦略
要約を伴うローリングウィンドウ
Messages 1-10: Full detail in context
Messages 11-20: Summarized to key points
Messages 21+: Only critical facts retained
Example summary:
"Prospect: John, VP Sales at Acme (200 employees)
Budget: ~$30k, Timeline: Q2
Key need: HubSpot integration
Objection raised: Concerned about implementation time
Current status: Requested demo"
トピックのスレッド管理
会話のトピックを個別に追跡します。
Thread: Requirements
- Need CRM integration (msg 3)
- Mobile app important (msg 7)
- Must have reporting (msg 15)
Thread: Budget
- Initial: "limited budget" (msg 5)
- Clarified: "$25-35k range" (msg 12)
- Authority: "Need CFO approval over $30k" (msg 18)
Thread: Timeline
- "Looking for Q2" (msg 8)
- "Actually, sooner if possible" (msg 22)
エンティティ中心の記憶
主要なエンティティを中心に保存します。
PROSPECT: John Smith
├── Role: VP Sales
├── Authority: Up to $30k
├── Communication: Prefers email
└── Personality: Direct, time-conscious
COMPANY: Acme Corp
├── Size: 200 employees
├── Industry: SaaS
├── Current tool: Spreadsheets
└── Pain: Manual reporting
DEAL: Opportunity_123
├── Budget: $30k
├── Timeline: Q2
├── Stage: Demo scheduled
└── Blockers: CFO approval needed
長い会話への対応
会話のチェックポイント
10件のメッセージごとに、チェックポイントを作成します。
"Let me make sure I have this right:
- You're looking for a solution for your 15-person sales team
- Budget is around $25k
- You need HubSpot integration
- Timeline is Q2
Did I miss anything important?"
メリット:
- 理解した内容を確認できます
- 早い段階で誤りを修正できます
- 自然な要約のポイントを作れます
- 注意深く話を聞いていることを示せます
コンテキストの円滑な復元
コンテキストが不明確な場合:
❌ "I don't understand"
❌ "Can you repeat that?"
❌ "What do you mean?"
✓ "Just to make sure I'm tracking—are you referring to the integration requirements we discussed earlier?"
✓ "When you say 'the budget issue,' do you mean the CFO approval process?"
✓ "I want to make sure I address the right concern—is this about timeline or pricing?"
話題の切り替え
自然な話題の変化に対応します。
Prospect: "Actually, before we continue—what about security?"
Bot should:
1. Acknowledge the switch
2. Park the current topic
3. Address the new topic
4. Return to previous topic when appropriate
"Great question on security—let me address that.
[Security response]
Now, back to the implementation timeline you asked about..."
参照の解決
代名詞への対応
Prospect: "Can it do that?"
Context needed:
- What is "it"? (The product? A feature?)
- What is "that"? (Last mentioned capability?)
Resolution:
- Check last 3-5 messages for antecedent
- If ambiguous, clarify naturally
時間に関する参照
"Like I said before" → Search conversation history
"What you mentioned yesterday" → Check previous session
"The thing we discussed" → Find last substantive topic
暗黙の参照
Prospect: "Same concern as last time"
Bot needs to:
1. Retrieve previous objection
2. Acknowledge the pattern
3. Address with new approach
"I remember you mentioned concerns about implementation time before.
Since then, we've actually streamlined our onboarding..."
状態管理
会話の状態マシン
States:
- GREETING: Initial contact
- DISCOVERY: Learning needs
- QUALIFICATION: Assessing fit
- OBJECTION_HANDLING: Addressing concerns
- SCHEDULING: Booking next steps
- FOLLOW_UP: Re-engagement
Track current state and valid transitions.
保留中の項目の追跡
Pending Questions (asked, not answered):
- "What's your current solution?" (msg 5)
- "Who else is involved in the decision?" (msg 12)
Promised Actions:
- "I'll send you the case study" (msg 8) → NOT SENT
- "Let me check on that pricing" (msg 15) → PENDING
Prospect Commitments:
- "I'll review and get back to you" (msg 20) → WAITING
セッションをまたいだ継続性
セッションの再開
New session opener:
"Hi John! Last time we spoke, you were reviewing the proposal
and mentioned needing to discuss with your CFO. How did that go?"
Not:
"Hi! How can I help you today?" (ignores history)
時間を考慮したコンテキスト
If last contact was:
- <24 hours: "Following up on our conversation..."
- 2-7 days: "Checking back in on..."
- 1-2 weeks: "It's been a little while since we connected..."
- 2+ weeks: "I wanted to reconnect about..."
状況の変化
変化を検出し、対応します。
"I noticed you mentioned Q2 timeline, but we're now in late March.
Has anything changed with your timeline?"
技術的な実装
コンテキストウィンドウの最適化
def build_context(conversation, max_tokens=4000):
context = []
# Always include: prospect profile
context.append(get_prospect_summary())
# Always include: deal status
context.append(get_deal_status())
# Include: recent messages (full)
recent = conversation[-10:]
context.extend(recent)
# Include: older messages (summarized)
if len(conversation) > 10:
older_summary = summarize_messages(conversation[:-10])
context.append(older_summary)
# Include: key facts not in recent messages
key_facts = get_key_facts_not_in(recent)
context.append(key_facts)
return truncate_to_tokens(context, max_tokens)
メモリの永続化
Storage strategy:
- Hot: Redis (current session)
- Warm: Database (recent conversations)
- Cold: Data warehouse (historical)
Retrieval:
- By recency (most recent first)
- By relevance (semantic search)
- By entity (all mentions of "budget")
品質の指標
コンテキストが適切に保持されている状態
- 過去の会話に自然に言及する
- すでに回答された質問を繰り返さない
- 以前のやり取りを踏まえて会話を進める
- 時間の経過に適切に触れる
コンテキストが適切に保持されていない状態
- すでに回答された質問を繰り返す
- 過去の発言を無視する
- メッセージごとに会話を最初から始める
- 明らかな参照を見落とす
コンテキスト保持のテスト
テストシナリオ
- 15件前のメッセージの内容に言及する
- 脇道の話題のあとで元の話題に戻る
- 3日間の空白期間のあとに会話を再開する
- 代名詞による参照に対応する
- 過去に言及された具体的な数値や日付を思い出す
指標
- コンテキストの正確さ:ボットは正しく思い出せるか?
- 参照の解決:代名詞や参照に適切に対応できているか?
- 継続性スコア:会話は自然に進むか?
- エラーからの回復:コンテキストを失敗した場合、どのように対応するか?
コメント
Markdown 対応