Vectorization turns text into numerical vectors so a retrieval system can search by meaning rather than exact wording. An embedding model maps semantically similar text to nearby points in vector space. A question about API credentials can therefore retrieve documentation about key rotation even when the words differ. section 12.1.3
In a retrieval-augmented generation (RAG) pipeline, vectorization appears at two points:
- During indexing, chunk documents, embed them, and store their vectors in a searchable index. section 12.1.3 section 12.2.1
- During a query, embed the question, retrieve similar document chunks, and assemble those chunks as context for the LLM. section 12.1.3 section 12.2.5
Reconnect an index for retrieval
Create the embedding component, load the persistent FAISS index with it, then call `vector_store.as_retriever()`. Use exactly the embedding model used to build the index: differences in dimensions, normalization, or model version can break retrieval. If loading requires FAISS’s dangerous-deserialization option, secure the index files and consider integrity checks. section 12.2.5
Listing 12.9 Persistent FAISS index and LangChain retriever
from langchain_community.vectorstores import FAISS
from index import GeminiEmbeddings
embeddings = GeminiEmbeddings() #1
vector_store = FAISS.load_local(
"DATA/faiss_index",
embeddings=embeddings,
allow_dangerous_deserialization=True #2
)
retriever = vector_store.as_retriever() #3
The listing shows where the embedding component is supplied when a persistent FAISS index is loaded and exposed through a LangChain retriever. section 12.2.5

















