Agent doing incorrect mathematical calculation

Hello,

I am working on a agentic solution for laon processing that is approve, reject or manual review. Criteria for the decision I am giving in the context document.

When I’m writing prompt to make decision to approve, reject, or manual review, it is working fine.

But when I’m adding additional steps to use tools such as escalation for manual review, submit for application etc. then agent is not returning correct decision.

It is not processing comparison operations correct such greater than, less than etc.

I have tried updating context documents, providing step by step explanation for calculation as well as examples, even tried rewiring the prompt but nothing seems working for me.

I have attached a snapshot of my prompt.

Try by separating both the work like create one agent for just decision making and 2nd agent for tools escalation to execute based on descision and execute them in Maestro

Cheers

@Rohit_More,

Agent is using an LLM which is prediction model means it will predict the output and won’t really calculate.

Better approach here would be

  1. Extract the input values from unstructured input
  2. Develop a quick RPA workflow to do the calculation and use it as a tool in your agent.

Cheers!

@Rohit_More

You should specifically mention in the prompt to use the formulae in context and what piece is important as well..then it would consider

Also based on the format of context generaly for your case doc file works better

Cheers

Hi @Anil_G, @Anil_G, @ashokkarale

Thanks you for the response.

Agent is considering all the criterias given in context but only the comparison operation is incorrect, please see the attached screenshot of agent output.

@Rohit_More

this feels like a miss in your prompt itself

as its consider for manual review but some rule you mentioned is overwriting to process it

Please work on the prompt

cheers

Hi @Anil_G

There is no criteria given in the prompt.

When there is prompt only to determine the decision, it work perfect.

But as soon as I add steps to follow for each decision such as using tools like send email, submit loan application or escalation for manual review, it given incorrect decision.

@Rohit_More

as per screenshot of your prompt…when processing loan and if decision manual etc are criteria only…if there are contradicting criteria then it might give a wrong decision

cheers

@Anil_G

Thanks for pointing out.

Please let me know if there any better way to instruct agent on when to use the tools and how to process results from any tool.

Appreciate your support.

@Rohit_More

would suggest go through better prompting course on academy

apart from that ehile giving instructions avoid contradictory details..try refining prompt using auto pilot, giving examples also would help

cheers

I have gone through the documentation, created the prompt again with the help of autopilot but still the issue persists. If one criteria works other does not work correctly. Facing issues with only comparisons (<,>).

Hi @Rohit_More,

You might want to fine tune your prompt with a much more refined prompting technique like Chain of thought prompting technique, as that will help you define the goal into more logical steps that align with your objective. Please check out the System Prompt example and the guidelines around the Structure. This will give you an idea for a well defined system prompt.

Autopilot is a fantastic way to start, although use it as a baseline and customize it for your business goal.

Here’s another example of how clarity and the complete instructions contributes towards the prompt’s effectiveness:

Hope this helps!

@PD2

Thanks for your response.

I have updated the prompt and got the expected results.

But another challenge I am facing now:

Consumption limit of robot units is reached, hence I imported the solution to other tenant/organization. And again facing the same issue with same prompt, context and resources which were working perfect in previous tenant.

Hi @Rohit_More can you attach any Screen Shot of the error if possible

Hi @vivek.nadar

The issue is now resolved, I have built the agent from scratch again.

One thing I have noticed, if you generate the prompt using autopilot and make some changes in it, the agent will not give results as expected. You need to be very careful while changing autopilot generated prompt and try to make minimal changes in it.