AI Hints
Home›RAG Tutorial›Vector Stores
RAG · Lesson 31 of 120

Vector Stores

Save and search.

⏱ 2 min read▶ Video at 30:59🎓 Free
Watch this lesson in the RAG courseWatch on YouTube ↗Full RAG course

Our index is a numpy array in memory. That's fine for forty chunks. But real systems have millions of chunks, need to save them, update them, and filter them. That's the job of a vector store.

Vector Stores
From the video: Vector Stores
  • Arrays are fine for small
  • Millions of chunks
  • Vector stores

What a vector store does

A vector store keeps each chunk's text, its vector, and its metadata together. It finds the nearest vectors to a question quickly, even among millions. It can filter by metadata. And it saves everything to disk, or runs as a database server.

keyvalue
Storestext, vector, metadata
Searchesnearest vectors, fast
Filtersby metadata
Persistsdisk or server

Using any vector store

Every vector store follows the same pattern. Create it with an embedding model. Add your chunks. Search with a question. And get back chunks, often with scores.

  1. Create
  2. Add chunks
  3. Search
  4. Chunks + scores
Using any vector store
From the video: Using any vector store

Summary

A vector store keeps text, vectors, and metadata together, and searches them fast. Next, LangChain's simplest vector store.

Key takeaways
  • Text + vector + metadata
  • Fast nearest search
  • Save to disk
Next up: LangChain's Vector Store — in memory