Schibsted interview question

implement a couple of functions for a RAG skeleton in python