> ## Documentation Index
> Fetch the complete documentation index at: https://langchat.neurobrains.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> LangChat — production-grade RAG chatbots in minutes.

## 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.

```python theme={null}
from langchat import LangChat
from langchat.providers import OpenAI, Pinecone, Supabase

lc = LangChat(
    llm=OpenAI("gpt-4o-mini"),
    vector_db=Pinecone("my-index"),
    db=Supabase(),
)

response = await lc.chat(query="What's our refund policy?", user_id="alice")
print(response)  # prints the AI's answer
```

That's it. LangChat handles the RAG pipeline, session management, conversation history, document indexing, and persistence — all out of the box.

***

## What's included

<CardGroup cols={2}>
  <Card title="6 LLM providers" icon="robot">
    OpenAI, Anthropic, Gemini, Mistral, Cohere, and local Ollama — all with automatic credential loading from environment variables
  </Card>

  <Card title="RAG pipeline" icon="magnifying-glass">
    Pinecone vector search + Flashrank reranking + contextual conversation prompts, pre-configured and ready to use
  </Card>

  <Card title="Session management" icon="users">
    Per-user, per-platform conversation history stored in Supabase — survives server restarts
  </Card>

  <Card title="Document indexing" icon="file">
    Index PDFs, Markdown, CSV, and more with one call: `lc.index("docs/")`
  </Card>

  <Card title="REST API" icon="server">
    One-line FastAPI server with a built-in chat UI: `create_app(llm=..., vector_db=..., db=...)`
  </Card>

  <Card title="Typed responses" icon="code">
    `ChatResponse` dataclass — `response.text`, `if response:`, `print(response)`. No more dict key guessing.
  </Card>
</CardGroup>

***

## Get started

<Steps>
  <Step title="Install">
    ```bash theme={null}
    pip install langchat
    ```
  </Step>

  <Step title="Set environment variables">
    ```bash theme={null}
    OPENAI_API_KEY=sk-...
    PINECONE_API_KEY=pcsk-...
    SUPABASE_URL=https://xxxx.supabase.co
    SUPABASE_KEY=eyJhbGc...
    ```
  </Step>

  <Step title="Build your chatbot">
    See the [Quick Start](/quick-start) guide.
  </Step>
</Steps>

***

## Links

* [GitHub](https://github.com/neurobrains/langchat)
* [PyPI](https://pypi.org/project/langchat/)
* [Quick Start](/quick-start)
* [API Reference](/api-reference/langchat)
