The Anatomy of a GenAI System - Part 3
Eric Famanas
~10 min read

Before moving forward
First, a confession: when I first thought up this mini-series, I was inspired by some work that I had previously done at CRFS around the anatomy of different types of RF collection and signals intelligence systems. While there was both artificial intelligence (decision tree and automation logic) and machine learning (RF signals classification using convolutional networks), I never found myself in a position to inform users to the level of detail as I am having to do so today to ensure you, as a reader, have enough data to make an informed decision in your projects; this was primarily because most of the clients were already from the scientific community, so the explanation of certain things was unnecessary.
Aside from that, AI systems, particularly those using complex models under the hood for generative functions, are significantly more advanced than those that we had to deal with ten plus years ago. As I transition from topic to topic, I am finding a wealth of information that gives me pause, forcing me to say quietly: "I wish I had known this sooner, otherwise I wouldn't have made that poor decision".
Unfortunately, the exception to this info dump is the extraction and transform steps of the ETL; the implementation of those two steps, such as data extraction points and architecture for the transformation process, are so domain specific that it would be difficult to generalise the implementation in such a way that could be broadly applicable. That being said, I've now decided to fully explore these two steps with a use case in Part 4, haha.
So please accept my apologies that these articles are becoming longer and more jam-packed with highly technical information.
Now, without further ado, the recap from part two!
In the previous article, we discussed a bit on databasing solutions, specifically where a database, or two, sits with respect to the ETL pipeline, and the importance of having more than one databasing solution given the two classifications of data: raw data, which is unchanged and straight from the source, and normalised, data that had been modified after the Transformation step in the data ingestion pipeline. There are also a number of things to consider outside of technology which may drive your data warehouse architecture and solution.
Going deeper into the normalised data store, we will now discuss data structures that can be implemented within that 2nd stage warehouse, specifically vector and graph data structures, and how those forms are used within AI / ML applications. Understanding what data structures you plan to use may inevitably be the final decision when going with a particular provider or solution such as MongoDB or even package solutions provisioned by AWS.
But the important point is: data structures matter when handling data, and big data management is no longer "just a Google problem"; as we all look toward leveraging, and becoming dependent upon, GenAI solutions, big data management is now everybody's problem.
Your data structure matters
There are a lot of data structures out there to support all kinds of big data and management applications. If you are interested in this wonderful world of data processing and management, here are some awesome Github repos with actual code implementations:
https://github.com/thepranaygupta/Data-Structures-and-Algorithms
https://github.com/tayllan/awesome-algorithms
Tableau also has a pretty good reading list:
https://www.tableau.com/en-gb/learn/articles/books-about-data-structures-algorithms
Around the GenAI space, there are two that stand out in particular: vectors and graphs. Per ChatGPT, the two can be distinguished as the following:
Vectors
Definition: A sequential, dynamic array-like data structure used for storing elements in a contiguous memory location.
Structure: Linear (1D array-like).
Access: Direct access via index (O(1) time complexity).
Modification: Insertion/Deletion at the end is efficient (O(1)), but inserting in the middle or beginning is costly (O(n)).
Usage: Used in AI for storing feature vectors, ML model parameters, and numerical computations.
Graphs
Definition: A collection of nodes (vertices) connected by edges representing relationships between entities.
Structure: Non-linear (can be directed, undirected, weighted, cyclic, or acyclic).
Access: Traversed using algorithms like DFS, BFS (O(V + E) complexity).
Modification: Adding or removing nodes/edges depends on the implementation (Adjacency List: O(1) for edge insertion, Adjacency Matrix: O(V²)).
Usage: Used in AI for social networks, knowledge graphs, and recommendation systems.
It was even kind enough to dump some python code that gives a nice visual diagram:

The program output of a GenAI application. More on this kind of tooling at a later date
In case you want to know a bit more about the use cases for each, here is a nice comparison article from Elastic : https://www.elastic.co/blog/vector-database-vs-graph-database
"It's not enough to challenge vendors with technical questions; it's your responsibility as the decision maker to have enough knowledge (or an expert on hand) to able to evaluate their answers and authenticity."
However, I am not so shameless as to just dump the ChatGPT output and some web links. Demystifying GenAI systems for decision makers and interested individuals is the entire point of this mini-series, so in the spirit of this objective, I am going to expand on vector and graph data structures a bit more from my perspective as both a software developer and a decision maker of these systems as a project manager. After all, not everyone can have a coding carpenter to help them make these decisions.
Vector Data Structures
To help get a better idea of what a vector is in the grand scheme of mathematics, please refer to the image from hadrienj:

A visual comparison between scalar, vector, matrix and tensor
To put it more plainly imagine a spreadsheet like one from Excel or Google Sheets:
Scalar - the single value of a cell
Vector - a row or a column in the spreadsheet
Matrix - the entire spreadsheet
Tensor - multiple spreadsheets stored in a higher-level, parent spreadsheet
There is a lot of interesting things about these data structures, and we use a lot of them on a daily basis. For example, digital images are nothing more than a matrix with a single numerical value representing a mix of red, green or blue (RGB). But I digress, what do vector data structures have to do with AI?
More recent AI systems, and GenAI is no exception leverage machine learning as a core part their engines. While the above example is an accurate representation of the vector data structure, it is also an over-simplification. Within AI systems, the vectors (or feature vectors) contain numbers which are used as a reference to the data attributes (or features) across the whole data set. Think of things like a single pixel across a digital image being represented as a scalar value within a vector or a word from a sentence represented as an entire vector.
By breaking everything down into numbers and containers (vectors, matrices and tensors) a machine learning engine can look for data similarities by using methods such as cartesian equations (the mapping of x and y across a grid, and the difference between two points) or across individual or groups of scalar values within the vector itself.
I struggled writing this explanation in a concise enough way to fit into two small paragraphs. Machine learning is significantly more complicated when looking across all the different ways vectors are utilised alone, excluding the design approach and process in designing algorithms for AI / ML.
Graph Data Structures
In some ways, I personally prefer graphs in terms of visualising a data structure. When I first started learning about graphs, it was more targeted around network topology and calculating shortest path from one data structure to another. The network latency, an arbitrary number, was assigned to each line, or edge, between each of the nodes in the graph. Then we used something like Djikstra's Algorithm to find a network route with the lowest latency.

This may not seem like a good foundation for AI / ML but hear me out: each node is a data element and each value is a numerical score that grades the relationship between the two nodes, with lower numbers representing a closer similarity or relevance based on a set of criteria. This is fundamentally how the Facebook social network graph structure works.
neptune.ai has a really good article that goes into technical detail about graph's and graph neural networks (GNN's) for machine learning applications. In contrast to vectors, which have linear traversal using measures between x and y coordinates, graphs are relationship based; their nature allows for a machine learning or AI process to evaluate and draw relations between individual elements.
Let's take large language models as an example. If I feed in a sentence, or a prompt, into the system, it will look up each of the individual words, or nodes, in the graph. Then, it could look at the relationship values to find words that are similar, or those same words that have appeared in different contexts. The AI system can then construct its own view of what the context of the user prompt is and return and appropriate response that is relevant to the user's implied or explicitly stated topic. Not all prompts are handled equally, and this is why in some exercises, the prompt needs to have detailed information to help the AI move along more accurately across the graph. Believe it or not, our brains also work the same way using nemonic devices and sensory-based data retrieval.
Why does this matter? It's all about the big O (notation)
Recent "unique selling points" of large language learning models is this the number of parameters an LLM can consume, and I don't mean something like 10 or 100. The last comparisons I've read about DeepSeek vs OpenAI is in the magnitude of 10's of millions (80+ million as an approximation). The idea of a program consuming 80 million vectors or graphs as part of its normal subroutine is unfathomable. Further still, these processes need to be extremely performant; because the world is moving at such an incredible pace, we cannot afford to wait days or weeks like when we were decrypting messages using an Enigma machine; user experience demands that the responses produced by a GenAI system happen within a relatively short time of just seconds to under a minute.
In the output produced by ChatGPT, there are references to things like O(1) and O(N), etc; these items refer to whats known as Big O notation, or a way of representing the relative performance of a particular algorithm or implementation based on the size of the dataset. Although its another big topic, it's one not really necessary to deeply understand for the purpose of this blog.
The important take away is that whenever you, as a decision maker, ask how performant an AI or ML algorithm is, anyone worth their salt should respond to you using a big O notation representation or with a precise calculation based on the dataset size that was derived from performance testing. This is a quick win to help you, as a decision maker, determine the technical expertise of the GenAI vendor you are considering.
Conclusion and things to come
First, thank you for reading this article! This is only the surface of a technical deep dive into the anatomy of a GenAI system. However, I have heard this before, and have no doubt that there will be a shared sentiment amongst my readers: "I am not very technical, and I am not sure how useful this information may be if I am not an engineer designing the system."
From a project / product management standpoint, the hope is to achieve two objectives:
Have enough fundamental knowledge to engage with software engineers and data scientists in a more meaningful way to bridge communication gaps. Understanding your engineering needs helps you make better arguments to help get tooling the team needs to succeed.
Have enough background knowledge on these systems to challenge vendors who are trying to sell you AI. If they do not have answers to your questions around these topics, there is a chance they are trying to sell you a "client GenAI system" which is basically a thin application sat on something like ChatGPT as its core. Because it's relying on an external dependency as part of its critical feature set, its entire viability and future is beyond the vendor's control. This is definitely information worth considering before making a decision.
But I digress... To help imagine how all of this fits together, in Part 4 I will go over a more detailed ETL pipeline, but with the database storage and structure solutions included as part of that discussion. This has nothing to do with my oversight and poor planning, I swear! ^_-*
I hope to see you all then!