Distributed Shamir's secret sharing Wikipedia on its page for Shamir's secret sharing scheme provides a python implementation that applies the idea. This algorithm will generate a (k, n) threshold scheme so for example we could split a secret in 6 parts and we would need only 3 of them to recreate it.

But isn't the idea of this scheme to be used by a number of various agents that each one will generate only a part of the key and share it? This way each agent can then create the secret key by combining the parts he will receive.

What would be the proper way to make this algorithm distributed and not generating everything in one computer?
Each participant can create his own random k,n secret sharing and send one share to each other participant.
Each participant can then add up his sub-shares to get his final share. 

Due to linearity the resulting is also a valid shamir secret sharing.

This produces a random shared secret. If there is something you want to protect with it, we need to ask who knows it initially?