Starfleet was the deep-space exploratory and defense service maintained by the United Federation of Planets. Its principal functions included the advancement of Federation knowledge about the galaxy and its inhabitants, the advancement of Federation science and technology, the military defense of the Federation, and the practice of Federation diplomacy.
As per its mandate of deep-space exploration, its personnel were frequently brought into contact with cultures and sentient species whose existences were unknown to the Federation. Starfleet officers therefore acted as official representatives of the Federation in these cases. Starfleet vessels were also frequently used to ferry ambassadors on diplomatic missions.