Building A Simple RAG System With Fastapi (2)

FS Ndzomga
Thoughts on Machine Learning
2 min readNov 19, 2023

--

In part 1 of this series of articles, I created the outline of our fastapi application. I also created the first service we will need for our RAG system to work: the file parser.

The file parser is responsible for the extraction of text content from input files. I made sure to respect the open closed principle so that the file parser can be easily extended by registering a new specialised parser, and is closed for modification at the same time. I did that by using an elegant solution using a parser factory. Here is the link to the first article of the series:

One thing I didn’t do in my first article is programming defensively.

Defensive programming is a methodology that involves writing code in a way that anticipates and handles potential errors or unexpected usage scenarios. It is an approach that aims to ensure the program continues to function correctly under a variety of unforeseen circumstances.

When applied correctly, can significantly enhance the quality, security, and reliability of software. However, it’s important to…

--

--

FS Ndzomga
Thoughts on Machine Learning

Engineer passionate about data science, startups, product management, philosophy and French literature. Built lycee.ai, discute.co and rimbaud.ai