Artificial intelligence and large language models (LLMs) are profoundly transforming digital interactions. This article offers an analysis of the advantages and disadvantages of two popular approaches to defining the architecture of a chatbot.
Date: 8 April 2025
Expertises:
Data Science ⊕
Domaine: Software industry ⊕
Innovation theme: Artificial Intelligences ⊕
About project: ARIAC ⊕
1.1. Monolithic approach
The monolithic approach involves building the chatbot application from a single technological tool. All code, from the user interface to business logic and data management, is grouped into a single block.
Example: Streamlit is an open-source Python framework for quickly creating interactive web applications from Python scripts. It is ideal for prototyping and internal applications.
1.2. Modular approach (Integration of Web Framework, API Server, and REST API)
The modular approach involves dividing the chatbot application into several independent components, each with a specific function. These components communicate with each other via APIs.
Examples:
Note: There are many other technologies that can be used to build modular chatbots. For the frontend, examples include React or Vue.js, and for the backend, Flask or FastAPI. The choice of Django and Angular in this comparative study is motivated by their popularity and their characteristics well-suited to the needs of many projects.
2.1. Flexibility and customization
2.2. Scalability and performance
2.3. Integration with other services
2.4. Security and user management
2.5. Maintenance and scalability
Modular Approach (Web Framework + API Server + REST API) | Monolithic Approach (Streamlit) | |
---|---|---|
Flexibility | Highly customizable, adaptable to various sectors | Rapid development, limited in design and UX |
Scalability | Effectively manages large user loads | Limited in scalability, slowdowns with increased users |
Integration | Facilitated with Django REST Framework, seamless interconnection | Limited client-server interactions, restricted integration |
Security | Advanced protections, fine-grained user management | Basic security, less suitable for secure infrastructures |
Maintenance | Simple scalability, efficient maintenance | Monolithic structure, complex scalability and maintenance |
In a professional setting, where robustness, scalability, and security are paramount criteria, the approach combining Django and Angular with a REST API appears to be the most suitable solution. It ensures not only great flexibility for evolution but also better interoperability with external tools and services. On the other hand, if the goal is to develop a prototype quickly, without worrying about the constraints related to load balancing or security, Streamlit can be an interesting alternative, especially for teams seeking to experiment and test concepts before a larger-scale deployment.
It is important to note that these two approaches are not mutually exclusive. A judicious strategy could consist of using Streamlit to perform a quick and inexpensive Proof of Concept (POC), thereby validating the feasibility of the project and its market interest. If the tests prove conclusive, a more sustainable and robust solution based on Django coupled with Angular could then be developed to ensure long-term operation.
Ultimately, the choice of architecture largely depends on the project’s requirements, its context of use, and the needs in terms of scalability and integration with existing infrastructures. As AI and LLMs continue to establish themselves as essential technologies, having an adaptable and scalable solution is more than ever a strategic issue for businesses.