Best practices
- Separate system and user prompts – use structured prompt blocks for clarity. Keep system instructions at the start and example interactions after RAG results to avoid confusion.
- Control retrieval – set appropriate similarity thresholds and max chunks for each knowledge base. Use priority values to rank sources and fallback thresholds to switch retrieval methods.
- Secure API calls – provide proper authentication in API sources and sanitize query parameters. Use caching to improve performance.
- Test before deploying – create multiple test scenarios to verify that the bot behaves correctly with different prompts, knowledge bases and metadata.
- Provide clear onboarding – write a friendly initial message and starter prompts to guide users. Include a disclaimer reminding users to verify information.
- Customize the look – align chat colours and fonts with your brand. If embedding on a website, adjust dimensions for a seamless fit.
