Rag-implementation