Nanites

Microscopic machines that became a sentient collective

Tiny medical robots that, after Wesley Crusher's experiment let them evolve, formed a collective intelligence and were recognised as a new life form.

Nanites are microscopic robots built to work inside living cells, performing tasks such as medical repair at the molecular level. A batch that Wesley Crusher was using for a school project escaped into the Enterprise-D's computer core, where the machines began to replicate, cooperate and learn, eventually developing a group consciousness. Their tampering with ship systems endangered Dr. Paul Stubbs and his long-planned stellar experiment in the episode Evolution.
When Stubbs tried to wipe them out with gamma radiation, the nanites struck back. Data then allowed the collective to speak through his own body, which let Captain Picard negotiate a peaceful settlement. The nanites agreed to leave the ship and were given a new home on the planet Kavis Alpha IV, making them one of the few species born aboard a starship.