LangChat uses two prompt templates internally:Documentation Index
Fetch the complete documentation index at: https://langchat.neurobrains.co/llms.txt
Use this file to discover all available pages before exploring further.
- System prompt — defines the chatbot’s persona, task, and how to use context
- Standalone question prompt — reformulates follow-up questions into self-contained queries before searching
System prompt
The system prompt is built once per message. It contains three required placeholders:| Placeholder | Filled with |
|---|---|
{context} | Top retrieved document chunks (after reranking) |
{chat_history} | Recent conversation exchanges |
{question} | The user’s current message |
Default template
Custom template
Passprompt_template when creating LangChat:
Domain-specific examples
Standalone question prompt
Before searching Pinecone, LangChat reformulates the user’s message to be self-contained. This handles follow-up questions like:- “What about the pricing?” → “What is Acme Corp’s pricing?”
- “Can you explain that further?” → “Can you explain Acme Corp’s refund policy further?”
Default behavior
The default prompt:- Uses the LLM to rephrase the question
- Keeps greetings unchanged (hi, hello, hey)
- Always generates questions in English
Custom standalone question prompt
{chat_history} and {question}.
Prompt tips
Be specific about tone. “Be concise and professional” produces very different results than the default. Tell the model what to do when it doesn’t know. If you don’t specify, it may hallucinate. Add: “If the answer is not in the context, say you don’t know.” Set the output format. If you need structured output: “Always respond with bullet points.” or “Answer in 2-3 sentences maximum.” Keep{context} early. Models attend more strongly to content near the start of the prompt.
Test with verbose=True. See exactly what prompt is being sent:
