LongTrainer

Production-Ready RAG Framework for Multi-Tenant Chatbots

Building a RAG chatbot from scratch means wiring together LangChain, a vector DB, memory management, multi-tenancy, and streaming. LongTrainer does all of this in 10 lines of code. Multi-tenant bots, persistent MongoDB memory, 9 vector DB providers, streaming, tool calling, and LangGraph agents - all batteries included.

$pip install longtrainer

Everything you need for production RAG

No more wiring together dozens of components. LongTrainer handles the full stack.

Multi-Tenant Isolation

Each bot has its own documents, vector store, memory, and config. Perfect for SaaS applications where each customer needs a separate AI assistant.

9 Vector DB Providers

FAISS, Pinecone, Chroma, Qdrant, PGVector, MongoDB Atlas, Milvus, Weaviate, and Elasticsearch. Configure per bot.

Streaming Responses

Sync and async streaming out of the box. Real-time token-by-token responses for better user experience.

LangGraph Agent Mode

Switch from RAG mode to full LangGraph agent mode with tool calling. Web search, calculators, custom APIs - any LangChain tool.

Dynamic Model Factory

OpenAI, Claude, Gemini, AWS Bedrock, HuggingFace, Groq, Together AI, and Ollama. Configure the LLM per bot.

CLI and REST API

Built-in FastAPI server. Run `longtrainer serve` for a zero-code REST API. Docker-ready for production deployment.

Supported Integrations

Vector Databases

  • FAISS
  • Pinecone
  • Qdrant
  • Chroma
  • PGVector
  • MongoDB Atlas
  • Milvus
  • Weaviate
  • Elasticsearch

LLM Providers

  • OpenAI
  • Anthropic Claude
  • Google Gemini
  • AWS Bedrock
  • HuggingFace
  • Groq
  • Together AI
  • Ollama (local)

Document Loaders

  • PDF, DOCX, TXT
  • AWS S3
  • Google Drive
  • Confluence
  • GitHub
  • Notion
  • JSON
  • Dynamic injection
Part of the Long Suite

LongTrainer is the build layer of the complete RAG ecosystem

The Long Suite covers the full RAG lifecycle. LongParser prepares your documents. LongTrainer builds the chatbot. LongTracer verifies the answers. LongProbe tests the retrieval. Each tool works independently or together.

View the Long Suite ecosystem

Common questions

LongTrainer is a production-ready RAG framework built on LangChain. It handles the full chatbot lifecycle - document ingestion, vector storage, persistent memory, multi-tenant isolation, streaming responses, and tool calling - so you can build a production RAG chatbot in 10 lines of code instead of wiring together dozens of components manually.
LongTrainer assigns each bot a unique bot_id and each conversation a unique chat_id. All data - documents, vector embeddings, conversation history - is isolated per bot. Multiple bots can run on the same LongTrainer instance with completely separate data, making it ideal for SaaS applications where each customer needs their own AI assistant.
LongTrainer supports 9 vector database providers: FAISS (local), Pinecone, Chroma, Qdrant, PGVector, MongoDB Atlas, Milvus, Weaviate, and Elasticsearch. You can configure the vector store per bot, so different bots in the same application can use different backends.
Yes. LongTrainer uses a Dynamic Model Factory that supports OpenAI, Anthropic Claude, Google Gemini, AWS Bedrock, HuggingFace, Groq, Together AI, and Ollama (for local inference). You can configure the LLM per bot, so different bots can use different models.
RAG mode uses LCEL (LangChain Expression Language) for simple document Q&A - fast, reliable, and ideal for knowledge base chatbots. Agent mode uses LangGraph and enables tool calling - the bot can use external tools like web search, calculators, or custom APIs to answer questions. Agent mode is better for complex tasks that require reasoning and action.
LongTrainer includes a built-in CLI and REST API server. Run `longtrainer serve` to start a FastAPI server that exposes all bot operations as HTTP endpoints. You can also use the `--tools` flag to inject tools at startup without writing any code. The server is Docker-ready for production deployment.

Need LongTrainer deployed in production?

We build custom RAG systems using LongTrainer for enterprise clients. Schedule a free consultation.