/ examples / consolidated_params / basic_memory.py
basic_memory.py
 1  """Basic memory example - minimal usage."""
 2  from praisonaiagents import Agent
 3  
 4  # Simple enable (uses default file-based memory)
 5  agent = Agent(
 6      instructions="You are a helpful assistant with memory.",
 7      memory=True,
 8  )
 9  
10  # With preset
11  agent_redis = Agent(
12      instructions="You are a helpful assistant.",
13      memory="redis",  # Uses redis preset
14  )
15  
16  # With URL
17  agent_postgres = Agent(
18      instructions="You are a helpful assistant.",
19      memory="postgresql://localhost/mydb",  # URL auto-detected
20  )
21  
22  if __name__ == "__main__":
23      response = agent.chat("Remember that my favorite color is blue.")
24      print(response)