Not expected Chatbot answer (Build a Neo4j-backed Chatbot using Python)

I'm trying the python app mentioned in the lesson "Build a Neo4j-backed Chatbot using Python). It works fine for most of the questions I'm asking. However, when I'm asking how many degrees of separation there are between 2 actors ?, the chatbot replies with "I'm unable to provide information about degrees of separation between actors. However, I can help with information about movies they have appeared in or their collaborations. Would you like to know more about that?"
According the lesson, the chatbot is supposed to be able to give the right answer. Can you help for this ?

Hi,

It looks like the agent is taking the scope defined in the agent prompt to literally and refusing to answer questions relating to degrees of seperation.

You would have set the agent scope in this lesson - https://graphacademy.neo4j.com/courses/llm-chatbot-python/2-configuration/4-defining-scope/

I would try changing the scope, opening it up a little, or even including a specific instruction about providing degrees of separation.

I dont get the same results, it could be randomness, or changes in the OpenAI models since the course was written?!

Martin

Thanks for the answer. In the project, there are 3 tools "General Chat", "Movie Plot Search" and "Movie information". In the agent_prompt, it is mentioned that there are these 3 tools. I would like to understand how does the agent decide

  • if a tool must be used ?
  • which tool must be used ?
    Thanks,
    Laurent

I would like to understand how does the agent decide

It is a combination of the agent prompt and the tool names and descriptions.

There is a summary in the Neo4j and LLM Fundamentals course - https://graphacademy.neo4j.com/courses/llm-fundamentals/3-intro-to-langchain/4-agents/

You may also find the Langchain Agents documentation useful - Agents | 🦜️🔗 LangChain

Martin

1 Like

You've copied 2 times the same links. Is it by purpose ?

1 Like

I have fixed the langchain docs link