Prerequisites
- Python 3.9+
- A database (PostgreSQL recommended for production)
- OpenAI API key (or another model provider)
Setup
Run PostgreSQL with PgVector
Install Docker Desktop and run:
Your First Learning Agent
Create a file calledlearning_agent.py:
learning_agent.py
What Just Happened?
Withlearning=True, the agent:
- Extracted profile info from Session 1 (name: Sarah, preferred name if mentioned)
- Recalled this profile in Session 2 to answer accurately
learning=True only enables user profile extraction. For user memory, session context, and other stores, use explicit LearningMachine configuration.
Customizing What Gets Learned
You can control learning through your choice of learning stores and learning modes. Depending upon which stores are enabled for your agent, and the choice of default learning mode for that store or a selected mode, your agent behavior can be optimized for specific use cases.Using SQLite (Development)
For quick development without PostgreSQL:Next Steps
Learning Stores
Deep dive into Learning Stores.
Learning Modes
Control how and when learning happens.