DEV Community

shashank ms
shashank ms

Posted on

Using LLM for Dialogue Management in Conversational AI Systems

Conversational AI systems have moved beyond rigid decision trees. Modern dialogue management relies on large language models to interpret intent, maintain state across turns, and decide when to query external APIs or escalate to a human agent. This shift replaces hand-crafted finite state machines with dynamic, context-aware reasoning engines that scale across domains.

The Shift from Finite State Machines to LLM-Driven Dialogue

Traditional dialogue managers decompose conversation into intent classification, slot filling, and policy selection. While effective for narrow domains, this pipeline breaks when users deviate from expected paths. LLMs collapse these stages into a single reasoning step. A model with sufficient context can infer intent, extract entities, and select the next action from a natural language prompt, reducing the engineering surface area required to support open-ended conversation.

Core Architectures for LLM Dialogue Management

A production dialogue system typically combines three components: a context window that carries conversation history and persona instructions, a retrieval layer for grounding in business logic, and a function-calling interface for actions like booking appointments or checking order status. Long-context models reduce the need for aggressive summarization between turns, preserving nuance that state trackers often lose.

Oxlo.ai hosts several models suited for this workload. Kimi K2.6 offers a 131K context window with advanced reasoning and agentic coding capabilities, making it effective for multi-turn support bots that must reference prior turns without truncation. DeepSeek V4 Flash provides a 1M context window with efficient MoE architecture, allowing an entire conversation history plus retrieved documentation to sit in a single prompt.

Implementing a Dialogue Manager with Function Calling

Function calling bridges natural language and structured operations. The example below uses the OpenAI SDK with Oxlo.ai to maintain a simple appointment-booking agent. Because Oxlo.ai is fully OpenAI SDK compatible, you can point your existing client at https://api.oxlo.ai/v1 and use the same patterns.

import openai
import json

client = openai.OpenAI(
    base_url="https://api.oxlo.ai/v1",
    api_key="YOUR_OXLO_API_KEY"
)

tools = [
    {
        "type": "function",
        "function": {
            "name": "book_appointment",
            "description": "Book a time slot for the user",
            "parameters": {
                "type": "object",
                "properties": {
                    "date": {"type": "string", "format": "date"},
                    "time": {"type": "string"},
                    "department": {"type": "string"}
                },
                "required": ["date", "time", "department"]
            }
        }
    }
]

messages = [
    {"role": "system", "content": "You are a scheduling assistant. Confirm details before booking."},
    {"role": "user", "content": "I need to see someone in cardiology next Tuesday at 2pm."}
]

response = client.chat.completions.create(
    model="your-model-id",
    messages=messages,
    tools=tools,
    tool_choice="auto"
)

print(response.choices[0].message)

The model parses the user utterance, detects the need to invoke book_appointment, and emits structured arguments. Your dialogue manager executes the tool, appends the result to messages, and iterates until the model returns a natural language response. On Oxlo.ai, you can select Qwen 3 32B for multilingual agent workflows, Llama 3.3 70B for general-purpose steering, or Kimi K2.6 for advanced reasoning over long transcripts.

Context Window Economics in Multi-Turn Conversations

Dialogue systems are inherently long-context workloads. Every turn appends new tokens to the conversation history, and agentic flows often inject retrieved documents or schema definitions alongside the dialogue. Under token-based pricing, costs grow linearly with input length, which penalizes systems that keep full history for coherence.

Oxlo.ai uses request-based pricing: one flat cost per API request regardless of

Top comments (0)