← Home Pipeline
User Input
Text message or Helper button click
Text Input
Free-text typed by user
STEP 0
Input Router
Count words in user input
1-3 words 4+ words
Word Count?
STEP 1
Term Checker
Define medical term, assign category, generate engagement prompts
V2_GPT_DEFINE_TERM
Is Term?
Yes
Return definition + engagement prompts, set variant=TERM
No
Fall through to Question Checker
STEP 2
Question Checker
Validate input, extract keywords, revise question, detect language
V2_GPT_CHECK_QUESTION
Accepted?
Accepted
Set variant=HEALTH, use revised question
Rejected
Noise / Insufficient / Off-topic / Inappropriate
Helper Button
Symptom / Medicine / Fact Check / Health
Set Variant
Skip Steps 0-2, return starting_question from prompt DB
STEP 3
Conversation
Multi-turn exchange using variant-specific prompt. Generates system_response + system_question. Tracks conversation_history.
HEALTH V2_GPT_HEALTH
TERM V2_GPT_TERM
SYMPTOM V2_GPT_SYMPTOM
MEDICINE V2_GPT_MEDICINE
FACT CHECK V2_GPT_FACT_CHECK
TURN 5
Consent Check
At turn 5 if consent_check is NULL, set to PENDING and ask for consent
Stop 1 — Red Flags Life-threatening symptoms detected
Stop 2 — 7-Turn Limit 7 follow-up questions reached
Stop 3 — Disengagement Consent declined or 2 non-responsive replies
Continue?
state = active / complete / disengaged
Active
Return response to user, wait for next input, loop back to Step 3
Inactive
Conversation ended, proceed to post-processing
STEP 5
Persona Extraction
Extract/update user health persona from conversation history + keywords
V2_GPT_PERSONA
STEP 8
Answer Checker
Quality scoring: 7 metrics (no_presumptions, truthful, fact_based, complete, available_information, relevant, clear) with weighted score 0-4
V2_GPT_CHECK_POST
STEP 6
Frame
Structure answer for publishing
STEP 7
Write
Generate formatted post
STEP 9
SEO Optimize
V2_GPT_SEO_OPTIMIZE
Published Post
SEO-optimized health content ready for medwiki.co.uk
Entry / Output
LLM Processing Step
Decision
Success / Continue
Stop / Reject
Helper Bypass
Planned / Future