Memory

Note: The sandbox forgets the files when the run ends. On your machine, the memory files remain.

Turn memory on

Memory lets a later task see what an earlier task was told.

memory=True stores the conversation in files. No extra package is required.

Example

from praisonai import Agent

agent = Agent(
    name="Personal Assistant",
    instructions="You are a helpful assistant that remembers user preferences.",
    memory=True,
)
print(agent.start("My name is Amina and I prefer dark mode"))
print(agent.start("What is my name?"))

Try it Yourself

Example explained

  • memory=True — File-based memory for this agent.

Reference: documentation