BLOGAnnounced at MongoDB.local NYC 2024: A recap of all announcements and updates — Learn more >

How Cognigy built a leading conversational AI solution with MongoDB

 image of a man and woman working in the office.

INDUSTRY

Corporate Services

PRODUCT

MongoDB
GridFS

USE CASE

AI
Machine Learning

CUSTOMER SINCE

2016

Cognigy delivers AI solutions that empower businesses to provide exceptional customer service that is instant, personalized, in any language, and on any channel. Its main product, Cognigy.AI, allows companies to create AI Agents, improving experiences through smart automation and natural language processing. This powerful solution is at the core of Cognigy's offerings, making it easy for businesses to develop and deploy intelligent voice and chatbots.

Cognigy also makes it simple to integrate with third-party platforms like Facebook Messenger, Line, and WhatsApp. This broadens the reach of customer service teams and helps businesses connect with their audience on various channels they use.

Making it simple

Developing a conversational AI system poses challenges for any company. These solutions must effectively interact with diverse systems like CRMs, ERPs, and ticketing systems. Furthermore, considering the array of communication channels a brand might target, this complexity rapidly intensifies.

Ensuring a tailored experience for each user across every channel and at the right moment might appear to be an overwhelming task. In addition to this, scaling the platform to accommodate a growing user base while maintaining minimal latency is a substantial undertaking.

This is where Cognigy introduces the concept of a centralized platform. This platform allows you to construct and deploy agents through an intuitive low-code user interface. This component empowers business users to design the logic of virtual agents using various key features, primarily Flows, Playbooks, Lexicons, and Intents.

The Execution

Cognigy took a deliberate approach when constructing the platform, employing a composable architecture model, as depicted in Figure 1 below. To achieve this, they designed over 30 specialized microservices, which they adeptly orchestrated through Kubernetes. These microservices were strategically fortified with MongoDB's replica-sets, spanning across three availability zones, a move aimed at bolstering reliability and fault tolerance. In addition, sophisticated indexing and caching strategies were integrated to enhance query performance and expedite response times.
Cognigy.AI architecture illustration.

Figure 1: Cognigy.AI v4.55.0 architecture

The choice of MongoDB as Cognigy's developer data platform was a result of careful consideration, influenced by several key factors:

  • JavaScript-Like Query Language: A significant 80% of the Cognigy.AI platform is coded in Typescript. MongoDB's adoption of a document model for data storage in JSON aligns with the application language. The intuitive querying process in MongoDB (MQL) resonates well with developers and harmonizes with Cognigy's technical stack.

  • Migration and Schema Flexibility: Unlike traditional SQL databases, MongoDB's JSON document storage facilitates seamless modifications to the data model without necessitating widespread application changes. This flexibility eliminates concerns surrounding data and schema migrations.

  • Scalability Outlook: MongoDB's inherent ability to scale both horizontally and vertically through sharding aligned perfectly with Cognigy's growth perspective. This flexibility extends across major cloud providers and on-premises setups, positioning MongoDB to accommodate Cognigy's future expansion.

  • GridFS for File Management: Leveraging MongoDB's GridFS, Cognigy found an out-of-the-box solution for efficient storage of substantial binary files. This functionality is notably beneficial for housing custom-trained intent models in Cognigy.AI. GridFS offers advantages over plain file systems, particularly in terms of data consistency and availability, a crucial consideration for on-premises setups.

The selection of MongoDB was underscored by its user-friendly nature and rapid iteration capabilities, addressing significant concerns when compared to other storage backends.

Impact

MongoDB empowered Cognigy.AI to effortlessly handle an expanding array of user interactions, spanning diverse data types such as text, all while maintaining peak performance levels. This synergy empowered businesses to seamlessly scale their conversational agents, swiftly adapting to shifting customer requirements. Moreover, MongoDB's adaptable data model facilitated a continuous evolution of the AI model, ensuring the platform remains agile and responsive.
Cognigy’s replica-sets in production illustration.

Figure 2: Cognigy’s replica-sets in production

Figure 2 above showcases the real-world impact of MongoDB's capabilities. With a MongoDB production replica-set, Cognigy is able to handle hundreds of queries per second, totaling around 1000 database operations per second during peak-load scenarios. This performance is achieved while managing over 1 TB of data stored on larger systems.

In conclusion, MongoDB has been a driving force behind Cognigy's unprecedented flexibility and scalability, and has been instrumental in bringing groundbreaking products like Cognigy.AI to life. To learn more about how MongoDB can help build AI-enriched applications, click here.

“MongoDB has been instrumental in bringing Cognigy.AI - our contact center AI platform for customer service transformation - to life, enabling us to handle hundreds of queries per second. With MongoDB’s developer data platform, we can effortlessly manage an expanding array of user interactions, spanning diverse data types such as text, all while maintaining peak performance levels.”


Benjamin Mayr, VP of Engineering, Co-Founder, Cognigy

What will your story be?

MongoDB will help you find the best solution.