Skip to main content

What is LangChat?

LangChat is a Python library that turns the complex task of building a production-ready RAG chatbot into a few lines of code.
That’s it. LangChat handles the RAG pipeline, session management, conversation history, document indexing, and persistence — all out of the box.

What’s included

6 LLM providers

OpenAI, Anthropic, Gemini, Mistral, Cohere, and local Ollama — all with automatic credential loading from environment variables

RAG pipeline

Pinecone vector search + Flashrank reranking + contextual conversation prompts, pre-configured and ready to use

Session management

Per-user, per-platform conversation history stored in Supabase — survives server restarts

Document indexing

Index PDFs, Markdown, CSV, and more with one call: lc.index("docs/")

REST API

One-line FastAPI server with a built-in chat UI: create_app(llm=..., vector_db=..., db=...)

Typed responses

ChatResponse dataclass — response.text, if response:, print(response). No more dict key guessing.

Get started

1

Install

2

Set environment variables

3

Build your chatbot

See the Quick Start guide.