Skip to main content
The /answer endpoint processes support tickets through the RAG system, combining ML triage classification with retrieval-augmented generation to provide comprehensive, citation-backed answers.

Endpoint

POST /api/v1/answer

Request Body

subject
string
required
The subject line of the support ticket
body
string
required
The full body/description of the support ticket
user_question
string
Optional specific question from the user. If not provided, the system will generate an answer based on the subject and body.

Response

triage
object
required
ML triage classification results
draft_reply
string
required
AI-generated draft response to send to the customer
internal_next_steps
array
required
List of recommended next steps for internal support team
citations
array
required
Source documents and snippets used to generate the answer
needs_human_review
boolean
required
Flag indicating whether the ticket requires human review before responding

Example Request

curl -X POST "http://localhost:8000/api/v1/answer" \
  -H "Content-Type: application/json" \
  -d '{
    "subject": "Refund issue",
    "body": "I was charged twice",
    "user_question": "Can I get a refund?"
  }'

How It Works

The /answer endpoint performs the following operations:
  1. Triage Classification - Predicts the ticket category and priority using ML models
  2. Document Retrieval - Searches the knowledge base for relevant information
  3. Answer Generation - Uses an LLM to generate a structured response with:
    • Customer-facing draft reply
    • Internal next steps for support agents
    • Citations from source documents
    • Human review flag based on confidence scores
Ensure documents have been ingested into the knowledge base using the /ingest endpoint before querying for answers.

Build docs developers (and LLMs) love