← Back to Workshop Hub CAPSTONE · PROMPT ENGINEERING

Prompt Engineering for AgentSea

From vague requests to production-ready prompts. Master the 4 pillars, chain-of-thought, personas, structure, and grounding — with a hands-on builder you can play with.

📖 ~15 min 🎮 Interactive Builder 🏥 Healthcare Context ⭐ Capstone Module

🎯 The 4 Pillars of Effective Prompts

Every great prompt for AgentSea stands on four foundations. Click any pillar in the diagram to learn more — or scroll down for the full breakdown.

PRODUCTION-READY PROMPT 🎯 CLARITY 📚 CONTEXT 👤 ROLE 📐 FORMAT
🎯
Pillar 1 · Clarity
Tell the agent exactly what to do. Replace vague verbs ("look at", "check") with precise actions ("assess SLA compliance", "calculate budget variance"). Specific verbs produce specific outputs.

📚 The 4 Types of Context

Pillar 2 deserves more attention. Context isn't just "data" — it has 4 distinct flavours. Mix them depending on the task:

🏛️

Domain

Industry knowledge: MOH IP&C standards, PDPA rules, vendor SLA policy, hospital procurement framework.

📊

Data

Specific numbers and facts for this task: vendor SLA 94% vs 97% target, contract value SGD 1.2M.

⏱️

Situational

Current circumstances and urgency: contract renewal in 30 days, 3 critical maintenance items overdue.

🚧

Constraints

Rules the output must follow: amounts in SGD, cite policy sections, no clinical advice.

Before & After — All 4 Pillars Working Together

Same task. Same agent. The "After" prompt uses all 4 pillars in one shot:

❌ BEFORE
Review this vendor and tell me what you think.
✅ AFTER
You are a Senior Procurement Analyst at Synapxe Healthcare with 10 years of vendor management experience.

Assess MedTech Services Pte Ltd:
- Contract: SGD 1.2M/year
- SLA: 94% (target 97%)
- Critical items overdue: 3
- Renewal in: 30 days

Provide:
1. RATING: 🟢 GREEN / 🟡 AMBER / 🔴 RED
2. Performance summary (table)
3. Top 3 risks (ranked by patient safety)
4. Action items (table with owners + deadlines)

ONLY use data above. All amounts in SGD.
Reference the Vendor SLA Policy.
💡
Spot the 4 pillars: The "Senior Procurement Analyst" line is Role. The bullet list of vendor data is Context. The numbered "Provide" section is Format. The whole thing has a Clear verb structure ("Assess", "Provide", "Reference"). All four working together.

🧠 Make the AI Show Its Work

By default, an LLM jumps straight to an answer. For complex healthcare decisions (budget approvals, vendor risk, compliance gaps), that\'s a recipe for missed steps. Chain-of-Thought (CoT) forces the agent to reason step-by-step before answering. The output is more accurate, more auditable, and more consistent.

💭

Zero-Shot CoT

Add "Think step by step" or "Reason systematically." No examples needed.

📝

Few-Shot CoT

Show 1–2 worked examples of the reasoning pattern. Agent mirrors it.

🔭

Step-Back

"What general principle applies?" then "Apply to this specific case."

🔄

Self-Consistency

Reason from multiple angles, check if conclusions align.

🎬 CoT in Action — Budget Approval

Watch a real reasoning chain unfold for a SGD 85K equipment request. Click auto-play, or click any step to jump to it.

📄 The question
"Should we approve this SGD 85,000 patient monitor request from Cardiology? Annual budget SGD 2.4M. Spent YTD SGD 1.8M. Committed SGD 420K."
1
Calculate available budget. Annual SGD 2.4M − Spent SGD 1.8M − Committed SGD 420K = SGD 180K available. Math first; everything else depends on this.
2
Check budget fit. Request SGD 85K vs available SGD 180K → fits with SGD 95K buffer remaining for the rest of FY. Tight but acceptable.
3
Determine approval authority. Per Synapxe Procurement Policy §3.4: HOD up to SGD 50K, CFO up to SGD 100K, Board above. SGD 85K → requires CFO sign-off.
4
Assess clinical justification. 7-year-old equipment (policy: 5-year cycle), 3 failures in one quarter, patient monitoring in Cardiology. Strong justification.
5
Identify conditions and risks. Need: 3-quote process, TCO analysis, asset disposal plan. Risk: post-approval buffer leaves limited room for additional requests this FY.
6
Final recommendation:APPROVE with conditions. Route via HOD endorsement → Finance review → CFO approval. Expected timeline: 1 week to approval, deployment by late January.
💡
Without CoT: the model might say "Yes, approve" without checking if SGD 85K actually fits, who needs to sign off, or what conditions apply. With CoT: every step is explicit and auditable — exactly what you need for finance and compliance work.

🪞 Self-Consistency — Multiple Lenses

For high-stakes decisions, ask the agent to reason from multiple perspectives independently and compare conclusions. Disagreements reveal uncertainty.

LensQuestion AskedConclusionRating
💰 CostSGD 1.2M/year for 94% SLA — overpaying?~SGD 36K effective overpayment🟡 AMBER
🏥 Quality3 critical items overdue — patient safety?Unacceptable risk in critical care areas🔴 RED
⏱️ Timing30-day renewal — alternatives feasible?Limited time; negotiate with leverage🟡 AMBER
🔍
Consensus check: 2 lenses say AMBER, 1 says RED. The quality/safety dimension dominates. Final recommendation: AMBER, with escalation to RED if critical items aren\'t resolved within 7 days. The disagreement itself is signal — it tells you patient safety needs to lead this decision.

👤 The Persona Formula

The same vendor data interpreted by a Compliance Officer reads very differently than the same data interpreted by an Operations Manager. Roles unlock domain vocabulary, priorities, and judgement. The formula has 5 ingredients:

🎓 TITLE "Senior Analyst" + 📅 EXPERIENCE "10+ yrs SG healthcare" + 🎯 SPECIALTY "medical equipment" + ⚖️ TRAIT "thorough, evidence-based" = 🤖 PERSONA
📝 Example — full persona prompt
"You are a Senior Procurement Analyst at Synapxe Healthcare with 10 years of experience in Singapore public healthcare vendor management. You specialise in medical equipment maintenance contracts. You are known for thorough, evidence-based assessments that balance cost efficiency with patient safety. You always cite specific data points and flag risks early."

🎭 Same Data, Different Eyes

One vendor performance dataset → 3 personas → 3 useful but very different lenses. Click any card to focus.

📊 Shared input data: MedTech Services · SGD 1.2M contract · 94% SLA (target 97%) · 3 critical maintenance items overdue · contract renewal in 30 days
👮
Compliance Officer
LEGAL
3% SLA shortfall = material breach per Clause 7.2. The 3 overdue critical items represent potential violation of MOH equipment maintenance duty-of-care. Recommends issuing formal Notice of Non-Compliance, written remediation plan in 14 days, Legal engagement on contract enforcement.
🔴 ENFORCE
⚙️
Operations Manager
ACTION
Primary worry: which 3 critical items and which wards? If ICU/OT, need backup arrangements now. 94% SLA = ~22 missed responses per year. Convene vendor performance meeting, get 48-hour commitment on critical items, start parallel evaluation of backup vendors.
🟢 EXECUTE
💰
Finance Manager
FISCAL
SGD 1.2M for 94% performance = effective overpayment of ~SGD 36K. Material breach gives leverage for penalty clauses (§9.1) or termination (§12.3). Renewal negotiation must include enhanced SLA terms with penalty schedule. Build cost-of-switching analysis for backup vendors.
🟡 NEGOTIATE
🩺
Clinical Engineer
SAFETY
Three overdue items in critical care areas = potential patient safety incident waiting to happen. Ventilator (Ward 5B) and ICU monitor calibration are life-critical. Recommends emergency escalation: 48-hour resolution, MOH proactive disclosure, contingency for emergency loaner equipment.
🔴 PATIENT SAFETY
🔍
Multi-persona framing in AgentSea: When a decision touches several stakeholder groups, run the same data through different persona prompts. You\'ll get a 360° picture you can present to leadership — and gaps between lenses tell you where the real tension lies.

📐 Structure Turns Drafts into Deliverables

An unstructured paragraph is hard to scan, hard to action, and hard to defend. A structured response with tables, ratings, and explicit owners is something you can put straight into an email or an executive summary.

❌ UNSTRUCTURED (drafty)
The vendor seems to be underperforming. Their SLA is below target and there are some overdue items. We should probably talk to them about it and maybe consider other options. The contract is coming up for renewal soon.
✅ STRUCTURED (actionable)
## RATING: 🟡 AMBER

| Metric | Actual | Target | Gap |
|--------|--------|--------|-----|
| SLA | 94% | 97% | -3% |
| Critical Overdue | 3 | 0 | +3 |

### Top 3 Risks
1. Patient safety — Ward 5B ventilator
2. Contract leverage — 30 days to renewal
3. Regulatory — potential MOH trigger

### Action Items
| Action | Owner | Deadline |
|--------|-------|----------|
| Issue performance notice | Procurement | This week |
| Escalate critical items | Operations | 48 hrs |

🛠️ 4 Output Format Patterns

Different decisions need different shapes. Pick the right one for the task:

🚦

Rating System

"Rate GREEN / AMBER / RED with one-line justification" — for assessments & approvals.

📊

Table

"Present as a table with columns X, Y, Z" — for comparisons, metrics, action items.

📋

Ranked List

"List the top 5 risks in priority order" — for recommendations & prioritisation.

Decision Format

"State APPROVE / DEFER / REJECT, then explain" — for budget & policy calls.

🔗 Grounding — The 4 Rules

Structure makes output readable. Grounding makes it trustworthy. These 4 rules shut down hallucination and make answers defensible.

1️⃣

Use Only Provided Data

"ONLY use the data in this prompt. Do NOT use general knowledge or prior assumptions."

2️⃣

Cite Sources

"Reference specific policy clauses, document sections, or data points for every claim."

3️⃣

Flag Uncertainty

"If data is insufficient, explicitly state what additional information is needed."

4️⃣

Constrain the Domain

"All amounts in SGD. Singapore healthcare context only. Reference Synapxe policies."

📜 Grounded vs Ungrounded — Leave Carryover Q&A

❌ UNGROUNDED (hallucinates)
Q: Can I carry over my unused leave?

A: Yes, most companies allow you to carry over unused annual leave to the next year. Typically you can carry over up to 5–10 days. Check with your HR department for the specific policy.
✅ GROUNDED (citable)
Q: Can I carry over my unused leave?

A: Per Synapxe Healthcare Leave Policy §4.3:

- Annual Leave: up to 5 days carryover
- Deadline: must be used by 31 March
- >5 days carryover requires HOD approval (Form HR-12)
- Medical Leave: cannot be carried over (§4.5)

⚠️ Applies to permanent staff. Contract staff: see §6.2.

📎 Source: Synapxe Staff Handbook v3.1, Ch 4
💡
The trick that makes RAG work in AgentSea: upload the actual policy doc + system prompt rule "Answer ONLY based on the uploaded document. Cite section numbers. If the answer isn\'t in the document, say so." That\'s the entire grounding contract — and it\'s the difference between a chatbot toy and a defensible workplace tool.

🔧 Interactive Prompt Builder

Toggle techniques on and off and watch the response transform. Each technique adds a "bit" — combine them to climb from Generic all the way to Production-Ready.

📝 YOUR PROMPT
Loading…
🤖 AI RESPONSE
Loading…
Quality: Level 0 — Generic
Completeness
Data Grounding
Actionability
Consistency
💡
How scoring works: Role = 1 bit, Context = 2 bits, Structure = 4 bits, Grounding = 8 bits, CoT = 16 bits. The 5-bit total maps to 6 response qualities (0 → 31). Try toggling Role + Context first — that alone unlocks Level 3. Add Structure + Grounding for Level 15. All five gives you Level 31 production-ready.

🎓 The 3-Round Improvement Workflow

You won\'t nail the perfect prompt on the first try. Treat it as iterative drafting:

1️⃣

Draft

Write the initial prompt with role + context + task. Run it. Ask: "What\'s missing? What\'s wrong?"

2️⃣

Refine

Add structure (format) and grounding (data constraints). Fix the hallucinations from Round 1.

3️⃣

Harden

Add negative constraints, edge cases, and CoT reasoning. Save as a reusable system prompt template.

⚠️ 7 Common Mistakes — & Their Fixes

The same 7 mistakes show up over and over. Click any card to flip it and see how to fix it.

MISTAKE #1
Vague Instructions
"Look at this vendor proposal."
▼ Click for fix
Fix: "Assess SLA compliance against our 97% target. Recommend a GREEN / AMBER / RED rating with one-line justification, then list the top 3 risks."
MISTAKE #2
No Context Provided
"Is this budget request okay?"
▼ Click for fix
Fix: Include amount, total budget, YTD spend, committed funds, and the policy approval thresholds. The agent cannot guess these.
MISTAKE #3
Assuming AI Remembers
"Use the same format as last week."
▼ Click for fix
Fix: Each AgentSea session is fresh. Always re-specify the format. Better still: bake it into your system prompt so it persists across every session.
MISTAKE #4
No Output Format
"Summarise this meeting."
▼ Click for fix
Fix: "Summarise as: Decisions (table), Action Items (with owners + deadlines), Next Steps (numbered list)."
MISTAKE #5
Trusting Without Grounding
"What\'s our leave policy?"
▼ Click for fix
Fix: Upload the policy doc. Add: "Answer ONLY from this document. Cite section numbers. If the answer isn\'t in the document, say so."
MISTAKE #6
One Mega-Prompt
500-word prompt that covers 10 different tasks at once.
▼ Click for fix
Fix: Break it into focused prompts. One task per interaction. The agent does each part better, and you can review along the way.
MISTAKE #7
No Negative Constraints
"Help me with this patient query."
▼ Click for fix
Fix: Add explicit "Do NOT" rules — "Do NOT provide medical advice. Do NOT include patient PII. Do NOT make final approval decisions."

🛡️ Healthcare-Specific "Do NOT" Constraints

For Synapxe agents, these 5 negative constraints protect the organisation. Bake them into your system prompt for every healthcare admin agent:

CategoryThe "Do NOT" ruleWhy it matters
🩺 ClinicalDo NOT provide medical advice or diagnosesAI is not a licensed practitioner. Liability + safety risk.
🔒 PrivacyDo NOT include patient names, NRIC, or identifiers in outputsPDPA compliance — personal data protection.
📊 DataDo NOT fabricate statistics or policy referencesHallucinated data → wrong decisions.
✋ ScopeDo NOT make final approval decisions — recommend onlyHuman-in-the-loop for all consequential decisions.
📋 AuthorityDo NOT override established policies or proceduresAI assists within existing governance frameworks.

🎯 You\'re Ready for the Capstone

You\'ve covered all 6 explainers. The Agent Design Canvas is where it all comes together — pick a workflow from your team, design the agent, write the system prompt, submit for AI scoring on the leaderboard.

🤖 Start Agent Design Canvas →