Beginner8 min read2 of 40

Simple RAG

The foundation — load a PDF, split into chunks, embed with Bedrock Titan, store in Qdrant, and retrieve by similarity.

Overview

PropertyDetail
PatternSimple RAG — The Foundation
Level1 (Entry point)
EmbeddingsAWS Bedrock — Amazon Titan Embed Text v2 (1024 dims)
LLMAWS Bedrock — Claude Sonnet (cross-region inference)
Vector DBQdrant Cloud (eu-west-2, cosine similarity)
FrameworkLangChain
Notebook01_Simple_RAG.ipynb

Architecture

flowchart TD
    subgraph INGEST["📥 Indexing Pipeline"]
        A[PDF Document] --> B[Split every 1000 chars]
        B --> C[Embed with Bedrock Titan]
        C --> D[(Qdrant Cloud)]
    end

    subgraph QUERY["🔍 Query Pipeline"]
        E[User Query] --> F[Embed query with same model]
        F --> G{Cosine Similarity Search}
        D --> G
        G --> H[Return top-2 most similar chunks]
    end

How It Works

StepActionDetail
1Load PDFPyPDF extracts text from document
2ChunkSplit every 1000 characters (fixed size)
3EmbedAmazon Titan Embed Text v2 → 1024-dim vectors
4StoreUpload vectors to Qdrant Cloud
5QueryEmbed question → cosine similarity search → top-2 chunks

Test Output

Query: "What causes climate change?" → Returns the 2 most similar chunks from the PDF that discuss causes of climate change.

Think of it as: A search engine for your documents.


Tech Stack

ComponentTechnology
EmbeddingsAWS Bedrock — Amazon Titan Embed Text v2 (1024 dims)
LLMAWS Bedrock — Claude Sonnet
Vector DBQdrant Cloud (cosine similarity)
PDF ReaderPyPDF
FrameworkLangChain
ConfigCentralized .env file

Limitations

LimitationImpactSolution
Fixed 1000-char splitsMay cut mid-sentenceSemantic Chunking
No relevance checkReturns whatever is "similar"Self-RAG
No quality filterTop-K may include noiseReranking
No verificationLLM may hallucinateReliable RAG

When to Use

ScenarioUse Simple RAG?
Quick prototype / POCYes
Learning RAG conceptsYes
Production with high accuracy needsNo — add reranking + verification
Long documents with topic shiftsNo — use semantic chunking

Source