Skip to content

Latest commit

 

History

History
81 lines (55 loc) · 1.87 KB

README.md

File metadata and controls

81 lines (55 loc) · 1.87 KB

Langchain Chat Bot

A simple chat bot used to chat with document built using Langchain, OpenAI and Supabase.

Langchain Chat

Features

  • Chat with the bot about scrimba courses
  • Conversation history is saved locally
  • Uses OpenAI to generate responses, embeddings and retrieve documents
  • Uses Supabase as vector storage

Getting Started

Technologies

  • Node.js
  • pnpm
  • Supabase
  • OpenAI
  • Langchain

Installation

  1. Clone the repository and go to the project directory
git clone <repo-url>
cd langchain-chat
  1. Install dependencies
pnpm install
  1. Create a .env file in the root directory and add the following environment variables
SUPABASE_API_KEY=your-supabase-api-key
SUPABASE_URL=your-supabase-url
OPENAI_API_KEY=your-openai-api-key

Vector Store Setup

  1. Have access to OpenAI API
  2. Have access to Supabase and create a new project and add query from src/db/match_documents.sql to create the documents table
  3. Load document, generate embeddings and save embeddings to Supabase vector storage by running:
pnpm load

Development

  1. Open live server from index.html

Roadmap

v 0.1.0

  • Create a chatbot that can chat about scrimba courses
  • Save conversation history locally
  • Use OpenAI to generate responses
  • Use OpenAI to generate embeddings
  • Use OpenAI to retrieve documents
  • Use Supabase as vector storage

v 0.2.0

  • Make file input for users to upload their own documents
  • Update prompts to be suited to any document upload
  • Update the chatbot to be able to chat about any document uploaded
  • Update UI

Credits