API + Telegram UserBot with langchain library

Hello there! Im trying to build my own app (userbot) with API using. I use some langchain-openai library on Python and this great, because i can “put” my own knowledge base in every answer. But facing some problems. GPT doesnt answer time-to-time properly by my base. And i dont know why. For example, sometimes he begins to “invent”, and when you ask him about that - he told me “Oh, im wrong. One sec…”. Its boring. Why he dont do what i write “him” in my context(text) file? May be i need to change my model? I use 4o-mini, and i thought it will be enough. May be some advices to how to teach his properly? Really hope for your help.