agentic loop diagram