An exercise in implementing agentic memory — built as prep for MLADS+ Memory (Feb 2026).
The agent uses Azure OpenAI to maintain long-term memory across sessions via embedding-based recall, semantic fact extraction, and memory consolidation.
- Recall — embeds user input and searches past memories by cosine similarity
- Act — generates a response using relevant memories + conversation history
- Store — saves the interaction as episodic memories with embeddings
- Extract — distills durable facts (semantic memory) from conversations on exit
- Forget — decays old memories and consolidates redundant ones
pip install openai python-dotenv numpyCreate a .env file:
AZURE_OPENAI_ENDPOINT=your_endpoint
AZURE_OPENAI_KEY=your_key
python agent.py