chat-langchainjs  by sullivan-sean

Next.js chat app using LangChain docs as a data source

created 2 years ago
291 stars

Top 91.6% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a Next.js application for building a chat interface powered by LangChain.js, enabling users to query their own data sources. It's designed for developers and researchers looking to create custom AI-powered chatbots with data-specific knowledge.

How It Works

The application leverages LangChain.js for data ingestion and querying. It downloads a specified data source (e.g., Langchain docs), processes it by splitting text and creating embeddings, and stores these in a local vectorstore. The Next.js frontend then interacts with a backend API that uses these embeddings to retrieve relevant information and generate responses via an LLM, likely OpenAI.

Quick Start & Requirements

  • Install dependencies and run ingestion: yarn && yarn ingest (or NODE_OPTIONS='--experimental-fetch' yarn ingest for Node v16).
  • Run the development server: yarn dev.
  • Prerequisites: Node.js (v16+), Yarn, wget.
  • Requires an OpenAI API key set in .env.
  • Data ingestion creates a data/ directory with vectorstore.
  • Official Docs: https://js.langchain.com/docs/

Highlighted Details

  • Chatbot can be configured to query custom data by modifying the ingestion pipeline and API prompt.
  • Deployment guidance provided for Fly.io using fly.toml and Dockerfile.
  • Notes limitations with Vercel hosting due to WebSockets and streaming response issues.

Maintenance & Community

  • Project appears to be a personal project by sullivan-sean.
  • No explicit community links (Discord, Slack) or roadmap are provided in the README.

Licensing & Compatibility

  • The README does not specify a license.
  • Compatibility for commercial use or closed-source linking is not stated.

Limitations & Caveats

The project is described as a Next.js app, but notes that Vercel hosting is problematic for its WebSocket and streaming response requirements, suggesting Fly.io or custom server solutions. The README does not mention any specific versioning or deprecation status.

Health Check
Last commit

3 months ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
0
Star History
0 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.