The good thing is that not much protein is required.
Read the protein debate between bodybuilding coaches, Dr. Stuart Phillips and Dr. John Berardi.
Studies have shown that <0.6gm/kg/day is required for an athlete to maintain lean mass. For non-athletes protein requirement increases but is within .8gms/kg/day. Remember the weights are Lean Body Mass, ie minus fat, because fat doesn't need much protein for maintenance.
Lets take as an example a 80Kg male with 25% body fat. The lean mass would 60Kgs. At .8gm/kg/day it will be 48gms per day.
Assuming you eat only vegetables, but not much fruits. Fruits contain around 5% protein while vegetables contain 10% protein calories. Some vegetables like green vegetables are quite high, but they are not absorbed as well.
With legumes the protein ratio can be increased. But they are not complete proteins and combining with grains the protein ratio comes quite a bit down. A bowl of cooked sprouted mung per day would not be a bad thing.
There is a limit on how much fiber can be handled by the body. This puts a limit on how much fibrous vegetables can be eaten. But there is no limit on very low fiber foods like potatoes. Potatoes provide 10% protein and are a complete protein source.
Now for getting enough protein ie 50gms from a diet which has only 10% protein calories, you need 2000kcal. 10% of 2000 will be 200, which is equivalent to 50gms. This is not much.
This is how people lose weight and stay healthy on a potato only diet. There have been experiments in the past with a few people doing this for a year. Note sweet potatoes may not fare so well, because of their extra fiber. On the positive side Potato has balanced protein. There have been some native populations which ate tubers all year round and provided 90% of their calorie source, with occasional meat addition. Some others had as much as 80% of coconut, with small amounts of fish.
This is not so bad for losing weight also, if you can increase the energy expenditure to beyond 2500kcal, this should be trivial for most people with 80kg weight.
For gaining muscles, research has shown that 1.4gm/Kg/day provides maximal growth in muscles. This equates to 3500kcal/day of zero fat food. Adding some fat will take it beyond 4000kcal. The important point is that we don't need to grow muscles at a very fast rate. We can be patient and live with a less than maximal muscle growth.
Think how much protein you need to add 1 kg of muscle. The muscle is mostly water. It will have about 250gms of protein and if you gain it over a month you need on an average 8gms more. 1Kg lean mass gain in a month is pretty good and difficult to attain. Research shows that at best to utilize 8gms of protein you actually twice that in diet. Assuming a more conservative 4 times, we need 32gms more protein per day. Also since the 48gms we calculated before is actually an over-estimate for an athlete, it will go down to (based on the .6gms) 36gms. Total requirement will be around 70gms. This is equivalent to 3000kcal. It is quite easily achievable on a low fat vegetarian diet.
You do need to do more exercises to build muscles which requires a lot more energy. This is where ghee and coconut oil can add support. It will be slower than what it could be on a higher protein diet, but its not out of reach.
You can add whey protein to help further, but it is not necessary. You can also add lots of milk and yogurt, if you can handle it. Milk has some Insulin like Growth factors (IGF1) which help gain muscle. This is why GOMAD (Gallon of milk a day) strategy is very popular amongst body builders.
As an example see Sushil Kumar a pure vegetarian was bronze medalist at Beijing Olympics.
I do understand that there will be some people so damaged that this will not be enough, and they will need special additions like whey.
Another Caveat. Pure vegetarian diets require milk for purposes other than protein. Vitamin B12, Zinc, and K2. So think very hard if you are milk intolerant and are vegetarian. Vegan diets are not for humans. Another caveat is that it is very difficult to get good quality milk. This last factor does not allow vegetarian diets to provide complete health benefits.