weblangchain  by langchain-ai

LangChain-powered chatbot for web research and cited answers

created 1 year ago
547 stars

Top 59.2% on sourcepulse

GitHubView on GitHub
Project Summary

WebLangChain is an example application demonstrating how to build a web-searching chatbot using LangChain. It allows users to query the internet and receive cited answers, targeting developers and researchers interested in integrating real-time web data into LLM applications. The primary benefit is a readily deployable, end-to-end system for web-augmented conversational AI.

How It Works

The system retrieves information by first using a retriever (defaulting to Tavily Search API) to fetch raw web content based on the user's query. For multi-turn conversations, it rephrases the query to be context-independent. To manage context window limitations, retrieved documents undergo contextual compression: they are split into chunks, and an embeddings filter removes chunks dissimilar to the initial query. The final answer is generated by an LLM using the compressed context, chat history, and the original question.

Quick Start & Requirements

  • Backend: poetry install then poetry run make start
  • Frontend: cd nextjs, yarn, then yarn dev
  • Prerequisites: OpenAI API key, Tavily API key. Optional keys for You.com, Google, or Kay.ai. Google Cloud credentials (.google_vertex_ai_credentials.json) if using Vertex AI.
  • Links: Live Demo, LangSmith Trace

Highlighted Details

  • Leverages Tavily for web search and LangChain for orchestration.
  • Exposes LangChain runnables as FastAPI endpoints via LangServe.
  • Includes a playground for interactive chain configuration.
  • Offers a separate JavaScript backend option (with limitations).

Maintenance & Community

  • Developed by LangChain AI.
  • Backend logic in main.py, frontend in nextjs/.
  • Deployed on Fly.dev and Vercel.

Licensing & Compatibility

  • License details are not explicitly stated in the README.

Limitations & Caveats

The JavaScript backend option has limitations, including the unavailability of LangServe, retriever customization, and the playground. Users must manage API keys for various search providers and potentially LLM providers.

Health Check
Last commit

1 year ago

Responsiveness

1 day

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

Explore Similar Projects

Feedback? Help us improve.