Category: AI Engineering

  • Traditional RAG, which I covered in my previous post, uses dense vector search to retrieve documents that are semantically similar to the user’s query. This approach is especially useful for open-ended or natural language questions, where users describe their intent without necessarily knowing or using the exact terms found in the documents. However, relying solely…

  • Although an LLM is trained on a vast amount of data and is capable of generating high-quality text, it has inherent limitations, such as being restricted to the knowledge available up to its training cutoff and lacking access to domain-specific or private knowledge bases. Retrieval-Augmented Generation (RAG) is widely used to overcome these limitations by…

  • A vector database is a system designed to store and retrieve high-dimensional vectors through similarity search. These vectors are numerical representations of different types of data, such as text, images, audio, and video. In practice, vector databases are primarily used to store embeddings, which are numerical representations generated by machine learning models that preserve the…

  • An embedding is a numerical representation of a word, sentence, image, or audio sample in the form of a high-dimensional vector, designed to capture relevant characteristics of the data, such as its semantic meaning. Embeddings are typically generated by machine learning models trained on large amounts of data. During training, these models learn to organize…

  • NLP models and LLMs do not process raw text directly, but instead operate on numerical representations. In this context, tokenization is the process of converting a sequence of characters (a string) into a sequence of tokens, smaller units of text. These tokens are then mapped to numerical identifiers (integers), which correspond to positions in a…

  • The goal of this post is to build a web interface for the chatbot developed in the previous post, using Streamlit, a free framework that makes it easy and intuitive to create web applications directly with Python. Since this post is a direct continuation of the previous one, it is strictly necessary that you read…

  • The goal of this post is to enhance the chatbot developed in the previous post by introducing an agent capable of using a tool to retrieve information from the internet whenever needed. In addition, LangSmith is presented as an observability layer, enabling the tracking of agent executions and the analysis of each step of the…

  • LangChain is an open-source framework designed to simplify the development of applications based on Large Language Models (LLMs). It provides a modular architecture that makes it easy to integrate language models, prompts, memory mechanisms, external APIs, and diverse data sources, enabling the creation of organized, flexible, and extensible solutions. The goal of this post is…

  • The goal of this post is to demonstrate how to fine-tune an LLM (Llama-3.1-8B-Instruct) using QLoRA to solve a classic machine learning task: classifying emails as spam or not spam. If you haven’t read the previous post on fine-tuning yet, I highly recommend doing so, as it covers the foundational concepts, approaches, parameters, and other…

  • Fine-tuning is the process of readjusting a previously trained model (usually a general-purpose one) so that it adapts to a more specific task or dataset. The goal is to specialize the model by leveraging the knowledge it has already acquired during pretraining, without having to train it from scratch. During fine-tuning, only part of the…