Deut. 18:10-11 says:
לא ימצא בך מעביר בנו ובתו באש קסם קסמים מעונן ומנחש ומכשף וחבר חבר ושאל אוב וידעני ודרש אל המתים
Let no one be found among you who consigns his son or daughter to the fire, or who is an augur, a soothsayer, a diviner, a sorcerer,one who casts spells, or one who consults ghosts or familiar spirits, or one who inquires of the dead.
Thus one should not consult ghosts. The context of this verse however is more about idolatry than say, mere interaction. This is also repeated in Leviticus 19:31. That being said, many Jewish sources have historically also advised against any involvement with ghosts. For instance, Ibn Ezra says to not seek to request their services (as Saul did I Samuel 28:8). This implies that the main prohibition is to use the ghosts to inquire from them - i.e. reaching out to ghosts first. My question is then, what if the (neutral) ghosts are the ones who reach out to us (to say, only chat with us)? Are we to simply ignore the ghost and avoid the contact? What if the said ghost refuses to go away (if we ignore it or if we tell it to go away)? This all relates to how far would the halachic prohibitions apply and what we should do in such a case for its questionable whether it would even be a halachic prohibition in this context.
The answer to this question should probably avoid sources like Rambam who didn't believe that ghosts existed and/or could be communicated with. This question is according to the other perspective.