Hey,
I created a conversational AI Agent (for a game) that creates a json output. It works well 80% of the time but sometimes, it answers with an empty output.
And I don’t really understand why. Is the problem coming from the system prompt or somewhere else ?
Information on your n8n setup
- n8n version: : 1.97.1
- **Running n8n via Docker, self hosted
when there is no output , go to the execution and see what was the input to the AI Agent. try to replicate or put an exception handler AI agent ( if there is empty output then 2nd AI agent will do something)
Thx a lot for your answer.
To give you some context, our AI agent is a character in a game. He receives a message from a player and has to answer. But sometime it does not.
I would like to understand the relation between the Agent and the Model.
Because in an example where the agent created an empty output, the model created an answer:
Model :
Agent :
Workflow:
And in an example where the flow works fine, i can’t see the message in the model node:
This is the only strange thing that I’ve noticed ..
Any help ?
Thx a lot !
I am sorry but I still dont see the input message that was received by your chat agent for when it works and when it doesnt
I’m not sure it can be of any help.
This is the prompt user :
For when it does not work :
Incoming_message : t’en penses quoi de richard samoradi toi ?
Canal : Whatsapp
phone_number : 33777768945
Influence :
For when it works:
Incoming_message : j’ai découvert le manifeste de bam giraph
Canal : Whatsapp
phone_number : 33777768945
Influence :
Maybe it’s because the NPC does not know what to answer, and does not want to invent. But in many other questions, he still invents.
And the strange thing for me is that, in the model output, you can see the answer (and not the agent output) :
Thanks for your time and help
[quote=“foolitud, post:5, topic:133369”]
This is the prompt user :
For when it does not work :
Incoming_message : t’en penses quoi de richard samoradi toi ?
Canal : Whatsapp
phone_number : 33777768945
Influence :
For when it works:
Incoming_message : j’ai découvert le manifeste de bam giraph
Canal : Whatsapp
phone_number : 33777768945
Influence :
[/quote]few suggestions
-
try normalizing the user query input before sending it to the AI agent.
-
Try a different LLM
-
Enabled detailed logging on the AI Agent - enable debug logging (Logging | n8n Docs)
-
Try retries - as it works sometimes and doesnt work sometime