More Premium Hugo Themes Premium Nuxt Themes

Langchain Cloudflare Nuxt Template

Langchain Cloudflare Nuxt Template

Author Avatar Theme by langchain-ai
Github Stars Github Stars: 75
Last Commit Last Commit: Jan 11, 2024 -
First Commit Created: Dec 18, 2023 -
Langchain Cloudflare Nuxt Template screenshot

Overview:

This repository showcases a conversational retrieval system that can route between multiple data sources. It aims to reduce distractions from off-topic documents and is particularly beneficial for small models. The system uses Cloudflare WorkersAI, Cloudflare Vectorize DBs, LangChain.js, and Nuxt + Vue for the frontend. Users can swap in more powerful models to improve performance. The system works by populating vectorstores with data, routing incoming questions to the appropriate vectorstore, retrieving context documents, and generating a final answer based on the retrieved context and the question.

Features:

  • Multiple data source routing
  • Reduction of distractions from off-topic documents
  • Customizable model integration
  • Cloudflare WorkersAI stack
  • Cloudflare Vectorize DBs
  • LangChain.js for orchestration
  • Nuxt + Vue frontend

Installation:

Here’s a step-by-step guide to installing the theme:

  1. Install dependencies:
npm install
  1. Create Vectorize DBs:

Note: This step requires a paid Cloudflare Workers plan.

  • Configure the databases to work with Cloudflare WorkersAI’s @cf/baai/bge-base-en-v1.5 embeddings model.
  • The database names should match those found in the default wrangler.toml file. If you choose different names, update the bindings in wrangler.toml.
  1. If you want to delete your databases, run the following commands:
[databasename1] delete
[databasename2] delete

Note: Replace [databasename1] and [databasename2] with the actual names of your databases.

  1. Use alternate data sources:
    • Update the routing steps in the chain if you want to use different data sources.
    • Also, remember to update the ingested data in server/api/ingest.ts file.

Summary:

This repository showcases a conversational retrieval system that can route between multiple data sources. It uses Cloudflare WorkersAI, Cloudflare Vectorize DBs, LangChain.js, and Nuxt + Vue for the frontend. The system is designed to reduce distractions caused by off-topic documents and can be customized by swapping in more powerful models. It works by populating vectorstores with data, routing incoming questions to the appropriate vectorstore, retrieving context documents, and generating final answers. To install, follow the provided guide which includes steps for installing dependencies and creating Vectorize DBs.