A prompt template is reusable wording with placeholders for changing input. Like a Python f-string, it lets a chatbot wrap a user’s message in consistent instructions instead of rebuilding the whole prompt each time. section 12.3 section 12.5.2
In LangChain, declare the placeholder names and template, then connect the prompt to an LLM chain. Calling the chain with a value such as message supplies that input. Templates can also include a conversation-history placeholder, but the template alone does not preserve history: memory must supply it. section 12.5.2 section 12.5.2
A math-tutor prompt
A template can describe Rori as a math tutor, set expectations for the reply, and include {message} where the user’s words belong. An onboarding version can add {chat_history} and instructions for asking a parent’s permission before a child uses the chatbot. section 12.5.2 section 12.5.2
A carefully worded template can guide a response, but it does not guarantee one: a chatbot may still answer inappropriately or fail to remember earlier turns without conversation memory. section 12.5.2 section 12.5.2




















