from praisonaiagents import Agent# Create a conversational agent with memoryagent = Agent( instructions="You are a friendly assistant. Remember what users tell you.", memory=True # Enable conversation memory)# Have a conversationagent.start("Hi! My name is Alex.")agent.start("What's my name?") # Agent remembers: "Alex"
Enable memory=True to let agents remember conversations.
from praisonaiagents import Agentsupport_bot = Agent( name="SupportBot", instructions="""You are a customer support agent. - Greet customers warmly - Ask for details about their issue - Provide step-by-step solutions - Remember their name and issue details""", memory=True)# Multi-turn conversationsupport_bot.start("Hi, I can't log into my account")support_bot.start("My email is alex@example.com")support_bot.start("I tried resetting but no email came")# Agent remembers all context and provides relevant help
from praisonaiagents import Agenttutor = Agent( name="MathTutor", instructions="""You are a patient math tutor. - Explain concepts step by step - Use simple language - Give practice problems - Remember what the student has learned""", memory=True)# Teaching sessiontutor.start("Can you help me with algebra?")tutor.start("What does 2x + 5 = 13 mean?")tutor.start("So I subtract 5 first?")tutor.start("Then divide by 2 to get x = 4?")# Tutor tracks progress and builds on previous explanations
from praisonaiagents import Agent# Personal assistant with memoryassistant = Agent( name="PersonalAssistant", instructions="""You are a personal assistant. Remember: - User's name and preferences - Tasks they mention - Topics they're interested in Be helpful, friendly, and personalized.""", memory=True)# Build a relationship over multiple messagesassistant.start("Hi! I'm Sarah and I love hiking.")assistant.start("What outdoor activities would you recommend?")assistant.start("I prefer mountains over beaches.")assistant.start("What should I do this weekend?")# Assistant remembers Sarah likes hiking and mountains