Langchain-Chatchat

Stale
GitHub Python Apache-2.0

Description

A local knowledge base RAG and Agent application platform built on Langchain with support for ChatGLM, Qwen, Llama and other LLMs, offering conversation, knowledge base management, and agent capabilities.

Key Features

  • Local knowledge base QA — Document loading, text splitting, vectorization and semantic retrieval via Langchain with BM25+KNN hybrid search
  • Multi-framework model inference — Supports Xinference, Ollama, FastChat, LocalAI for GLM-4, Qwen2, Llama3 and more
  • Agent tool calling — Optimized for ChatGLM3/Qwen with auto tool selection, single tool parameter parsing, and multimodal image chat
  • Database conversation — Natural language SQL queries against MySQL, PostgreSQL and other relational databases
  • WebUI multi-session management — Streamlit-based web interface with multi-session, custom system prompts, ARXIV and Wolfram queries
  • Full offline private deployment — 100% open-source models and vector databases via Ollama/Xinference local deployment

Use Cases

💡 Enterprise internal knowledge base — Upload company documents for private QA on policies, product manuals, and technical specs
💡 Offline data analysis — Query databases and generate analysis reports via local models without internet access
💡 Multimodal document QA — Upload images and documents for visual QA and document understanding with Qwen-VL
💡 Academic literature retrieval — ARXIV and Wolfram integration for paper search and data computation
💡 Customized agent services — Build domain-specific agents for customer service, tech support, and other business scenarios

Quick Start

```bash
pip install langchain-chatchat
chatchat init
# Edit configs/model_config.py to configure models
chatchat kb -n my_knowledge  # Create knowledge base
chatchat webui  # Start WebUI
# Visit http://localhost:8501
```

Related Projects

Related Articles