Metareasoning Agents for Query-Answering Systems