Chatbot for website Q&A using LLMs and vector DB
Top 49.8% on sourcepulse
This project provides a template for building a website-specific chatbot using LangChain, Supabase, and Next.js. It targets developers looking to integrate AI-powered Q&A capabilities into their web applications, leveraging vector embeddings for efficient information retrieval.
How It Works
The system scrapes specified website URLs using Cheerio, extracts relevant text content and metadata, and converts this data into vector embeddings via OpenAI's text-embedding-ada-002
model. These embeddings are stored in a Supabase PostgreSQL database with the pgvector
extension. When a user asks a question, the system retrieves similar document vectors from Supabase and uses LangChain to generate a relevant answer based on the scraped content.
Quick Start & Requirements
pnpm install
.env
file with OPENAI_API_KEY
, NEXT_PUBLIC_SUPABASE_URL
, NEXT_PUBLIC_SUPABASE_ANON_KEY
, and SUPABASE_SERVICE_ROLE_KEY
.config/
and utils/custom_web_loader.ts
.npm run scrape-embed
npm run dev
Highlighted Details
pgvector
.Maintenance & Community
langchain-chat-nextjs
.Licensing & Compatibility
Limitations & Caveats
The custom web loader requires manual configuration of CSS selectors for each website, which may be brittle to website structure changes. The project is presented as a template, implying potential need for further development for production readiness.
2 years ago
Inactive