🔐 Mem0 is now SOC 2 and HIPAA compliant! We're committed to the highest standards of data security and privacy, enabling secure memory for enterprises, healthcare, and beyond. Learn more
Build a personalized Travel Agent AI using LangChain for conversation flow and Mem0 for memory retention. This integration enables context-aware and efficient travel planning experiences.
prompt = ChatPromptTemplate.from_messages([ SystemMessage(content="""You are a helpful travel agent AI. Use the provided context to personalize your responses and remember user preferences and past interactions. Provide travel recommendations, itinerary suggestions, and answer questions about destinations. If you don't have specific information, you can make general suggestions based on common travel knowledge."""), MessagesPlaceholder(variable_name="context"), HumanMessage(content="{input}")])
Set up the main program loop for user interaction:
Copy
Ask AI
if __name__ == "__main__": print("Welcome to your personal Travel Agent Planner! How can I assist you with your travel plans today?") user_id = "john" while True: user_input = input("You: ") if user_input.lower() in ['quit', 'exit', 'bye']: print("Travel Agent: Thank you for using our travel planning service. Have a great trip!") break response = chat_turn(user_input, user_id) print(f"Travel Agent: {response}")
By integrating LangChain with Mem0, you can build a personalized Travel Agent AI that can maintain context across interactions and provide tailored travel recommendations and assistance.