Coder Social home page Coder Social logo

schalise / notion-chat-langchain Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mayooear/notion-chat-langchain

0.0 0.0 0.0 2.6 MB

A notion chatbot for your knowledge base built with langchain, typescript/javascript and pinecone.

Home Page: https://www.youtube.com/watch?v=prbloUGlvLE

JavaScript 4.36% TypeScript 84.75% CSS 10.88%

notion-chat-langchain's Introduction

A ChatBot for Your Notion Knowledge Base

Create a simple chatbot for question-answering your Notion knowledge base/docs using Openai, Typescript, LangChain and Pinecone.

Tutorial video

๐Ÿ“Š Example Data

This repo uses a Notion template of the support docs from cron - a next-generation calendar for professionals and teams

Development

  1. Clone the repo
  2. Install packages
pnpm install
  1. Set up your .env file
  • Copy .env.example into .env Your .env file should look like this:
OPENAI_API_KEY=

PINECONE_API_KEY=
PINECONE_ENVIRONMENT=

  • Visit openai and pinecone to retrieve API keys and insert into your .env file.
  1. In the config folder, go into pinecone-index.ts and replace PINECONE_INDEX_NAME with the index name in your pinecone dashboard.

๐Ÿง‘ Instructions for ingesting your own dataset

Export your dataset from Notion. You can do this by clicking on the three dots in the upper right hand corner and then clicking Export.

Follow these Notion instructions: Exporting your content

When exporting, make sure to select the Markdown & CSV format option.

Select Everything, include subpages and Create folders for subpages. Then click Export

This will produce a .zip file in your Downloads folder. Move the .zip file into the root of this repository.

Either unzip the folder using 7-Zip (or WinZip) or run the following Unix/Linux command to unzip the zip file (replace the Export... with your own file name).

unzip Export-d3adfe0f-3131-4bf3-8987-a52017fc1bae.zip -d Notion_DB

You should see a Notion_DB folder in your root folder that contains markdown files and folders of your knowledge base.

Ingest data

Now we need to ingest your docs. In very simple terms, ingesting is the process of converting your docs into numbers (embedding) that can be easily stored and analyzed for similarity searches.

npm run ingest

Running the app

Run your local dev environment npm run dev.

Use the search bar to ask a question about your docs.

Simple.

Deployment

You can deploy this app to the cloud with Vercel (Documentation).

Credit

This repo is inspired by notion-qa

notion-chat-langchain's People

Contributors

mayooear 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.