LogiChat is a Retrieval-Augmented Generation (RAG) based chatbot application powered by Large Language Models (LLMs). It enables users to upload their documents and have intelligent, context-aware conversations derived exclusively from their provided data.
- Document Uploads: Users can upload documents in various formats.
- Intelligent Conversations: The chatbot generates contextually accurate responses based on user-provided data.
- Powered by LLMs: Leverages advanced LLMs for natural language understanding and generation.
- Secure and Private: Your documents are used solely for generating responses and are stored securely.(Not done to store the responses)
- Backend: Flask, LangChain, PineConeVector, OpenAI API
- Frontend: Next.js
- Database: PineConeVector for vectorized document storage
LogiChat uses Retrieval-Augmented Generation (RAG) to combine LLM capabilities with document retrieval. The steps include:
- Document Vectorization: Uploaded documents are converted into embeddings and stored in a vector database.
- History-Aware Retrieval: Queries are reformulated contextually using chat history.
- Response Generation: Retrieved data and user queries are processed by the LLM to generate responses.
- Python 3.8+
- Node.js 16+
- An OpenAI API key
- A
.envfile with the following keys:OPENAI_API_KEY=your_openai_api_key
PINECONE_API_KEY=your_pine_cone_vector_api_key
PINECONE_INDEX_NAME=your_pine_cone_vector_index_name
-
Clone the repository:
git clone https://github.com/naitikmp/LogiChat.git cd LogiChat/backend -
Create a virtual environment and install dependencies:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt
-
Run the Flask backend:
python app.py
-
Navigate to the
clientdirectory:cd ../client -
Install dependencies:
npm install
-
Start the development server:
npm run dev
- Start the backend and client servers.
- Open your browser and navigate to the Next.js client (typically at
http://localhost:3000). - Upload a document to begin a conversation.
- Interact with the chatbot using natural language queries.
LogiChat/
├── backend/
│ ├── utils.py # Utility files for the application
│ ├── app.py # Main Flask application
│ ├── requirements.txt # Backend dependencies
│ └── .env # Environment variables
├── client/
│ ├── pages/ # Next.js pages
│ ├── components/ # Reusable UI components
│ ├── public/ # Static assets
│ └── package.json # Frontend dependencies
└── README.md # Project documentation
Contributions are welcome! Please fork the repository and create a pull request with your proposed changes.