The liver stores a lot of b12 — something like 3 years’ worth or more. I think your doctor can test your blood levels to see if you’re deficient.
I've heard that back in the old days vegans didn’t have to worry about it because they got insects in their food all the time and this supplied b12. Nowadays most of our food is bug-free so that doesn’t work. I think you can eat dirt too.
There are a few places to get b12 from vegan foods. Brandon Brasier in his vegan nutrition book “Thrive” (he’s a vegan athlete and his book is pretty interesting — I recommend it) says:
Vitamin B12 is essential for a healthy nervous system, aiding in coordination and smooth muscle movement. As with other B vitamins, B12 plays a role in the production of red blood cells and conversion of food to usable energy. Unlike other B vitamins, B12 is not plentiful in foods. Special attention must be paid to ensure dietary B12 needs are met, particularly if the diet doesn’t contain animal products and exercise level is moderate to high.
Best Thrive [vegan] sources: chlorella, miso, nutritional yeast.
I eat all three. I have little chlorella pills that I put in smoothies from time to time, or just chew on. I put miso in soups, grains, and bean dishes. South River Miso has a lot of varieties and it’s the best I’ve found. I put nutritional yeast on popcorn. Yum.
Update: Chlorella and miso only have very small amounts of b12. To get the RDA's worth, you'd have to eat a ton of either food. In contrast, there's plenty of b12 in a generous helping of nutritional yeast.
It's worth noting I have no idea how accurate the RDA is. It's entirely possible that vegans don't need as much, or need more, than whoever the standard was modeled after.
There are also small amounts of b12 in some sea vegetables.
There is a significant amount (about 50% RDA per serving) of b12 in spirulina, a blue-green algae that goes well in smoothies.
You can take a vegan b12 supplement if you're worried about it.
Update: Thing 5.
Many nut / rice / soy milks are fortified with b12.
They're also fortified with vitamin D, which I've heard is important when you're not getting enough sun, like say if you have an indoor job in the winter in downtown NYC. Note that vegan milks usually contain D2 instead of D3, because D3 is an animal product.