Menu

1 / 2

RAG - Vector DB

DEV Community·Ramya Perumal·6 months ago
#RyuWvIN5
#beginners#ai#software#coding#vector
Reading 0:00
15s threshold

What is a Vector Database?

A vector database is a database used to store vectors (points in space) where data with similar meanings are positioned close together. These vectors are generated using embedding models or LLM embedding models. One of the embedding models is nomic-embed-text . We can download this model using Ollama.

Why Vector DB in RAG?

One-hot encoding is a technique used to convert categorical data (like words) into binary vectors.

How it works:

Each unique word in a vocabulary is mapped to a vector that is mostly zeros except for a single 1 at a specific index.

Example:

Today is Wednesday

Tomorrow is Thursday

I am travelling Today

Wednesday is a nice series

Vocabulary values:

[Today, is, Wednesday, Tomorrow, Thursday, I, am, Travelling, a, nice, series]

Vector representation:

Line 1 = [1,1,1,0,0,0,0,0,0,0,0]

Line 2 = [0,1,0,1,1,0,0,0,0,0,0]

Line 3 = [1,0,0,0,0,1,1,1,0,0,0]

Line 4 = [0,1,1,0,0,0,0,0,1,1,1]

Disadvantages:

No semantic meaning

High dimensionality

Not…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.