Instructor
Context Injection means adding relevant information to a prompt so that an AI system can produce a more accurate and relevant response.
Prompt:
“Explain the policy.”
The AI does not know:
The result may be vague or incorrect.
Prompt:
“Using the company HR policy document, explain the leave policy for employees.”
Now the AI has specific context and can produce a more useful, document-grounded answer.
The user submits a question or request.
The system collects relevant information such as:
The system creates a combined prompt:
User Query + Retrieved Information + System Instructions
The LLM processes the enriched prompt and generates the response.
Information that remains fixed across interactions.
Examples:
Information that changes according to the current request.
Examples:
Information from previous messages in the same conversation.
Examples:
A prompt template is a reusable structure for creating consistent AI instructions.
A good template can include:
Defines how the AI should behave.
Example:
“You are a professional teacher.”
Defines what the AI should do.
Example:
“Explain photosynthesis clearly.”
Provides background information or retrieved documents.
Defines how the response should be structured.
Here:
Role → Expert AI tutor
Task → Explain the topic
Context → {topic}
Output Format → Examples + 3-point summary
Too much context can:
Stale or poor-quality context can also lead to inaccurate responses.
This course includes 0 modules, 0 lessons, and 0 hours of materials.
Reply to Comment