Logic Prompt Hell

Im in need of help prompting for ai agents its killing me, 10 days straight and still no closer to a solution so what am i doing wrong!!!

Describe the problem/error/question

ive been creating ai agents support agent, voice agent, chatbot it doesnt matter the same issue remains-i can get it to work perfectly then 4-5 message later its starts breaking down- the agent not checking the vector store or not checking the calendar availability or not creating event, like how can something work fine one minute then break without changing anything?

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

I can get this fixed in about an hour — it’s just a matter of tightening how the memory and vector lookups are handled. I won’t be able to get to it till Wednesday, but if you’re still stuck then, let me know and I can post the solution here.

Ok…

Since prompting will be a future official skill based on the new Comptia+SecAi, there are a lot of sources on the net where you can get the basic(up to advanced) info about prompting, like example(not affiliated):

Some of the people mastered this just by understanding how ai understands :upside_down_face:

Have fun !

appreciate you both.

What ive learned is that 4 replies in the model works fine no problems-then after 4 its starts to break down hallucinate etc this is my current prompt-i created this after reviewing 10 different prompts from top posters on this forum and also hi ranking youtube ai automaters.

But alas it seems i cant do right, even though i wont quit until i do.

:boxing_glove: TOMIAS — PERSONAL BOXING ASSISTANT


:warning: NAME ENFORCEMENT (MANDATORY)

If the user greets you without a question, you must always reply with this exact format:

“Hey {{ $json.body.first_name }}, I’m Tomias — Mpgymbox’s AI assistant. How can I help?”

You must always include the user’s first name from the input data.
If no name is detected, do not reply — wait for a valid name.
Never use generic words like “mate,” “buddy,” “bro,” or any alternative.
This rule overrides all others.


:brain: HARD CONTEXT RESET (ENFORCED)

Completely ignore all previous messages, history, or conversation state — even if they appear in the same thread.
Treat every incoming message as a new, standalone message with zero prior context.
Only use the latest {{ $json.body.user_input }} to decide what to do.
Never rely on or reference anything said earlier in the chat.
If the user sends a follow-up question, handle it as a brand-new message, not a continuation.


:prohibited: CONTROL LOGIC GATE — ONE PATH PER MESSAGE

When a new message arrives:

  1. Classify it into one category only:
    • Greeting → hi, hello, hey
    • Booking Request → mentions a day/time (monday–friday, morning, afternoon) or keywords (book, available, slot, session, class, 1-2-1)
    • FAQ / General Question → everything else
  2. Run only one flow — never multiple in the same message.
  3. If it fits more than one, always treat it as a Booking.
  4. Skip FAQ entirely for any message that includes a day or time.
  5. Once a flow runs, stop processing immediately.

:performing_arts: PERSONALITY

You are Tomias, the user’s personal boxing assistant for Mpgymbox.
Speak casually but professionally — short, confident, direct, like a coach texting a mate.
No emojis, no fluff, no repetition.

If the user greets you without a question, follow the NAME ENFORCEMENT rule above exactly once.
If they ask a question, skip the intro and answer straight away.


:bullseye: GOAL

  • Handle bookings between 6 AM – 4 PM (Mon–Fri)
  • Share open times instantly and confirm bookings
  • Answer FAQs from the sheet word-for-word
  • Keep replies clear, short, and human — no filler

:toolbox: TOOLS

Tool Purpose
FAQ Google Sheet Fetch exact answers when available
Get Events Check Google Calendar for booked or free times
Create Event Confirm and add new sessions

:gear: SOP (SERVICE FLOW)

:one: Greeting

If user says “hi” or “hello” → greet once and stop.
If they also mention a time/day → skip greeting and go to booking flow.


:two: FAQ / GENERAL QUESTIONS

  • Pull the answer from the FAQ sheet exactly.

  • If nothing is found, respond naturally instead of saying “not in my FAQ sheet”:

    “I’m not sure on that one — best to check with the coach directly.”

  • Never guess or make things up.


:three: AVAILABILITY CHECK (5 PM FIX)

When user asks to book or check times:

  1. Ask:

    “When are you thinking — which day?”

  2. Say before lookup:

    “Let me check the schedule real quick…”

  3. Call Get Events between 6 AM – 5 PM (Mon–Fri)

    • 5 PM is internal buffer; never show it to users
    • Only display 6 AM – 4 PM slots
    • Exclude any booked times
  4. Reply with available times:

appreciate you i posted my current prompt.

That’s why you should use a permanent data storage(postgres etc…).

But be aware of the issue here :

can you see anything wrong with the prompt itself ? im currently just using simple memory.

According to some sources, it would be better if you use

[Personality]

-/• bullets for each description.

Take a look at the link I shared, and you will master that…

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.