Skip to main content

Create Answer Filter

Add an answer filter to an agent. Answer filters help fine-tune the agent for specific queries by providing examples of good and bad responses.

Path Parameters

agent_id
string
required
The unique identifier of the agent

Request Body

queries
array
required
Array of query strings that this filter should apply to
trigger_threshold
number
Threshold value for triggering the filter (0.0 - 1.0, default: 0.5)
bad_responses
array
required
Array of examples of bad/unwanted responses
good_responses
array
required
Array of examples of good/desired responses

Response

id
string
Answer filter unique identifier
agent_id
string
ID of the agent this filter belongs to
trigger_threshold
number
Threshold value for triggering the filter
queries
array
Array of query strings this filter applies to
bad_responses
array
Array of bad response examples
good_responses
array
Array of good response examples
created_at
string
When the filter was created (ISO 8601 format)
updated_at
string
When the filter was last updated (ISO 8601 format)
curl --location --request POST 'https://api.plaisolutions.com/agents/agent_123/answer-filters' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
  "queries": [
    "What are your refund policies?",
    "How do I return an item?",
    "Can I get my money back?"
  ],
  "trigger_threshold": 0.7,
  "bad_responses": [
    "I dont know about refunds.",
    "You cannot return anything.",
    "No refunds allowed."
  ],
  "good_responses": [
    "Our refund policy allows returns within 30 days of purchase with original receipt.",
    "You can return items in their original condition within 30 days for a full refund.",
    "We offer hassle-free returns within 30 days of purchase."
  ]
}'

Get Answer Filters

Get all answer filters for an agent.

Path Parameters

agent_id
string
required
The unique identifier of the agent

Response

count
integer
Total number of answer filters
has_more
boolean
Whether there are more results available
data
array
Array of answer filter objects
curl --location --request GET 'https://api.plaisolutions.com/agents/agent_123/answer-filters' \
--header 'Authorization: Bearer YOUR_TOKEN'

Update Answer Filter

Update an existing answer filter for an agent.

Path Parameters

agent_id
string
required
The unique identifier of the agent
answer_filter_id
string
required
The unique identifier of the answer filter

Request Body

queries
array
Updated array of query strings that this filter should apply to
trigger_threshold
number
Updated threshold value for triggering the filter (0.0 - 1.0)
bad_responses
array
Updated array of examples of bad/unwanted responses
good_responses
array
Updated array of examples of good/desired responses

Response

Returns the updated answer filter object.
curl --location --request PATCH 'https://api.plaisolutions.com/agents/agent_123/answer-filters/filter_456' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
  "trigger_threshold": 0.8,
  "good_responses": [
    "Our comprehensive refund policy allows returns within 30 days of purchase with original receipt.",
    "You can easily return items in their original condition within 30 days for a full refund.",
    "We offer a customer-friendly return policy with hassle-free returns within 30 days of purchase."
  ]
}'

Delete Answer Filter

Delete an answer filter from an agent.

Path Parameters

agent_id
string
required
The unique identifier of the agent
answer_filter_id
string
required
The unique identifier of the answer filter to delete

Response

Returns a 204 status code on successful deletion.
curl --location --request DELETE 'https://api.plaisolutions.com/agents/agent_123/answer-filters/filter_456' \
--header 'Authorization: Bearer YOUR_TOKEN'

Understanding Answer Filters

Answer filters are a powerful mechanism for improving agent responses through example-based learning. They work by:
1

Query Matching

When a user query comes in, the system calculates similarity scores against the filter’s query examples
2

Threshold Check

If the similarity score exceeds the trigger threshold, the filter activates
3

Response Guidance

The agent uses the good/bad response examples to guide its answer generation
4

Quality Improvement

Over time, this leads to more consistent and higher-quality responses for specific topics

Best Practices

  • Include 3-5 different ways users might ask the same question
  • Use natural language variations and synonyms
  • Consider different levels of formality
  • Include common misspellings or abbreviations if relevant
  • Provide 2-3 examples of ideal responses
  • Include 2-3 examples of poor responses to avoid
  • Make examples specific and detailed
  • Ensure good examples follow your brand voice and guidelines
  • Start with 0.5 and adjust based on performance
  • Higher thresholds (0.7-0.9) for very specific topics
  • Lower thresholds (0.3-0.5) for broader topic categories
  • Monitor and adjust based on activation frequency
  • Regularly review and update filters based on new queries
  • Remove or modify filters that are no longer relevant
  • Add new filters for emerging topics or issues
  • Test filters with real user queries

Use Cases

Customer Support

Filter common support queries like refunds, shipping, or technical issues to ensure consistent, accurate responses

Product Information

Standardize responses about product features, specifications, and availability

Policy Clarification

Ensure accurate communication of company policies, terms of service, or legal information

Brand Voice

Maintain consistent tone and messaging across all agent interactions
Answer filters complement but do not replace comprehensive training data. They work best for fine-tuning specific response patterns rather than teaching entirely new knowledge.
Monitor filter performance through agent analytics to identify which filters are most effective and which may need adjustment.