S
Saurav Danej
90-Day AI/ML LinkedIn Content System
← All days
62
Day 62 of 90RAG

Augmenting the prompt — the most overlooked step

POST 1 of 5 MorningRAGConcept

How you stuff context into the prompt matters

Most RAG tutorials write:

f'Use this context.\n\n{context}\n\nQuestion: {q}'

That's a starting point, not production. Better prompts:
- Tell the model when there's no relevant info ('say I don't know')
- Number chunks and ask for citations
- Constrain answer length and format
- Set a system role for tone

The prompt is half the system. A great retrieval with a sloppy prompt still gives meh answers.
#RAG#LLM#VectorDatabase#AI#100DaysOfCode#PromptEngineering
POST 2 of 5 MiddayRAGDeep dive

A robust RAG prompt template

Mine, distilled from many tries:

System: 'You are an expert assistant. Answer using only the context. If context is insufficient, say I don't know.'

User: '<context>\n[1] {chunk1}\n[2] {chunk2}\n...\n</context>\n\nQuestion: {q}\n\nRules:\n- Cite sources as [1], [2]\n- Quote relevant snippet for each cite\n- If context insufficient, say so'

That's it. Three rules, one structure, every chunk numbered. The model now knows what to do.
#RAG#LLM#VectorDatabase#AI#100DaysOfCode#RAG
POST 3 of 5 AfternoonRAGCode

RAG prompt builder — the function I keep around

Same shape every time. Numbered context, system role, instructions block. Take this; tweak the system prompt to your domain; ship.
#RAG#LLM#VectorDatabase#AI#100DaysOfCode#PromptEngineering
POST 4 of 5 EveningRAGTip

Lower temperature for RAG — usually 0

RAG is a knowledge task. You want consistent, grounded answers. Set temperature=0 (or close).

Higher temperatures = more creative phrasing but also more hallucinations and inconsistencies. For 'answer this question from these docs', creativity is a bug, not a feature.

For agent-style flows that need exploration, raise temperature. For Q&A, keep it cold.
#RAG#LLM#VectorDatabase#AI#100DaysOfCode#PromptEngineering
POST 5 of 5 NightRAGRecap

Day 62 — the prompt is half the system

Day 62 done.

- Stuffing matters
- Numbered context, citation rule
- Reusable prompt builder
- Temperature = 0 for Q&A

Tomorrow (Day 63): evaluating RAG. Without it, you're shipping vibes. Then we close week 9.
#RAG#LLM#VectorDatabase#AI#100DaysOfCode#RAG