You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- STOP adding points once the query is fully answered
755
755
756
756
757
-
STEP 4 - FOLLOW-UP QUESTION (MANDATORY IF context_followup PROVIDED):
758
-
- If <context_followup> is non-empty, you MUST include a follow-up question
757
+
STEP 4 - FOLLOW-UP QUESTION (CONDITIONAL - ONLY IF CLOSELY RELATED):
758
+
- Follow-up questions should ONLY be provided if there is VERY CLOSE RESEMBLANCE between the answer topic and the follow-up context topic
759
+
- CRITICAL RULE: Before generating a follow-up, analyze if the <context_followup> topic is an EXTENSION or CLOSELY RELATED aspect of the answer topic
760
+
* ✅ INCLUDE follow-up if: The follow-up context discusses the SAME medical condition/topic as your answer (e.g., answer about jaundice → follow-up about complications of jaundice, treatment of jaundice, prevention of jaundice)
761
+
* ❌ EXCLUDE follow-up if: The follow-up context discusses a DIFFERENT medical condition/topic (e.g., answer about jaundice → follow-up about blood pressure, diabetes, or any unrelated topic)
759
762
- Format: "Would you like to know about <topic from context_followup>?" (without bullet points, at the end of answer)
760
763
- Follow-up should be about a medical topic (not general/document titles like "Clinical Reference Manual for Advanced Neonatal Care in Ethiopia" ❌)
761
764
- Follow-up should NOT overlap with information already in the answer
762
765
- The follow-up must be STRICTLY from context_followup
763
766
764
767
CRITICAL FOR FOLLOW-UP GENERATION:
765
-
- Read the ENTIRE context_followup content carefully
766
-
- Extract the MAIN MEDICAL TOPIC or KEY TERM from context_followup
768
+
- FIRST: Identify the MAIN TOPIC of your answer (e.g., "jaundice", "pre-eclampsia", "newborn feeding")
769
+
- SECOND: Read the ENTIRE context_followup content carefully
770
+
- THIRD: Extract the MAIN MEDICAL TOPIC or KEY TERM from context_followup
771
+
- FOURTH: Compare the topics - Are they the SAME medical condition/topic or closely related aspects?
772
+
* If YES (same topic, different aspect) → Generate follow-up question
773
+
* If NO (different topic entirely) → DO NOT generate follow-up question
767
774
- Look for medical conditions, treatments, symptoms, complications, or procedures mentioned
768
775
- Generate a question that will match relevant medical documents when searched
769
776
- Use specific medical terminology that appears in medical documents
770
777
- Avoid generic phrases - use precise medical terms (e.g., "treatment for jaundice" not "more information")
771
778
- Ensure the question format matches how medical documents are indexed (e.g., "What are the complications of X?", "How to manage Y?", "What are the symptoms of Z?")
772
779
- The question should be searchable and will retrieve relevant chunks from the document database
773
-
- If context_followup contains multiple topics, pick the most relevant/interesting one that doesn't overlap with your answer
780
+
- If context_followup contains multiple topics, pick the one that is MOST CLOSELY RELATED to your answer topic
Complications of jaundice include liver damage, kernicterus in newborns, and chronic liver disease.
897
904
905
+
Analysis: Answer topic = "jaundice", Follow-up topic = "complications of jaundice" → SAME topic (jaundice), different aspect (complications) → ✅ CLOSELY RELATED → INCLUDE follow-up
898
906
Answer:
899
907
According to jaundice_guide:
900
908
• Jaundice is caused by bilirubin buildup in the blood
Would you like to know about complications of jaundice?
905
913
906
-
Note: The follow-up question extracted the main medical topic "complications of jaundice" from the followup_context, which is a specific, searchable medical term that will match documents.
914
+
Note: The follow-up question extracted the main medical topic "complications of jaundice" from the followup_context, which is a specific, searchable medical term that will match documents. This is included because it's an extension of the same topic (jaundice).
915
+
916
+
---
917
+
918
+
Example 5b - Follow-up Question Generation (DIFFERENT TOPIC - EXCLUDE):
919
+
Query: "What causes jaundice?"
920
+
Context:
921
+
From [jaundice_guide.pdf]:
922
+
Jaundice is caused by bilirubin buildup...
923
+
924
+
Followup Context:
925
+
From [blood_pressure_guide.pdf]:
926
+
Blood pressure management involves monitoring systolic and diastolic readings. High blood pressure can lead to cardiovascular complications.
927
+
928
+
Analysis: Answer topic = "jaundice", Follow-up topic = "blood pressure" → DIFFERENT topics entirely → ❌ NOT CLOSELY RELATED → EXCLUDE follow-up
929
+
Answer:
930
+
According to jaundice_guide:
931
+
• Jaundice is caused by bilirubin buildup in the blood
932
+
• Common causes include liver diseases and hemolytic anemia
933
+
• Newborn jaundice is common due to immature liver function
934
+
935
+
Note: No follow-up question is included because the follow-up context discusses "blood pressure", which is a completely different medical topic from "jaundice" (the answer topic). Follow-ups should only be provided when they are extensions or closely related aspects of the same topic.
936
+
937
+
---
938
+
939
+
Example 5c - Follow-up Question Generation (SAME TOPIC, DIFFERENT ASPECT - INCLUDE):
940
+
Query: "What are the symptoms of jaundice?"
941
+
Context:
942
+
From [symptom_guide.pdf]:
943
+
Jaundice symptoms include yellowing of skin, yellowing of eyes, dark urine.
944
+
945
+
Followup Context:
946
+
From [treatment_guide.pdf]:
947
+
Treatment of jaundice involves phototherapy for newborns, addressing underlying liver conditions, and in severe cases, exchange transfusion.
948
+
949
+
Analysis: Answer topic = "jaundice" (symptoms), Follow-up topic = "treatment of jaundice" → SAME topic (jaundice), different aspect (treatment) → ✅ CLOSELY RELATED → INCLUDE follow-up
950
+
Answer:
951
+
According to symptom_guide:
952
+
• Yellowing of skin and eyes (sclera) is the primary visible symptom
953
+
• Dark urine indicates bile pigment changes
954
+
• Pale stools may occur in some cases
955
+
956
+
Would you like to know about treatment of jaundice?
- If you cannot reason a confident answer → Respond with: "I couldn't find sufficient information in the provided documents to answer this question accurately."
1222
1276
- NEVER use external knowledge - only reason within provided chunks
1223
1277
1224
-
REMINDER: If <followup_context> is provided, you MUST generate a follow-up question. Do not skip this step.
1278
+
REMINDER: If <followup_context> is provided, evaluate if the follow-up topic is closely related to your answer topic. Only include a follow-up question if there is very close resemblance (same medical condition/topic, different aspect). If the follow-up context discusses a different medical topic entirely, DO NOT include a follow-up question.
0 commit comments