Updated agent to new agents framework