Each user_id gets its own conversation history. Use platform to separate different applications sharing the same backend:
# User in mobile appresponse = await lc.chat( query="What's my order status?", user_id="user_123", platform="mobile-app",)# Same user in web app — separate conversationresponse = await lc.chat( query="What's my order status?", user_id="user_123", platform="web-app",)
Make the bot speak in your brand voice by customizing the prompt:
lc = LangChat( llm=OpenAI("gpt-4o-mini"), vector_db=Pinecone("my-index"), db=Supabase(), prompt_template="""You are Aria, a friendly support agent for Acme Corp.Always be polite and professional. If you don't know the answer, say so clearly.Context from our knowledge base:{context}Conversation so far:{chat_history}Customer question: {question}Aria's response:""",)
The three template variables {context}, {chat_history}, and {question} are filled in automatically.