An Introduction To

How AI Gets the
Right Information

Understanding Retrieval-Augmented Generation (RAG),
vector embeddings, and why "just searching for it" isn't enough

Context Embeddings Retrieval
The Problem

AI Can't Read Everything at Once

Large Language Models have a limited "context window" β€” like a desk that can only hold so many papers at a time.

Your Organization's Documents

πŸ“‹
HR Policy Manual (240 pages)
πŸ“Š
Q3 Financial Report
πŸ“
Employee Handbook
πŸ’»
IT Security Guidelines
πŸ“ž
Customer Service Scripts
βš–οΈ
Legal Compliance Docs
πŸ“ˆ
Sales Playbook
πŸ”§
Technical Documentation
AI Model
Context Window
Empty slot
Empty slot
Empty slot
Empty slot
⚠️ Can't fit everything!

We need to choose the right information to include

The Naive Approach

Why Keyword Search Falls Short

βœ“ What keyword search finds
"Sick leave is accrued at 1 day per month of service..."
Direct keyword match βœ“
"Employees must notify HR for sick leave exceeding 3 days..."
Direct keyword match βœ“
βœ— What keyword search misses
"Paid time off for medical appointments requires 48-hour notice..."
Relevant! But doesn't say "sick leave"
"Short-term disability benefits begin after 5 consecutive absences..."
Highly relevant! But uses different words
"The wellness program provides mental health days..."
Related concept, different terminology
⚬ False positives
"The team is sick of delays β€” leave your feedback in Jira..."
Matched the words, not the meaning!
πŸ’‘
The gap: Keyword search matches words, not meaning. It can't understand that "medical appointments," "disability benefits," and "sick leave" are all related concepts.
The Breakthrough

Turning Meaning into Numbers

What if we could convert text into numbers that capture its meaning?

"What is our sick leave policy?"
Embedding Model
Vector Embedding (768 dimensions)
[ 0.234, -0.891, 0.142, 0.567, -0.321, 0.089, ... ]
Each number captures a facet of meaning β€” topic, intent, tone, relationships. Sentences with similar meanings get similar numbers, even if they use completely different words.
Important distinction: The models that create these embeddings are specialized AI models β€” trained on billions of pages of text to understand meaning. They're different from the chatbot-style AI (like ChatGPT or Claude) that generates text. Think of them as two specialists: one reads and understands, the other writes.
"What is our sick leave policy?"
[ 0.234, -0.891, 0.142, 0.567, ... ]
Our original question
Numbers
are close! β†’
"Paid time off for medical appointments"
[ 0.251, -0.873, 0.138, 0.590, ... ]
Different words, similar meaning β†’ similar numbers!
Numbers
are far! β†’
"Sick bass guitar riff"
[ -0.672, 0.401, 0.823, -0.109, ... ]
Same word "sick" but completely different meaning
Visualizing It

The Meaning Map

Time Off & Leave "Sick leave policy" "PTO guidelines" "Medical appointments" "Disability benefits" "Wellness days" IT & Security "Password policy" "VPN access" "Data encryption" Finance & Expenses "Travel expenses" "Budget approvals" "Sick bass guitar riff" 🎸 YOUR QUERY

How to Read This

Each dot represents a chunk of text from your documents, plotted by its meaning. Points that are close together are semantically similar β€” even if they use completely different words.

πŸ” Your Question

"What is our sick leave policy?"
Nearest matches:
β€’ Sick leave policy
β€’ PTO guidelines
β€’ Medical appointments
β€’ Disability benefits

Far away: "Sick bass guitar riff" 🎸

The Key Insight

By finding the nearest neighbors in this space, we retrieve documents by meaning, not just matching words.

Putting It Together

The RAG Pipeline

Retrieval-Augmented Generation: giving the AI the right information at the right time

1❓
Your Question
"What is our sick leave policy?"
2πŸ”’
Convert to Vector
Turn the question into numbers that capture meaning
3πŸ—ΊοΈ
Find Nearest Matches
Search the meaning map for the closest documents
4πŸ“‹
Pack the Context
Feed only the most relevant info into the AI
5πŸ’¬
AI Answers
A smart, informed response based on your actual documents
πŸ“‹ HR Policy Manual
πŸ“Š Q3 Financial Report
πŸ“ Employee Handbook
πŸ’» IT Security Guidelines
πŸ“ž Customer Service Scripts
βš–οΈ Legal Compliance Docs
πŸ“ˆ Sales Playbook
πŸ”§ Technical Documentation
All your documents
AI Model
Context Window
Empty
Empty
Empty
Empty
βœ“ Right information, ready to answer!
RAG = Retrieval-Augmented Generation
Instead of hoping the AI "knows" the answer, we retrieve the right information and give it to the AI β€” producing answers that are accurate, up-to-date, and grounded in your actual data.

Key Takeaways

πŸ“¦

Limited Context

AI models can only look at so much information at once β€” you need to be selective.

πŸ”’

Meaning as Numbers

Embeddings capture the meaning of text as numbers, so similar ideas have similar vectors.

🎯

Smarter Retrieval

RAG finds documents by meaning, not just keywords β€” then feeds the best matches to the AI.

The smarter the retrieval, the better the answer.

Press ← β†’ arrow keys or click buttons