Skip to main content
Conversational agents remember what you’ve said and maintain context throughout the chat.

Quick Start

from praisonaiagents import Agent

# Create a conversational agent with memory
agent = Agent(
    instructions="You are a friendly assistant. Remember what users tell you.",
    memory=True  # Enable conversation memory
)

# Have a conversation
agent.start("Hi! My name is Alex.")
agent.start("What's my name?")  # Agent remembers: "Alex"
Enable memory=True to let agents remember conversations.

How Memory Works

FeatureWithout MemoryWith Memory
ContextEach message is newRemembers past messages
PersonalizationNoneRemembers preferences
Multi-turnLimitedFull conversation flow

Use Cases

Customer Support

Remember customer details and issue history

Tutoring

Track learning progress and adapt

Personal Assistant

Remember preferences and tasks

Companion

Build relationship over time

Example: Customer Support Bot

from praisonaiagents import Agent

support_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 conversation
support_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

Example: Learning Tutor

from praisonaiagents import Agent

tutor = 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 session
tutor.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

Complete Example

from praisonaiagents import Agent

# Personal assistant with memory
assistant = 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 messages
assistant.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

Best Practices

Use memory=True for any multi-turn conversation
Tell the agent what to remember in instructions
Define a clear personality in instructions
Agent automatically manages conversation history

Next: Building Research Agents

Learn how to create agents that search and gather information.