An agent is a service that manages and hosts one or more tasks. It is installed and visible as a service in Docker.
If you want to manage several tasks in one agent, make sure that they provide similar functionality. E.g. adding, modifying and deleting the same type of object, or setting and getting of metadata for an object are good candidates for tasks in one and the same agent.