Prerequisites
- Python 3.9+
- A database (PostgreSQL recommended for production)
- OpenAI API key (or another model provider)
Setup
1
Set up your virtual environment
2
Install dependencies
3
Run PostgreSQL with PgVector
Install Docker Desktop and run:
4
Set your API key
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, company: Acme Corp, role: data scientist)
- Stored a preference (prefers detailed explanations)
- Recalled this context in Session 2 to answer accurately