amg_context is a template