Gioi thieu MOM's Bridge

Prompt Improvement Log

AI / GenAI Documentation

Before/after prompt pairs showing iterative improvement of AI prompts.

Iteration 1: Unstructured to Structured Output
PromptProblem/Improvement
BeforeYou are a pregnancy assistant. Help the user with their symptom.Returned long, unparseable text responses
AfterRespond in JSON only: { "empathetic_response": "...", "doctor_summary": "..." }Structured, parseable output every time
Iteration 2: Response Length Control
PromptProblem/Improvement
BeforeProvide a supportive response and doctor summaryResponses were 200-500 words, too long for mobile display
AfterBrief supportive message (max 50 words), comfort measures (max 20 words)Concise responses suitable for mobile UI
Iteration 3: Pregnancy Context Injection
PromptProblem/Improvement
BeforeTranslate this message to Korean: {message}Generic translation without medical context
AfterTranslate pregnancy-related message to Korean. Context: week {week}. Message: {message}Medically aware translation with trimester context
Iteration 4: Safety Truncation

Added server-side safety: empathetic responses capped at 300 characters, comfort measures at 120 characters. Input text truncated to 100 characters for translation calls. This prevents prompt injection via long inputs and ensures consistent UI rendering.