svelte-chat-langchain

Svelte Chat Langchain

Svelte Chat Langchain (Template)

This is a minimal version of "Chat LangChain" implemented with SvelteKit, Vercel AI SDK and or course Langchain!

The Template is held purposefully simple in its implementation while still beeing fully functional.

It is best used as reference to learn the basics of a QA chatbot over Documents or a starting point for your own custom implementation.

Features

This app features:

  • Ingestion
  • RAG (Retrieval Augmented Generation)
  • Langchain Expression Language (Sequences & Conditional Chaining)
  • Streaming (simplified with Vercel AI SDK)

Honorable Mentions

This repository is heavily inspired by the original Chat Langchain repository.

For more advanced features such as Indexing / Record Management, user feedback and stream parsing to display sources, I highly recommend checking out the original Chat Langchain repository(https://github.com/langchain-ai/chat-langchain).

Setup

IMPORTANT - Set environment variables in a .env file (see .env.example for reference).

In the current configuration, you need:

Install dependencies.

pnpm i

Run the development server at http://localhost:5173/.

pnpm run dev

Important note

If you build your own example, note that this repos uses a modified vite.config.ts which is necessary to use the environment variables in local development without explicitly declaring them in the code. This is not necessary in production.

Top categories

Loading Svelte Themes