Answer Filters Overview
Answer Filters are a powerful feature in PLai Framework that allow you to define specific response patterns for your agents. They enable you to control what your agent should or shouldnβt say when users ask certain types of questions, ensuring consistent, accurate, and brand-appropriate responses.What are Answer Filters?
Answer Filters act as intelligent guards for your agentβs responses. They work by:- Detecting specific query patterns that match your defined triggers
- Evaluating the similarity between user queries and your filter definitions
- Guiding the agent to use good responses or avoid bad responses
Control Responses
Define exactly what your agent should say for specific queries
Prevent Mistakes
Block inappropriate or incorrect responses before they reach users
Brand Consistency
Ensure responses align with your brand voice and policies
Quality Assurance
Maintain high-quality, accurate information delivery
How Answer Filters Work
Answer Filters operate using a similarity-based matching system:Key Components
- Queries
- Good Responses
- Bad Responses
- Trigger Threshold
Definition: Example questions or topics that trigger this filter.Purpose: Help the system identify when to apply the filter based on user input similarity.Example:These query examples train the filter to recognize similar questions from users.
Use Cases
Answer Filters excel in scenarios where consistency and accuracy are crucial:1. Policy & Compliance
Ensure your agent always provides accurate information about company policies, legal requirements, or compliance matters.
2. Pricing & Billing
Example: Pricing Filter3. Brand Voice & Messaging
Maintain consistent brand personality and messaging across all interactions.
4. Technical Support
Example: Troubleshooting Filter5. Sensitive Topics
Example: Data Privacy FilterBenefits of Answer Filters
Consistency
Consistency
Ensure uniform responses across all user interactions for the same questions.
- Same information every time
- No contradictory answers
- Reliable user experience
Accuracy
Accuracy
Guarantee correct information for critical topics.
- Prevent hallucinations on important topics
- Override model uncertainties
- Maintain factual accuracy
Compliance
Compliance
Meet legal and regulatory requirements with consistent messaging.
- Legal disclaimer compliance
- GDPR/privacy law adherence
- Industry-specific regulations
Brand Protection
Brand Protection
Protect your brand reputation by controlling sensitive responses.
- Prevent off-brand messages
- Avoid PR issues
- Maintain professional tone
Quality Control
Quality Control
Improve response quality for common questions.
- Better than generic AI responses
- Incorporate domain expertise
- Reduce need for human intervention
When to Use Answer Filters
- β Good Use Cases
- β When Not to Use
- βοΈ Consider Carefully
Answer Filters are ideal for:
- π Company policies (returns, privacy, terms)
- π° Pricing and billing information
- π Security and compliance topics
- π’ Brand messaging and positioning
- π Critical troubleshooting steps
- π Contact information and escalation paths
- βοΈ Legal disclaimers and requirements
- π― FAQs with specific approved answers
- High-stakes information
- Needs to be consistent
- Cannot be βcreativeβ or varied
- Subject to legal/compliance review
Answer Filters vs. Other Approaches
Understanding when to use Answer Filters versus other PLai Framework features:| Feature | Best For | Answer Filters | System Prompt | Datasources |
|---|---|---|---|---|
| Specific FAQs | Exact, consistent answers | β Ideal | β οΈ Can drift | β οΈ May vary |
| General Knowledge | Broad information | β Too rigid | β Ideal | β Ideal |
| Policies | Legal/compliance | β Ideal | β οΈ May forget | β Good |
| Dynamic Data | Real-time info | β Static | β No access | β Ideal |
| Brand Voice | Tone and style | β οΈ Limited | β Ideal | β Wrong tool |
| Prohibited Content | Block specific responses | β Ideal | β οΈ Can be overridden | β Wrong tool |
Best Practice: Combine multiple approaches for optimal results. Use Answer Filters for critical, specific content, System Prompts for general behavior, and Datasources for knowledge retrieval.
Limitations & Considerations
Similarity Matching
Answer Filters use semantic similarity, not exact matching:- User queries donβt need to match exactly
- Similar phrasings will trigger the same filter
- Very creative phrasings might not trigger
Not a Hard Block
Answer Filters guide the agent but donβt completely override its behavior:- Agents can still deviate slightly from good responses
- Answer Filters influence but donβt guarantee exact wording
- For absolute control, consider using Structured Output mode
Maintenance Required
- Keep filters updated as policies change
- Review and refine based on actual usage
- Remove outdated filters promptly
Performance Impact
- Too many filters can slow response time slightly
- Each filter adds processing overhead
- Aim for 10-20 filters per agent (not a hard limit)
Best Practices
Start Small
Start Small
Begin with your most critical topics
- Identify 3-5 critical topics first
- Test thoroughly before adding more
- Expand based on actual user interactions
Be Specific
Be Specific
Clear, detailed definitions work best
- Provide multiple query examples (3-5 per filter)
- Write concrete good/bad responses
- Avoid vague or ambiguous language
Test Thoroughly
Test Thoroughly
Validate filter behavior before deployment
- Test with various phrasings
- Check edge cases
- Monitor initial interactions closely
Monitor & Iterate
Monitor & Iterate
Continuously improve your filters
- Review agent conversations regularly
- Add new query examples as you discover them
- Refine responses based on user feedback
Document Your Answer Filters
Document Your Answer Filters
Keep track of why filters exist
- Note the business reason for each filter
- Document expected behavior
- Set reminders to review periodically
Getting Started
Ready to create your first Answer Filter?Next Steps
Creating Answer Filters
Step-by-step guide to creating your first filter
Managing Answer Filters
Learn to edit, update, and delete filters
Agent Settings
Configure other agent features
Analytics
Monitor how filters affect conversations
Common Questions
How many Answer Filters can I create per agent?
How many Answer Filters can I create per agent?
Thereβs no hard limit, but we recommend keeping it under 50 filters per agent for optimal performance. Focus on quality over quantity β a few well-crafted filters are more effective than many vague ones.
Can filters conflict with each other?
Can filters conflict with each other?
If multiple filters match the same query, the system will consider all applicable filters. This usually works well, but you should test to ensure filters complement rather than contradict each other.
Do Answer Filters work in all languages?
Do Answer Filters work in all languages?
Yes, Answer Filters work with multilingual agents. However, youβll need to create separate filters for each language or use the Language Detection feature to maintain consistency across languages.
Can I export/import filters between agents?
Can I export/import filters between agents?
Currently, filters are agent-specific and cannot be bulk exported/imported. However, you can manually recreate filters on different agents. Bulk management features are on our roadmap.
What's the difference between Answer Filters and Guardrails?
What's the difference between Answer Filters and Guardrails?
Answer Filters guide specific responses to specific queries. Guardrails enforce broader safety and compliance rules across all interactions. Use both for comprehensive control.