Custom Guidance
Overview
Custom Guidance gives you control over the AI Assistant tone and behavior with natural language instructions.
It can be used to:
- Change the Tone: Embedding a specific tone throughout a response.
- Structure Responses: Formatting answers with different headers or styles.
- Limit Answer Length: Setting a maximum length for responses.
- Guide Conversation Flow: Controlling the conversation flow and direction, like being more conversational.
- Ask clarifying questions: For when you'd like the AI assistant to ask the user clarifying questions on certain topics.
We include examples below for common scenarios that can be good starting points for your own prompt.
By default, Inkeep assistants have prompts that minimize hallucinations, control how the AI cites sources, protect your brand, and set other reasonable guard rails and behaviors we've found to work well across all of our customers for customer support scenarios. We recommend against adding guidance unless you have very specific behavior you are looking for that you don't already see.
Where to configure
Dashboard
To control the AI Assistant across all integrations of a project:
- Open the Inkeep Dashboard
- Navigate to your Project under Projects.
- Choose the Settings tab.
- Find Custom Guidance section.
- Add guidance in the
Label
,If
, andThen
structure as described in this guide. - Click on Update
- You can see the effects by testing the AI assistant under AI CHAT > Sandbox.
UI Widgets
If you prefer to customize the guidance on a per-integration basis, you can configure the aiChatSettings.guidance property of the uikit
components.
To do so, you can structure the guidance as XML, for example:
This is helpful when guidance is dynamic, like when it depends on the properties of an authenticated user inside of your application.
API
In the inkeep-qa
API, you can provide guidance as one or more system-level messages.
Prompting LLMs
When creating a rule, break it down into a Label, If, and Then. This mindset helps structure your instructions in a way that LLMs are more likely to "listen" to.
- Label: A succinct summary of the rule you're applying.
- If: A brief description of when your rule should be applied, usually as a condition or scenario. If you want it to always be applied, use
At All Times
. - Then: The action or behavior that should occur when the condition is met.
If
and Then
statements can be:
- Short: Succinct and to the point. Ideal for tones and speech patterns that are common and easy to understand.
- Long: Best for complex instructions or when extra context is needed. In these cases, we recommend using structured Markdown with Examples.
Example Guidance
- Label:
Emoji Inclusion ❤️
- If:
At All Times
- Then:
- Label:
Answer Every Question Like PERSON A
- If:
At All Times
- Then:
- Label:
Make All Links Clickable Hyperlinks
- If:
When writing a link to another website
- Then:
- Label:
Add Related Sources as Clickable Hyperlinks
- If:
At All Times
- Then:
- Label:
Avoid Verbosity
- If:
At All Times
- Then:
- Label:
Ask Clarifying Questions About Integration Platform
- If:
User query does not specify which platform or framework they are using when asking about Inkeep integration or setup
- Then:
General Tips
- Use Assertive and Direct Language: Employ clear and concise wording to increase the likelihood that the AI will follow your instructions.
- Be Specific and Unambiguous: Write instructions that are detailed and leave no room for interpretation. If a human might misunderstand your instructions, an LLM likely will too.
- Include Examples: Provide brief examples of both correct (good) and incorrect (bad) outputs to common scenarios relevant to a given rule.
- Use Exclamations and Bold Text for Emphasis: Highlight important phrases and words by incorporating exclamation points and applying bold formatting.
- Be careful with XML Tags: XML Tags can be powerful tools to structure and organize your prompts. However, if you use them, ensure they are properly closed. Use Markdown to start, and XML if your instructions get lengthy or list-like.
- Don't Be Afraid to Explain Reasoning: Within your action, you can explain your reasoning for how the examples were chosen and how the rule was applied. This helps the LLM understand your intent.
- Test Thoroughly: Create diverse test cases that capture your scenarios and verify the AI Assistant behaves consistently across all of them.
- Increase Level of Detail Gradually: Start with concise rules, but be prepared to use longer and more prescriptive
If
andThen
statements as you test your prompts.
Conclusion
Custom Guidance can help customize your AI assistant to your liking. If you need help, reach out to prompting@inkeep.com.