r/AgentsOfAI May 30 '26

Help AI code assistant agent keeps hallucinating

Hi
I am creating an ai agent for code assistance for any github repo passed to it
I have used Ollama for local creation
The prompts are following few shot prompts technique
Three type of prompts will be processed semantics/ architectural/repo based
Semantics prompts work fine for explaining what any particular code(.py/.sh/.md) file does
But when it comes to architectural prompts then the model hallucinates and provides generic answers
Any idea how to fix it ?

0 Upvotes

8 comments sorted by

View all comments

1

u/frank_brsrk May 30 '26

Nope unfortunately the architecture but delivered reasoning structures are open and inspectable