Mempage interview question

Implement a cosine similarity-based RAG in Numpy for a Postgres database without using other libraries.