Overview
| Property | Detail |
|---|---|
| Pattern | Simple RAG — The Foundation |
| Level | 1 (Entry point) |
| Embeddings | AWS Bedrock — Amazon Titan Embed Text v2 (1024 dims) |
| LLM | AWS Bedrock — Claude Sonnet (cross-region inference) |
| Vector DB | Qdrant Cloud (eu-west-2, cosine similarity) |
| Framework | LangChain |
| Notebook | 01_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]
endHow It Works
| Step | Action | Detail |
|---|---|---|
| 1 | Load PDF | PyPDF extracts text from document |
| 2 | Chunk | Split every 1000 characters (fixed size) |
| 3 | Embed | Amazon Titan Embed Text v2 → 1024-dim vectors |
| 4 | Store | Upload vectors to Qdrant Cloud |
| 5 | Query | Embed 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
| Component | Technology |
|---|---|
| Embeddings | AWS Bedrock — Amazon Titan Embed Text v2 (1024 dims) |
| LLM | AWS Bedrock — Claude Sonnet |
| Vector DB | Qdrant Cloud (cosine similarity) |
| PDF Reader | PyPDF |
| Framework | LangChain |
| Config | Centralized .env file |
Limitations
| Limitation | Impact | Solution |
|---|---|---|
| Fixed 1000-char splits | May cut mid-sentence | → Semantic Chunking |
| No relevance check | Returns whatever is "similar" | → Self-RAG |
| No quality filter | Top-K may include noise | → Reranking |
| No verification | LLM may hallucinate | → Reliable RAG |
When to Use
| Scenario | Use Simple RAG? |
|---|---|
| Quick prototype / POC | Yes |
| Learning RAG concepts | Yes |
| Production with high accuracy needs | No — add reranking + verification |
| Long documents with topic shifts | No — use semantic chunking |