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:
- "What are your refund policies?"
- "Can I return this product?"
- "How do I get my money back?"
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
Queries:
  - "What is your return policy?"
  - "Can I return items?"
  - "How do returns work?"

Good Responses:
  - "We accept returns within 30 days of purchase with original packaging."
  - "Items must be unused and in original condition."
  - "Refunds are issued to the original payment method within 5-7 business days."

Bad Responses:
  - "All sales are final." (incorrect)
  - "I'm not sure about our return policy." (unhelpful)
  - "You'll have to ask someone else." (deflecting)

2. Pricing & Billing

Critical for preventing misinformation about costs, pricing tiers, or billing processes.
Example: Pricing Filter
Queries:
  - "How much does it cost?"
  - "What are your prices?"
  - "Do you have a free plan?"

Good Responses:
  - "Our Basic plan starts at $29/month."
  - "We offer three tiers: Basic ($29), Pro ($79), and Enterprise (custom pricing)."
  - "Yes, we have a 14-day free trial with no credit card required."

Bad Responses:
  - "It's free." (if not accurate)
  - "Prices vary." (too vague)
  - "I don't know the pricing." (unhelpful)

3. Brand Voice & Messaging

Maintain consistent brand personality and messaging across all interactions.
Example: Brand Tone Filter
Queries:
  - "Who are you?"
  - "Tell me about your company"
  - "What makes you different?"

Good Responses:
  - "We're a customer-first company dedicated to making AI accessible to everyone."
  - "Our mission is to empower businesses with intelligent automation."
  - "We combine cutting-edge technology with exceptional support."

Bad Responses:
  - "We're just another AI company." (weak positioning)
  - "I don't know much about the company." (not brand-aligned)
  - Generic corporate speak that doesn't match your brand

4. Technical Support

Example: Troubleshooting Filter
Queries:
  - "My account won't log in"
  - "I forgot my password"
  - "Can't access my account"

Good Responses:
  - "Click 'Forgot Password' on the login page to reset your password."
  - "Check your email for a password reset link (it may take a few minutes)."
  - "If you don't receive the email, check your spam folder."

Bad Responses:
  - "Your account is probably locked." (assumption)
  - "Just try again later." (not helpful)
  - "Contact IT support." (deflecting when self-service is available)

5. Sensitive Topics

Handle sensitive or controversial topics with predefined, carefully crafted responses.
Example: Data Privacy Filter
Queries:
  - "Do you sell my data?"
  - "How do you use my information?"
  - "Is my data safe?"

Good Responses:
  - "We never sell your personal data to third parties."
  - "Your data is encrypted and stored securely in compliance with GDPR."
  - "You can view our full privacy policy at [link]."

Bad Responses:
  - "We might share some data." (vague and concerning)
  - "Don't worry about it." (dismissive)
  - "I can't answer privacy questions." (evasive)

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


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.