Build an Agent with Long-Term, Personalized Memory
AI Summary
Summary: Demo of a Cooking Application with Memory Feature
Introduction
- Demonstrated a cooking application that mimics chatbot long-term memory features.
- The application learns about the user’s cooking habits, allergies, and preferences.
Application Features
- Extracts information from user conversations about allergies, food preferences, and family attributes.
- Uses this information for meal planning and personalization.
Technical Approach
- The application uses two agents: a conversational agent and a memory agent.
- The memory agent listens to messages and stores relevant information.
- The memory feature is essential for the app to remember user-specific details like dietary restrictions.
Implementation Details
- The memory agent is split into two steps for efficiency:
- A low-cost model (memory sentinel) checks if a message contains new information.
- A more powerful model (memory manager) processes new information using GPT-4.
- The memory manager uses a custom tool to create, update, or delete memories in a database.
UI Design
- Adopted a top-down message display inspired by Gemini, as opposed to the traditional bottom-up chat interface.
Research and Inspiration
- Inspired by the MGPT project and research paper.
- MGPT combines long-term and short-term memory in chatbots, condensing information into a small context window.
Code and GitHub
- Shared code on GitHub for others to experiment with.
- The code includes the memory sentinel and memory manager setup using Lang Chain and Lang Graph.
Optimization and Future Considerations
- Discussed potential optimizations for cost and efficiency.
- Suggested improvements like vector storage for memories and session-based memory updates.
Conclusion
- The demo showcased a simple yet effective implementation of long-term memory in a cooking application.
- Encouraged viewers to access the code on GitHub and experiment further.
GitHub Repository Access - Link provided for viewers to access the demo code.