He was born Constantine at Thessalonica around 826, in a city sitting on the edge of a Slavic-speaking hinterland, which is the usual explanation for how two Greek brothers came to know Slavic well enough to translate into it. His father held a military office in the city. The younger son went to Constantinople for his education, studied in the circle around Photios, and took a post as librarian at Hagia Sophia and then as a teacher of philosophy. The epithet the Philosopher is contemporary, and it stayed attached to him.
Before Moravia he was twice sent abroad on the empire's business, first towards the Arabs and then, around 860, to the Khazars north of the Caucasus, on both occasions to argue the Christian case in a formal disputation. The Khazar journey produced no conversion, but it did produce a find. At Cherson in the Crimea he identified relics as those of Clement of Rome, and he carried them with him from then on. They were eventually deposited in Rome, and they are part of why the brothers were received there as well as they were.
In 862 Prince Rastislav of Moravia asked Constantinople for teachers who could instruct his people in their own tongue, wanting a church that did not arrive with Frankish clergy attached. The emperor sent the brothers. The request was political and the answer was political too, and what came out of it was a writing system and a literature.