add agent analysis codes