mayooear / gpt4-pdf-chatbot-langchain

GPT4 & LangChain Chatbot for large PDF docs
https://www.youtube.com/watch?v=ih9PBGVVOO4
14.73k stars 3k forks source link

Enhancement - ability to use a graph database such as neo4j instead of vector database #449

Closed angelo-smartsheet closed 2 months ago

angelo-smartsheet commented 6 months ago

Some research out there says that a graph database can give more performance instead of a vector database. Would be cool if such a feature existed!

https://tomoro.ai/insights/graph-databases-as-rag-backends

dosubot[bot] commented 6 months ago

🤖

Hello @angelo-smartsheet!👋 I'm Dosu, a friendly bot here to lend a hand while our human maintainers are away. I offer help with bug fixes, answering questions, and even guide newcomers to be contributors. Looking forward to assisting you on this journey! 😊

Thank you for your suggestion, angelo-smartsheet. The idea of using a graph database like Neo4j instead of a vector database like Pinecone is indeed an interesting one. Graph databases can provide certain advantages in terms of data relationships and querying capabilities.

However, the current implementation of the gpt4-pdf-chatbot-langchain uses Pinecone, a vector database, which is particularly suited for machine learning applications. This is evident from the import statement import { PineconeStore } from 'langchain/vectorstores/pinecone'; and the usage of PineconeStore.fromExistingIndex to create a vector store in the pages/api/chat.ts file.

Switching to a graph database would require significant changes to the codebase and the way data is stored and retrieved. It would also require a thorough evaluation to ensure that the performance and other benefits of a graph database outweigh the costs of such a transition.

While I can't make this change, I recommend creating a detailed proposal outlining the benefits and potential implementation strategy for this enhancement. This would provide a solid basis for the repository maintainers to consider this enhancement.

Please let me know if you need any further clarification or assistance.

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.