Closed prameelareddi closed 6 months ago
You have to build a custom connection agent/tool
Thank you for your response @timxieICN can you please help me to build a custom connection agent.
Explain your use case a bit. Do you want to use mongoDb as a vector store or do you want to query the collections.
anyway you can use pymongo
from pymongo.mongo_client import MongoClient
client = MongoClient(uri)
db=client[db_name]
Thank you for your response @Saransh29 I used pymongo for connecting the database but i need to connect the langchain with MongoDB for relational database , we have a connecter called sqldatabase in langchain but mongoDb is noSQL right??? I need to chat with mongoDB with the help of langchain connector and llm Thanks !!!
okay, so Langchain and llamaIndex both don't support this right now.
So, for this usecase you can use gpt4 with a customized prompt (containing your db schema and details). And use it to generate query piplelines and execute them.
How can i do this , can you please help me to provide more details about it .
Hi, @prameelareddi! I'm Dosu, and I'm helping the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale.
From what I understand, you were looking for help with connecting your LangChain agent to a MongoDB database. You mentioned that you have successfully connected a relational database but are having trouble with a NoSQL database like MongoDB. Users @timxieICN and @Saransh29 have provided suggestions and solutions, but it seems that LangChain and llamaIndex do not currently support this. User @Saransh29 suggests using GPT4 with a customized prompt to generate query pipelines and execute them. You were seeking more details on how to do this.
Before we close this issue, we wanted to check if it is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on this issue. Otherwise, feel free to close the issue yourself or it will be automatically closed in 7 days.
Thank you for your understanding and contribution to the LangChain community!
Great Thanks !!! @dosubot db=SQLDatabase.from_uri('mongodb://username:password@host:port/database')
if I use the above I get the error below like
sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:mongodb
When I use this " postgresql+psycopg2://username:password@host: port/database "It works fine.
I understand SQLAlchemy considers only relational databases
if any suggestions? Thank you
@baskaryan Could you please help @prameelareddi with their issue? They are trying to connect their LangChain agent to a MongoDB database but are encountering an error when using the SQLDatabase.from_uri
method with a MongoDB URI. They have provided more details in their response comment. Thank you!
Mongo connection support is built in. https://python.langchain.com/docs/integrations/document_loaders/mongodb
Hi, @prameelareddi,
I'm helping the LangChain team manage their backlog and am marking this issue as stale. From what I understand, you were seeking help to connect a LangChain agent to a MongoDB database. Users timxieICN and Saransh29 provided suggestions, but it was noted that LangChain and llamaIndex do not currently support this. I marked the issue as stale and asked if it is still relevant to the latest version of the LangChain repository. You encountered an error when using the SQLDatabase.from_uri
method with a MongoDB URI, and I asked baskaryan for help. Digitalblur mentioned that MongoDB connection support is built in.
Could you please confirm if this issue is still relevant to the latest version of the LangChain repository? If it is, please let the LangChain team know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days.
Thank you for your understanding and cooperation.
Issue you'd like to raise.
Can you please help me with connecting my LangChain agent to a MongoDB database? I have connected my relational database below like
db = SQLDatabase.from_uri("mysql_db_url")
The above process is not working for Mongo Db because it is a NoSQL database anyone can help me to do this ??????? Thank you .....
Suggestion:
No response