Run second query on page based on author of the first query

You can use the $post->post_author,

so before your loop add $agent=""; then inside the loop add

$agent = $post->post_author;

and then create a second query after you loop ends:

$agent_query = NEW WP_Query(array('post_type' => 'agent', 'author' => $agent));
while ($agent_query->have_posts()){
 $agent_query->the_post();
 //do your agent loop here
}
wp_reset_postdata();