Accepted
We needed a conversation system that provides:
- Deterministic, auditable conversation flows
- LLM-like natural responses without API costs or latency
- Easy-to-understand structure for non-technical content creators
- Flexibility for complex branching scenarios
We adopted a finite-state graph traversal approach where:
- Conversations are directed graphs with nodes and edges
- Nodes represent conversation states (bot messages, user inputs, decisions)
- Edges represent transitions triggered by user input
- Intent recognition determines edge traversal
interface ConversationGraph {
nodes: Record<string, ConversationNode>;
edges: ConversationEdge[];
personas: Persona[];
intents: IntentDefinition[];
}- bot: System/Bot messages with dialogue variations
- user-input: Awaiting user response
- decision: Branching points based on user choice
- end: Conversation termination
- redirect: Jump to another node or graph
- ✅ Predictable, testable conversation flows
- ✅ No external API dependencies
- ✅ Sub-100ms response times
- ✅ Content creators can edit JSON directly
- ✅ Full conversation audit trail
- ❌ Requires upfront scenario design
- ❌ Less flexible than pure LLM for open-ended conversations
- ❌ JSON files can become large for complex scenarios
- Dialogue variations reduce repetitiveness
- Intent recognition allows natural language input
- Graph viewer helps visualize complex scenarios