Skip to main content

Prompt Engineering Masterclass

Your prompt is the single most important factor in how well your AI agent performs. A great prompt turns a mediocre agent into an exceptional one. A bad prompt makes even the most powerful AI model useless.

This guide teaches you everything you need to know about writing prompts for CiniterFlow, from the fundamentals to advanced techniques used by professionals.

Why Prompts Matter So Much​

Think of a prompt as a job description for your AI agent. If you hire someone and say "help customers," they'll have no idea what to do. But if you say "You're a support agent for a bakery. Greet customers warmly, answer questions about our menu, and help them place orders. Never discuss competitor products" β€” now they know exactly what's expected.

The same applies to AI. The more specific and structured your prompt, the better the results.

The 5-Step Prompt Framework​

Every great prompt follows this structure. You don't always need all five steps, but the more you include, the better your agent will perform.

Step 1: Role & Identity​

Tell the AI who it is. This sets the tone, expertise level, and personality.

❌ Weak:

You are a helpful assistant.

βœ… Strong:

You are Maya, a senior financial advisor at WealthWise Partners with 15 years of experience helping individuals plan for retirement. You are patient, thorough, and always explain complex financial concepts in simple terms.

Why it works: The AI now has a name, a role, a company, expertise, and a personality. It will naturally respond differently than a generic "helpful assistant."

Step 2: Task & Guidelines​

Explain exactly what the agent should do and how it should do it.

❌ Weak:

Help users with their questions.

βœ… Strong:

Your responsibilities:
1. Answer questions about retirement planning, investment strategies, and tax-advantaged accounts
2. Ask clarifying questions before giving advice (e.g., age, risk tolerance, current savings)
3. Always present multiple options with pros and cons
4. Use simple language β€” avoid jargon unless the user demonstrates financial literacy
5. When calculations are needed, use the calculator tool
6. For questions outside your expertise (legal, tax filing), recommend consulting a specialist

Response format:
- Keep responses under 200 words unless the user asks for detail
- Use bullet points for lists of options
- Bold key numbers and percentages

Step 3: Context & Knowledge​

Give the AI the background information it needs.

About WealthWise Partners:
- Independent financial advisory firm founded in 2008
- Fee-only model (no commissions)
- Specializes in retirement planning for ages 40-65
- Minimum portfolio size: $100,000
- Office hours: Monday-Friday, 8 AM - 5 PM EST
- Scheduling link: https://wealthwise.com/book

Current market context:
- Federal funds rate: 5.25-5.50%
- S&P 500 YTD return: approximately 15%
- High-yield savings accounts offering 4.5-5.0% APY
Use the Current Date Variable

Always include Today's date and time is {{ current_date_time }} in prompts where time matters. Without it, the AI doesn't know what "today" or "this week" means.

Step 4: Examples (Few-Shot Prompting)​

Show the AI exactly how you want it to respond. This is the most powerful technique for controlling output quality.

Here are examples of ideal interactions:

<example>
User: I'm 45 and want to retire at 60. I have $200K saved. Am I on track?
Maya: Great question! Let me help you assess where you stand.

At 45 with $200K saved and a goal of retiring at 60, here are the key factors:

- **Time horizon**: 15 years of saving remaining
- **Current savings**: $200,000

To give you a meaningful assessment, I need a few more details:
1. What's your **target annual retirement income**?
2. How much are you **currently contributing** per month?
3. What's your **risk tolerance** β€” conservative, moderate, or aggressive?

As a rough benchmark, most advisors suggest having 10-12x your desired annual income saved by retirement. So if you want $60K/year in retirement, you'd aim for $600K-$720K.

Would you like to walk through the numbers together?
</example>

<example>
User: Should I invest in crypto?
Maya: Cryptocurrency is an interesting topic! Here's my balanced perspective:

**Potential benefits:**
- High growth potential
- Portfolio diversification

**Key risks:**
- Extreme volatility (50%+ swings are common)
- No underlying cash flow or dividends
- Regulatory uncertainty

**My recommendation:** If you're interested in crypto, consider limiting it to **5% or less** of your total portfolio. Make sure your core retirement savings (401k, IRA) are fully funded first.

Would you like to discuss how crypto might fit into your overall investment strategy?
</example>

Why examples are so powerful: Instead of describing the format, tone, and depth you want, you simply show it. The AI pattern-matches to your examples far more reliably than following abstract instructions.

Step 5: Guardrails & Boundaries​

Tell the AI what it should NOT do. This prevents hallucinations, off-topic responses, and liability issues.

Important guardrails:
1. NEVER provide specific stock picks or guarantee returns
2. NEVER discuss other financial advisory firms or compare services
3. If asked about tax filing, legal matters, or insurance, say: "That's outside my area of expertise. I'd recommend consulting a [tax professional/attorney/insurance specialist]."
4. Do not make up statistics or market data β€” if you're unsure, say so
5. If a user seems to be in financial distress, provide the NFCC helpline: 1-800-388-2227
6. Always include a disclaimer when giving investment-related advice: "This is general guidance, not personalized financial advice. Please consult with your advisor for recommendations specific to your situation."
7. Never ask for or acknowledge sensitive information like Social Security numbers, account passwords, or full account numbers

The "Generate" Button β€” Your Secret Weapon​

CiniterFlow has a built-in prompt generator that writes professional system prompts for you. Here's how to use it effectively:

  1. In any Agent or LLM node, find the System Message field
  2. Click the "Generate" button
  3. Describe what you want in plain English, for example:
    • "A customer support agent for an online pet store that sells food, toys, and accessories"
    • "A technical support bot for a SaaS project management tool"
    • "A real estate assistant that helps buyers find properties in Miami"
  4. The AI generates a complete prompt following best practices
  5. Review and customize β€” the generated prompt is a great starting point, but always tailor it to your specific needs
Generate for Knowledge Descriptions Too

The "Generate" button also works for Knowledge descriptions in Agent nodes. Click it to auto-generate a description of what your Document Store contains. This helps the AI know when to search your knowledge base.

CiniterFlow-Specific Variables​

CiniterFlow gives you special variables you can use inside any prompt. Type {{ in any text field to see the full list.

Universal Variables​

VariableWhat It ContainsExample Use
{{ question }}The user's current message"The user asked: {{ question }}"
{{ current_date_time }}Current date and time"Today is {{ current_date_time }}"

Flow State Variables​

VariableWhat It ContainsExample Use
{{ $flow.state.keyName }}A shared state value"Customer name: {{ $flow.state.customerName }}"

Form Variables​

VariableWhat It ContainsExample Use
{{ $form.fieldName }}A form input value"Subject: {{ $form.subject }}"

Custom Variables​

VariableWhat It ContainsExample Use
{{ $vars.variableName }}A reusable variable"Company: {{ $vars.companyName }}"

Node Output Variables​

VariableWhat It ContainsExample Use
{{ llmAgentflow_0 }}Output from an LLM node"Previous analysis: {{ llmAgentflow_0 }}"
{{ agentAgentflow_0 }}Output from an Agent node"Agent response: {{ agentAgentflow_0 }}"
{{ retrieverAgentflow_0 }}Retrieved documents"Context: {{ retrieverAgentflow_0 }}"
{{ customFunctionAgentflow_0 }}Custom function output"Data: {{ customFunctionAgentflow_0 }}"
{{ $iteration.fieldName }}Current iteration item"Task: {{ $iteration.task }}"

Practical Example: Using Variables in a Prompt​

You are a customer support agent for {{ $vars.companyName }}.

Today's date is {{ current_date_time }}.

The customer submitted the following inquiry:
- Subject: {{ $form.subject }}
- Message: {{ $form.body }}
- Email: {{ $form.from }}

Previous research about this customer:
{{ agentAgentflow_0 }}

Please draft a professional reply addressing their concerns.

Advanced Techniques​

Chain-of-Thought Prompting​

Ask the AI to think step by step before answering. This dramatically improves accuracy for complex tasks.

When answering complex questions, follow this process:
1. First, identify what the user is actually asking
2. List the relevant facts and context
3. Consider multiple possible answers
4. Choose the best answer and explain your reasoning
5. Provide your final response

Think through each step carefully before responding.

Role Prompting for Different Models​

Different AI models respond better to different prompt styles:

OpenAI (GPT-4o, GPT-4o-mini):

  • Works well with detailed system messages
  • Follows structured formats reliably
  • Good at following numbered instructions

Anthropic (Claude):

  • Performs best when task-specific instructions are in the User message rather than System message
  • Excellent with XML-tagged examples (<example>...</example>)
  • Responds well to "role prompting" β€” giving it a specific persona

Google (Gemini):

  • Handles very long contexts well (1M+ tokens)
  • Good at synthesizing information from multiple sources
  • Works well with straightforward, direct instructions

Structured Output Prompting​

When you need the AI to return data in a specific format, use the JSON Structured Output feature in LLM nodes instead of asking for JSON in the prompt. This guarantees the format.

But when you need structured text (not JSON), guide the format in your prompt:

Format your response as follows:

## Summary
[2-3 sentence overview]

## Key Findings
- [Finding 1]
- [Finding 2]
- [Finding 3]

## Recommendation
[Your recommended action]

## Next Steps
1. [Step 1]
2. [Step 2]

Negative Prompting (What NOT to Do)​

Sometimes telling the AI what to avoid is more effective than telling it what to do:

Do NOT:
- Start responses with "Great question!" or "That's a great question!"
- Use filler phrases like "Certainly!", "Of course!", "Absolutely!"
- Repeat the user's question back to them
- Use overly formal language or corporate jargon
- Provide information you're not confident about β€” say "I'm not sure" instead

Dynamic Prompting with Variables​

Use CiniterFlow variables to make prompts adapt to context:

You are a support agent for {{ $vars.companyName }}.

{% if $vars.tier == "enterprise" %}
This is an enterprise customer. Prioritize their request and offer premium support options including dedicated account manager escalation.
{% else %}
This is a standard customer. Follow normal support procedures.
{% endif %}

Today is {{ current_date_time }}.

Prompt Templates Library​

Here are ready-to-use templates for common scenarios. Copy, paste, and customize.

Customer Support Agent​

You are [Name], a friendly customer support agent for [Company Name].

## Role
Help customers with inquiries about [products/services], resolve issues, and ensure satisfaction.

## About [Company Name]
[2-3 sentences about the company, what it does, key offerings]

## Business Details
- Hours: [hours]
- Contact: [email/phone]
- Website: [url]

## Guidelines
1. Always introduce yourself by name
2. Ask clarifying questions before assuming the issue
3. Provide step-by-step solutions when applicable
4. If you can't resolve an issue, offer to escalate
5. End every interaction by asking if there's anything else

## Guardrails
- Never share internal processes or pricing formulas
- Don't make promises about refunds without checking policy
- For legal or compliance questions, direct to [appropriate team]

Today's date: {{ current_date_time }}

Knowledge Base Q&A Agent​

You are a knowledgeable assistant that answers questions using ONLY the provided knowledge base.

## Rules
1. Answer based exclusively on the knowledge base content
2. If the answer isn't in the knowledge base, say: "I don't have that information in my knowledge base. [Suggest alternative resource]"
3. Cite the source section when possible
4. Keep answers concise but complete
5. If a question is ambiguous, ask for clarification

## Response Format
- Lead with the direct answer
- Follow with supporting details if needed
- Include the source reference at the end

Data Analysis Agent​

You are a data analyst assistant. When given data or asked to analyze information:

1. First, summarize what data you're working with
2. Identify key patterns, trends, or anomalies
3. Provide specific numbers and percentages
4. Offer actionable insights
5. Suggest follow-up analyses if relevant

Always use the calculator tool for mathematical operations β€” never do mental math.

Format findings with clear headers, bullet points, and bold key metrics.

Today's date: {{ current_date_time }}

Content Writer Agent​

You are a professional content writer specializing in [industry/topic].

## Writing Style
- Tone: [professional/casual/conversational/authoritative]
- Reading level: [general audience/technical/executive]
- Voice: [first person/third person]

## Guidelines
1. Start with a compelling hook
2. Use short paragraphs (2-3 sentences max)
3. Include relevant examples and data points
4. End with a clear call-to-action or takeaway
5. Optimize for readability β€” use headers, bullets, and bold text

## Do NOT
- Use clichΓ©s ("In today's fast-paced world...")
- Write generic filler content
- Make claims without supporting evidence
- Use passive voice excessively

Router / Triage Agent (for Condition Agent nodes)​

You are a message classifier. Analyze the user's message and determine which category it belongs to.

Consider:
- The primary intent of the message
- Key words and phrases
- The urgency level
- Whether it requires specialized knowledge

Classify accurately β€” routing to the wrong agent wastes the customer's time.

Common Mistakes and How to Fix Them​

MistakeProblemFix
Prompt is too vagueAI gives generic, unhelpful responsesAdd specific role, context, and examples
No examples providedAI guesses at the format and tone you wantAdd 2-3 examples of ideal responses
No guardrailsAI goes off-topic or makes things upAdd explicit "Do NOT" rules
Too many instructionsAI gets confused and misses key rulesPrioritize the top 5-7 most important rules
No current timeAI can't handle "today," "this week," etc.Add {{ current_date_time }}
Asking for JSON in textAI sometimes wraps JSON in markdown code blocksUse the JSON Structured Output feature instead
Same prompt for all modelsSuboptimal performanceTailor prompts to each model's strengths

Testing and Iterating​

  1. Start with the 5-step framework β€” write your first draft
  2. Test with 10 diverse questions β€” include easy, hard, edge cases, and off-topic
  3. Identify failures β€” where did the AI give a bad answer?
  4. Fix one thing at a time β€” add a guardrail, an example, or a clarification
  5. Re-test β€” make sure the fix works without breaking other responses
  6. Repeat β€” prompt engineering is iterative, not one-and-done
Use Evaluations

CiniterFlow's Evaluations feature lets you automate this process. Create a dataset of test questions with expected answers, then run evaluations to measure how well your prompt performs. Re-run after each change to track improvement.