As an AI Generalist, one must understand AI software engineering because AI products and solutions must be delivered as software. In this lesson, we define the software engineering framework for putting the AI solution into production.
Why should we use a database?
The first artefact of this framework is the database. Databases are extremely powerful tools. They can search almost at the speed of light! In the PoC (Proof-of-Concept) phase, most AI solutions read data directly. For example, I have large datasets in CSV or MF4 files, and my model consumes the data directly from these sources; data scientists commonly use the pandas library to read the dataset.
On the other hand, software engineering lets us redefine the solution using a proper database. Database engines are designed to handle immense numbers of queries for scaled software in a very short time. In this case, decide whether the AI solution is embedded or web-based, for example. If it is a web-based application, you can use PostgreSQL because it handles massive text, time-series, and vector data (and maintains vector databases efficiently).
On the other hand, if the solution is embedded, you can use SQLite to store data. SQLite is a C-based, serverless database (meaning that, unlike other server-based databases like PostgreSQL, it does not have port-based access). SQLite is also an extremely lightweight database commonly used in Android applications. Another type of database is a graph database. In conventional relational databases, data are stored in tables and relations among the tables are established. In a graph database, data are stored as nodes in the graph, and their relationships are edges. In this database, you can write commands to traverse the graph and find the shortest distance between source and destination Nodes. Based on the application, the AI architect must select the right database.
What are the common backend frameworks?
In AI-based products, the backend contains heavy AI models. If the application is simple and in the MVP phase, you can use Flask (a Python-based framework) to encapsulate the models and code and build REST APIs. For example, say you built an AI model that takes some inputs and produces some output. In this case, the input can come through an HTML web form. After clicking the submit button, the web server sends the information to Flask. Flask automatically extracts the relevant information, runs the AI model, and returns the output to the website for display. This is the simplest use case of a Flask-based implementation. Flask is useful when you want to ship the AI solution to its customers as a trial version. For more complex products, software engineers use another framework called Django. With Django, requests can be directed to different Python functions based on the URL.
What are the common frontend frameworks?
HTML defines the basic structure, and CSS defines the style. To make the frontend more dynamic, React.js can be considered.

How to select the design practice?
Choosing the right design depends on what the user needs. For example, a vendor wants an AI-driven web application for his medical store. In this case, we need a simple user interface, basic AI functionality, real-time sales tracking, and a login mechanism. This simple AI product can be developed using <HTML + CSS as the frontend, PHP as the server-side backend, and MySQL as the database. You can host it on any affordable server. The AI model – which might estimate the most in-demand medicine in the upcoming month – can be trained offline. If the model is simple, you can write the equation with its trained weights. Then you can implement this equation in a PHP script, and it can run easily on the server. PHP also supports GPTs these days. Thus, one can quickly build a simple AI-driven web application based on the user requirements. On the other hand, if the vendor is a robotics firm and needs a complex AI-driven web application that includes audio and video processing, one needs more complex frameworks like Django and React.js for the backend and frontend, respectively.
When designing production-ready AI software, speed is crucial. No one likes using slow software! So, as an AI Generalist, you must consider the speed of the software’s operation very critically. Let me give you one example to improve speed. For example, I need to load a video into the AI model. Instead of searching for it in the data store, one can place its link directly in the database. With keywords, the system can extract the video link in seconds instead of searching for the right video in the data store.
In the next lesson, we will talk about execution. Executing a project is crucial to meeting the timeline.
Leave a Reply