Eric013 / chat-llamaindex

Home Page:https://chat-llamaindex.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool



LlamaIndex Chat Logo

LlamaIndex Chat

Create chat bots that know your data

LlamaIndex Chat Screen

Welcome to LlamaIndex Chat. You can create and share LLM chatbots that know your data (PDF or text documents).

Getting started with LlamaIndex Chat is a breeze. Visit https://chat-llamaindex.vercel.app - a hosted version of LlamaIndex Chat with no user authentication that provides an immediate start.

๐Ÿš€ Features

LlamaIndex Chat is an example chatbot application for LlamaIndexTS. You can:

  • Create bots using prompt engineering and share them with other users.
  • Modify the demo bots by using the UI or directly editing the ./app/bots/bot.data.ts file.
  • Integrate your data by uploading documents or generating new data sources.

โšก๏ธ Quick start

Local Development

Requirement: NodeJS 18

  • Clone the repository
git clone https://github.com/run-llama/chat-llamaindex
cd chat-llamaindex
  • Set the environment variables
cp .env.template .env.development.local

Edit environment variables in .env.development.local.

  • Run the dev server
pnpm install
pnpm dev

Vercel Deployment

Deploying to Vercel is simple, just click the button below and follow the instructions:

Deploy with Vercel

In case you're deploying to a Vercel Hobby account, make sure to change the running time to 10 seconds as this is the limit for the free plan.

If you want to use the sharing functionality, then you need to create a Vercel KV store and connect it to your project. Just follow this step from the quickstart. No further configuration is needed as the app is automatically using a connected KV store.

๐Ÿ”„ Sharing

LlamaIndex Chat supports sharing of bots via URLs. Demo bots are read-only and can't be shared. But you can create new bots (or clone and modify a demo bot) and call the share functionality in the context menu. It will create a new URL that can be shared with others. Opening the URL, users can directly use the shared bot.

๐Ÿ“€ Data Sources

The app is using a ChatEngine for each bot with a VectorStoreIndex attached. The cache folder in the root directory is used as Storage for each VectorStoreIndex.

Each subfolder in the cache folder contains the data for one VectorStoreIndex. To set which VectorStoreIndex is used for a bot, use the subfolder's name as datasource attribute in the bot's data.

Generate Data Sources

To generate a new data source, create a new subfolder in the datasources directory and add the data files (e.g. PDFs) to it. Then create the VectorStoreIndex for the data source, by running the following command:

pnpm run generate <datasource-name>

Where <datasource-name> is the name of the subfolder with your data files.

๐Ÿ™ Thanks

Thanks go to @Yidadaa for his ChatGPT-Next-Web project, which was used as a starter template for this project.

About

https://chat-llamaindex.vercel.app

License:MIT License


Languages

Language:TypeScript 83.7%Language:CSS 14.7%Language:JavaScript 1.6%Language:Shell 0.0%