I wanna chat with the data in MongoDB I have succeeded with data that is not stored in MongoDB.
Does anyone have experience in working with LangChain? and connecting OpenAI/ChatGPT to MongoDB with GraphQL API keys?
I have issues connecting to the database because I can’t find a way to add a header/apikey correctly so I don’t get an error 401 “401 Client Error: Unauthorized for url:…”
I have tested with a simple connect with requests, and i worked fine.
requests.post(url, json={‘query’: query}, headers=headers)
Is there a reason you’re aiming to connect via GraphQL to MongoDB Atlas instead of going directly from the MongoDB driver (pymongo) akin to what’s described in the docs here (MongoDB Atlas | 🦜️🔗 Langchain
Thanks for your input and link, appreciated
Im have structured data in MDB (real estate data: sqm, address, sold price etc.), and kind of using LLM to create the GQL query and output the result from that. Prompting “What are the latest sales in x-zipcode?”.
Reviewing your link, seems like it’s for text or unstructured data or?
LLM is optimal for unstructured data, but also great for writing queries which makes it easy for non-code/tech ppl to extract data from db. I haven’t found another way/method to “ask the database” so far
So you are thinking of generating the GraphQL from natural language using an LLM (GPT4 works pretty well for certain cases for instance ) and then query MongoDB using that?