Agent is just a GenServer with calls. It's simply a wrapper for a common use case
for when you only want to save state. The only benefit to using it is less code to
Agent is a GenServer that only saves State.
Also, Task is a GenServer that only does a Task or job.
These two simplifications are on each end of the spectrum of what a GenServer can do if you look at gen servers as processes that can perform tasks and store state.
José gave a talk some time ago where he talked about this. It was very informative for me. Maybe someone can provide the link.
این توضیحات هرچند کمه اما قانع کنندس و اگر بیشتر خواستی کتاب elixir انتشارات o'reilly رو بخونی واقعا قشنگ توضیح دهده