How exactly are content vectorized for RAG

Let’s say I have N documents to be added to a vector database. I select the applicable embedding. I understand that embedding contains vectors for each token. Each document content is tokenized and embedding is generated for each token of that document. My questions:

  1. How are these finally stored in the vector database? (a) Is each document stored as a single vector that’s the average of all the token vectors? (b) Or is each document stored as many vectors, one for each token?

  2. If (1b) above is the answer, then how is similarity search performed in the vector space? If (1a) is the answer, then similarity search is simple but search for specific content may be inaccurate, particularly for large documents.

Thanks for your help.