While buckwheat is often used like a grain, it isn't a true grain because it does not come from a member of the grass family. It comes from the seeds of a plant in the buckwheat family, Polygonaceae, which is the same family where you will find yellow dock, rhubarb, and sheep sorrel.
Buckwheat is considered a pseudo-grain like amaranth and quinoa. These pseudo-grains tend to be higher in protein and lower in carbohydrates, but the starch content is still high enough that they can be used like cereal grains.