service_context
passed to a query_engine is used to determine which LLM to use to generate the response to query and for callback manager.retriever
as query_engine passes the query to the underlying retrieverretriever
uses the service context from the index
. hence you don't need to pass it to the retriever.