# Module 2: Working with Vector Stores

**A Non-Technical Introduction to Vector Stores**

At the heart of every modern AI agent is a powerful technology called a "vector store" or "vector database." While the name might sound technical, the concept is quite simple. A vector store is a specialized type of database designed to store and search for information based on its meaning, rather than just keywords.

{% embed url="<https://youtu.be/v6E1fbEuILg>" %}

**How it Works: The Library Analogy**

Imagine a massive library where the books are not organized alphabetically, but by their topic and meaning. Books about similar subjects are placed close to each other. When you ask the librarian a question, they don't just look for books with the exact words you used; they look for books that are conceptually related to your question.

A vector store works in a similar way. When you upload a document, the vector store converts the text into a numerical representation called a "vector." This vector captures the semantic meaning of the text. Documents with similar meanings will have similar vectors and will be "stored" close to each other in the database.

When an AI agent receives a query, it converts the query into a vector as well. It then searches the vector store for the document vectors that are closest to the query vector. This is how the agent finds the most relevant information to answer a question, even if the user doesn't use the exact same keywords that are in the knowledge base.

**Why Vector Stores are Ideal for AI Agents**

Vector stores are the preferred technology for AI agent knowledge bases for several key reasons:

* **Semantic Search:** They enable the agent to understand the *intent* behind a user's query, not just the literal words.
* **Speed:** They are highly optimized for fast and efficient searching, even with massive amounts of data.
* **Scalability:** They can handle millions of documents, allowing the agent's knowledge to grow over time.
* **Flexibility:** They can store not only text but also other types of data, such as images and audio.

In the raiaAI platform, the process of converting documents into vectors and storing them in the vector store is handled automatically. Your job is to provide high-quality, well-structured documents to ensure that the vectors are as meaningful as possible. In the next module, you will learn how to prepare your documents for this process using raia Academy.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.raiaai.com/ai-training/partner-training/raia-labs-training/part-2-agent-training/module-2-working-with-vector-stores.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
