Introduction to doc-chatbot: GPT x Pinecone x LangChain
The doc-chatbot project integrates cutting-edge technologies such as GPT, Pinecone, and LangChain to create an interactive platform for document-based conversations. It leverages these advanced technologies to enable dynamic discussions on a wide range of topics, making it versatile and applicable across various use cases.
Features of doc-chatbot
-
Multiple Conversations: Users can set up multiple topics to talk about. This flexibility allows for extensive exploration of different subjects within one platform.
-
File Handling: Users can upload any number of files per topic. The chatbot supports various formats, including
.pdf
,.docx
, and.txt
. These files are converted into embeddings and stored for future interactions. -
Chat Management: For each topic, users can create numerous chat windows, offering an organized way to manage multiple discussions simultaneously.
-
Browser-Based Operations: Users can upload files, convert them into embeddings, store these embeddings, and delete Pinecone namespaces—all directly from the web browser without the need for additional software.
-
Automatic Chat History Retrieval: The system automatically stores and retrieves chat history using local storage, ensuring users can effortlessly continue their discussions.
Technical Framework
The project is built using modern technologies:
- TypeScript: Ensures a type-safe environment for developing robust applications.
- Next.js: Provides a server-rendered React framework to help create scalable web applications.
- React: Delivers a component-based approach for building dynamic user interfaces.
- TailwindCSS: Offers utility-first styling, making it easy to create responsive designs.
- LangChain and Pinecone: Enhance the system's ability to process and store vector embeddings efficiently.
Setting up Locally
The doc-chatbot can be run locally by cloning the repository and following some setup steps:
-
Clone the Repository: Download the project using the command:
git clone https://github.com/dissorial/doc-chatbot.git
-
Pinecone Setup: Create a Pinecone account, configure an index with specific settings, and generate an API key to enable the embedding functionality.
-
Install Packages: Use
yarn install
to install necessary packages. -
Configuration: Set up the
.env
file to define the environment parameters. -
Deploying and Running: Use
npm run dev
to start the application in development mode. Additional configurations are necessary for production deployment, including setting secrets for authentication.
Troubleshooting
-
General Issues: Ensure you are using the latest Node version. If issues with documents arise, try converting them to text or checking for file integrity.
-
Pinecone Related Issues: Confirm vector dimensions are set correctly. Be aware that free plan indexes are auto-deleted after inactivity and need to be refreshed to keep active.
Acknowledgments
The project is a derivative of a repository originally forked from GPT-4 & LangChain by mayooear, incorporating numerous enhancements and changes.
The doc-chatbot project provides a robust platform for document-focused interactions, harnessing the power of modern technologies to deliver an efficient and versatile solution for users looking to engage in meaningful conversations around diverse topics.