DEV Community

Shibin 4u
Shibin 4u

Posted on

Context is the missing layer of modern conversational AI

The first generation of chatbots were mainly rule-based.

User question asked.
System matched it to known patterns.
Predefined answer sent.

This is a great approach to simple workflows but modern conversational AI is solving a different problem, understanding conversations as opposed to just messages.

This comes down to context.

From rule-based to conversational AI

Modern conversational AI might follow an interaction like:

User Intent detection, Rule, Response, etc.

For example:

User: What are my support hours?

Bot: Support is available 9 AM-6 PM.

It is very predictable.

When in a conversational flow:

User: I'm having a problem with my order.

Bot: What's the order number?

User: 12345

Bot: What's the issue?

User: I need to change my delivery address.

The last message only works when it understood what has happened before. A conversational AI must maintain some sense of the conversation's flow such as:

intent = order_support

order_id = 12345

request = changedeliveryaddress

This is more like a conversation and not just an interaction.

What does a conversational AI look like?

A conversational AI system might look like this:

``text

User

Conversation Interface

Language Understanding

Context / Conversation State

Knowledge Retrieval

LLM / AI Model

Business Logic

External Systems

Response

`

Each part has a function, language models generate or understand, but it doesn't mean that all the business information needed sits within the LLM itself. Context management and retrieval can solve this for current interactions.

Context vs Memory

These two concepts are related but are not quite the same:

Context refers to what is currently relevant for the conversation.

Memory refers to what is recalled across conversations/sessions.

Example:

Current context = Customer is asking about order number 12345.

Long-term memory = Customer prefers to be contacted by email.

A sophisticated system must have logic to decide which information needs to be retained, for how long and under what circumstances. This has significant implications for data security and privacy.

Connecting conversational AI to business data

The AI model doesn't know what new products your company has added, what your customers' personal preferences are, what the latest updates in your knowledge base or your business rules are. Retrieval and integration with external systems solve this.

The architecture in simple terms might be like this:

`text

User Query

Intent / Context Analysis

Retrieve Relevant Information

Knowledge Base / Database / API

AI Model

Response

`

Let's say the customer is asking "Can I return the product I bought last week?". What the system may need to do:

Retrieve the latest return policy.
Retrieve relevant information about your customer.
Retrieve details of your products.
Retrieve the customers past order and date.

This information can then be sent to the AI that generates a suitable response. The AI doesn't need to hold every piece of information within it, something a traditional chatbot doesn't do at all.

Why Retrieval Matters

One of the crucial aspects of enterprise conversational AI is getting it right for each task. Retrieval offers ways of feeding the AI the right set of documents or data before generating a response.

A simple retrieval could involve:

`text

Question

Embedding / Search

Relevant Documents

Context Window

LLM

Answer

`

This is very useful for company knowledge bases, product descriptions, policy documents etc.

APIs Turn Conversions into Actions

What differentiates conversational AI from traditional chatbots is its ability to "do" things, as opposed to just "answering".

User: "Change my appointment for Thursday to Friday."
AI: Understands and initiates an API call to the scheduling system.
API: Checks availability of the desired slot for the appointment.
Business Logic: Validates that the change is allowed.
API: Updates the appointment.
AI: Confirms the change to the user.

This is how the AI functions as a natural language interface into business processes.

Human Handoffs still matter

You still need a way to handle conversations that can't be automated.

Triggers may include:

*Complex queries

  • Sensitive information shared

  • A Low confidence score from the AI model

  • Multiple unsuccessful attempts from the AI

  • A request by the user to talk to an agent

A typical handoff system looks like this:

`text

User

Conversational AI

Confidence / Policy Check

Simple Complex

AI Response Human Agent

`

It's crucial for the conversation to be handed to the agent without the user having to repeat their problem.

Observability is key

It's not enough for the conversational AI to work. You need to know how well it's working.

Key performance indicators include:

  • Response accuracy

  • Task completion rates

  • Escalation rates

  • Customer satisfaction scores

  • Response latency

  • Retrieval quality

  • Failure rates

  • Cost per interaction

Logging will allow development teams to identify areas for improvement and where the conversational AI is doing well.

Security and Data Governance

When dealing with business and customer data, security is a top priority. Systems must be designed with security features such as:

  • Authentication

  • Authorization

  • Data minimization

  • Encryption

  • Access controls

  • Audit logs

  • Data retention policies

  • Secure handling of sensitive data

The AI shouldn't have blanket access to all business systems; rather access must be granted according to the tasks the AI needs to perform.

The Role of the Developer changes

Creating conversational AI is not about just selecting an LLM. It involves an entire system around it:

  • Model selection

  • Prompt and instruction writing

  • Context management

  • Retrieval

  • APIs

  • Business logic

  • Security

  • Observability

The model is just one part, the others decide the success and usefulness of the system.

Where is Conversational AI heading?

The direction of conversational AI can be put simply like this.

Traditional chatbot:

Question, Predefined Answer

Conversational AI:

Question, Intent Analysis, Maintain Context, Retrieve Data, Generate/Reason, Use Business Tools, Complete Task`

This turns conversational interfaces into tools we can use to communicate directly with our applications and business processes.

For businesses looking for conversational AI or intelligent communication tools, https://commconai.com/ provides a starting point for the exploration of this technology.

Conclusion

The real innovation in conversational AI may not be the fluency of its language but its understanding within the context.

Combining conversation history, business knowledge and external systems allows AI to be more valuable than traditional rule-based chatbots.

Conversational AI will shift conversations with machines into natural language interfaces for intelligent systems.

Top comments (0)