Giter Site home page Giter Site logo

tbroadley / ai-safety-conversational-agent Goto Github PK

View Code? Open in Web Editor NEW

This project forked from langchain-ai/chat-langchain

1.0 1.0 0.0 313 KB

Home Page: https://ai-safety-conversational-agent.thomasbroadley.com/

Shell 1.29% Python 79.83% Makefile 0.32% HTML 18.57%

ai-safety-conversational-agent's Introduction

AI Safety Conversational Agent

This is a fork of chat-langchain. It takes data from https://aisafety.info and uses it to create a chatbot that can answer questions about AI safety.

Screenshot of the AI Safety Conversational Agent answering questions about AI alignment.

โœ… Running locally

  1. Install dependencies: pip install -r requirements.txt
  2. Download this folder and extract it into a folder called aisafety.info
  3. Run ingest.sh to ingest the data in aisafety.info
  4. Run the app: make start
    1. To enable tracing, make sure langchain-server is running locally and pass tracing=True to get_chain in main.py. You can find more documentation here.
  5. Open localhost:9000 in your browser.

๐Ÿ“š Technical description

There are two components: ingestion and question-answering.

Ingestion has the following steps:

  1. Pull documents from Google Drive
  2. Load documents with LangChain's document loaders
  3. Split documents with LangChain's TextSplitter
  4. Create a vectorstore of embeddings, using LangChain's vectorstore wrapper (with OpenAI's embeddings and FAISS vectorstore).

Question-Answering has the following steps, all handled by ChatVectorDBChain:

  1. Given the chat history and new user input, determine what a standalone question would be (using GPT-3).
  2. Given that standalone question, look up relevant documents from the vectorstore.
  3. Pass the standalone question and relevant documents to GPT-3 to generate a final answer.

TODOs

ai-safety-conversational-agent's People

Contributors

agola11 avatar eltociear avatar hwchase17 avatar sangyh avatar sid77x avatar tbroadley avatar

Stargazers

 avatar

Watchers

 avatar

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.