Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

:shipit: Telegram and LangChain question bot for large PDF documents.

License

Notifications You must be signed in to change notification settings

jesus-ale43/telegram-question-bot-langchain

Repository files navigation

Telegram question bot for large PDF documents.

This Telegram bot allows you to ask natural language questions about PDFs you want to consult, using Langchain and the OpenAI API to process and answer the questions.

Requirements

  • Node.js 18 or higher
  • A Telegram account
  • A OpenAI account
  • A Pinecone account

Installation

  1. Clone this repository on your local machine.
$ git clone https://github.com/jesus-ale43/telegram-question-bot-langchain.git
  1. Install the required dependencies.

Note: You can use your own package manager if you prefer, just make sure to install the dependencies in the package.json file.

$ yarn install
  1. Create an index in Pinecone.

Dimension: 1536
Pod Type: P1 - Faster queries (Recommended)

Preview Image
  1. Set up your .env file.

Copy .env.example into .env

Your .env file should look like this:

TOKEN=
OPENAI_API_KEY=

PINECONE_API_KEY=
PINECONE_ENVIRONMENT=
PINECONE_INDEX_NAME=

Usage

Convert your PDF files to embeddings

This repository can load multiple PDF files

  1. Inside docs folder, add your pdf files.

  2. Run the script yarn ingest to ingest and embed your docs.

  3. Check Pinecone dashboard to verify your vectors have been added.

Run the app

Once you've verified that the embeddings and content have been successfully added to your Pinecone, you can run the script yarn dev to launch the local dev environment, and then type /question <question> in your Telegram bot chat.

Credits

About

:shipit: Telegram and LangChain question bot for large PDF documents.

Resources

License

Stars

Watchers

Forks

Releases

No releases published