Skip to main content

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:
  1. Detecting specific query patterns that match your defined triggers
  2. Evaluating the similarity between user queries and your filter definitions
  3. Guiding the agent to use good responses or avoid bad responses
Think of Answer Filters as training wheels that help your agent stay on track, especially for critical topics where consistency and accuracy matter most.

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

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.
Example: Return Policy Filter

2. Pricing & Billing

Critical for preventing misinformation about costs, pricing tiers, or billing processes.
Example: Pricing Filter

3. Brand Voice & Messaging

Maintain consistent brand personality and messaging across all interactions.
Example: Brand Tone Filter

4. Technical Support

Example: Troubleshooting Filter

5. Sensitive Topics

Handle sensitive or controversial topics with predefined, carefully crafted responses.
Example: Data Privacy Filter

Benefits of Answer Filters

Ensure uniform responses across all user interactions for the same questions.
  • Same information every time
  • No contradictory answers
  • Reliable user experience
Guarantee correct information for critical topics.
  • Prevent hallucinations on important topics
  • Override model uncertainties
  • Maintain factual accuracy
Meet legal and regulatory requirements with consistent messaging.
  • Legal disclaimer compliance
  • GDPR/privacy law adherence
  • Industry-specific regulations
Protect your brand reputation by controlling sensitive responses.
  • Prevent off-brand messages
  • Avoid PR issues
  • Maintain professional tone
Improve response quality for common questions.
  • Better than generic AI responses
  • Incorporate domain expertise
  • Reduce need for human intervention

When to Use Answer Filters

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
Characteristics:
  • 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:
FeatureBest ForAnswer FiltersSystem PromptDatasources
Specific FAQsExact, consistent answersβœ… Ideal⚠️ Can drift⚠️ May vary
General KnowledgeBroad information❌ Too rigidβœ… Idealβœ… Ideal
PoliciesLegal/complianceβœ… Ideal⚠️ May forgetβœ… Good
Dynamic DataReal-time info❌ Static❌ No accessβœ… Ideal
Brand VoiceTone and style⚠️ Limitedβœ… Ideal❌ Wrong tool
Prohibited ContentBlock 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

Important Limitations to Understand:

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

Begin with your most critical topics
  • Identify 3-5 critical topics first
  • Test thoroughly before adding more
  • Expand based on actual user interactions
Clear, detailed definitions work best
  • Provide multiple query examples (3-5 per filter)
  • Write concrete good/bad responses
  • Avoid vague or ambiguous language
Validate filter behavior before deployment
  • Test with various phrasings
  • Check edge cases
  • Monitor initial interactions closely
Continuously improve your filters
  • Review agent conversations regularly
  • Add new query examples as you discover them
  • Refine responses based on user feedback
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?
1

Identify Critical Topics

List questions where consistency is crucial
2

Draft Responses

Write approved responses for each topic
3

Create Filter

Navigate to the Answer Filters tab and click β€œCreate Filter”
4

Test Behavior

Test with multiple query variations
5

Monitor & Adjust

Watch real conversations and refine as needed

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

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.
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.
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.
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.
Answer Filters guide specific responses to specific queries. Guardrails enforce broader safety and compliance rules across all interactions. Use both for comprehensive control.