Code Monkey home page Code Monkey logo

langchain-production-project's Introduction

Restaurant Chatbot Project

This project is a restaurant chatbot that is distributed across several microservices. The chatbot can answer general questions about the restaurant, such as operating hours, menu options, and health protocols.

Services

The project consists of the following services:

  1. Frontend: A React application that provides the user interface for interacting with the chatbot.

  2. Service2: A Python (FastAPI)-based backend that coordinates the communication between the frontend and Service3. This service also manages the interaction history between the user and the chatbot.

  3. Service3: Another Python (FastAPI)-based backend hosting the chatbot algorithm. This service communicates with the AI engine (OpenAI GPT-3.5-turbo) to process user queries and generate suitable responses.

  4. Redis: A Redis server used for state storage across the services.

  5. Postgres: A Postgres server acting as a database for storing vector embeddings.

Setup

To get the project up and running, make sure Docker is installed on your system.

Then, run the following command:

docker-compose up

This command starts all services using the docker-compose.yml file. It downloads the necessary Docker images, creates associated containers, and gets them running together.

Data Population

The provided insert_data.py script can be used to populate the Postgres database with your data. To do this, run the script once the services are up and running. It will connect to the Postgres service, create the necessary tables, and insert data into them.

Env Variable

Rename the .env.example to .env and set your OpenAI API Key.

LangChain on KuberNetes - Locally

  1. Run Registry as Docker Container

docker run -d -p 5000:5000 --name local-registry registry:2

  1. Build all images locally
docker build -t mypostgres ./postgres
docker build -t myservice2 ./service2
docker build -t myservice3 ./service3
docker build -t myfrontend ./frontend
  1. Tag and push images
# For Postgres
docker tag mypostgres localhost:5000/mypostgres
docker push localhost:5000/mypostgres

# For Service2
docker tag myservice2 localhost:5000/myservice2
docker push localhost:5000/myservice2

# For Service3
docker tag myservice3 localhost:5000/myservice3
docker push localhost:5000/myservice3

# For Frontend
docker tag myfrontend localhost:5000/myfrontend
docker push localhost:5000/myfrontend

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.