Skip to main content

What are Multi-Turn Conversations?

Multi-turn conversations are interactions where the AI remembers previous messages and maintains context:
The AI must:
  • ✅ Remember previous messages
  • ✅ Understand references (“it”, “that”, “the one you mentioned”)
  • ✅ Maintain conversation state (user’s budget, preferences, etc.)
  • ✅ Stay contextually relevant

Why Test Multi-Turn Conversations?

Single-turn testing misses critical issues:

Context Loss

Reference Resolution

State Management

Testing Approaches

Test each conversation turn independently with full history:
Pros:
  • ✅ Each test is independent
  • ✅ Can run tests in parallel
  • ✅ Easy to debug individual turns
  • ✅ No shared state between tests
Cons:
  • ❌ More verbose (repeat full history)
  • ❌ Doesn’t test actual conversation flow

Approach 2: Stateful

Test conversation as continuous flow:
Pros:
  • ✅ Tests actual conversation flow
  • ✅ Validates state management
  • ✅ Closer to real usage
Cons:
  • ❌ Tests are sequential (slower)
  • ❌ Hard to isolate failures
  • ❌ One failure breaks entire test

Using History in LLMJudge

LLMJudge accepts conversation history to evaluate responses in context:
Without history, LLMJudge wouldn’t know the “$1000 budget” context.

Real-World Examples

1. Customer Service Bot

2. Shopping Assistant

3. Tutoring Bot (Long Context)

Testing Context Retention

Test Reference Resolution

Test Information Accumulation

Best Practices

Without history, LLMJudge can’t judge context-dependent responses.
Easier to debug and run in parallel.
  • Reference resolution (“it”, “that one”, “the previous”)
  • Information accumulation (collecting details over turns)
  • Topic switching (changing subject mid-conversation)
  • Clarification requests (“What did you mean by…”)
  • Error recovery (“Sorry, I meant…”)
AI models have context limits (e.g., 8K tokens). Test long conversations:
Ensure AI still responds appropriately.
Test that information from early turns is remembered:

Advanced Patterns

Conversation Repair

Test how AI handles corrections:

Ambiguity Resolution

Test how AI handles unclear references:

Multi-Topic Conversations

Test topic switching:

Troubleshooting

Problem: AI doesn’t remember context

Check:
  1. Is history passed to the API?
  2. Is conversation too long (exceeding token limit)?
  3. Is API endpoint stateful or stateless?

Problem: LLMJudge gives low scores despite good response

Solution: Include full history:

Problem: Tests are slow

Solution: Use stateless testing:

Next Steps

Semantic Validation

Deep dive into LLMJudge for validation

Tool Call Validation

Validate AI tool/function calls

LLMJudge Reference

Complete LLMJudge documentation

Calendar Agent Example

Full conversational agent example