AI and Deep Learning Community Question

What are the best frameworks for building autonomous AI agents with long-term memory?

Posted on 2024-09-10 • In AI and Deep Learning • By Michael Stevens

I am trying to build a customer support agent that doesn't just forget the user after the session ends. I’ve been looking at LangChain and LangGraph, but I'm struggling with how to implement persistent long-term memory and state management effectively. Is there a specific vector database or architectural pattern that works best for maintaining context over several weeks?

3 Answers 8,603 Views

All answers to this question 3 Answers

Amanda Collins Answered on 2024-09-12
Answered

For long-term memory, LangGraph is currently superior to standard LangChain because it handles state as a first-class citizen. You should look into a "Checkpointer" pattern which saves the state of your agentic thread to a database like PostgreSQL or Redis. For the "knowledge" part of memory, Pinecone or Milvus are industry favorites. The trick is to separate "short-term context" (the current conversation) from "long-term summaries" (what the user liked last month). You can have a background agent that periodically summarizes past interactions to keep the context window clean.

Jessica Reed Answered on 2024-09-14
Answered

Are you planning to use a specific LLM like GPT-4o or Claude 3.5 Sonnet, or are you trying to keep the entire stack open-source with something like Llama 3?

Michael Stevens Commented on 2024-09-15
Commented

Jessica, I'm actually leaning towards Llama 3 on-prem because of data privacy concerns in our industry. Does that change how I should handle the memory embeddings? I'm worried about the token cost and the embedding latency if the memory grows too large over the next few months of operation.

Christopher Brown Answered on 2024-09-16
Answered

You might want to check out MemGPT. It’s specifically designed to manage LLM memory as if it were an operating system, swapping data between RAM and disk.

Amanda Collins Commented on 2024-09-17
Commented

Christopher is right. MemGPT is a fantastic mention for this specific problem. It really helps when you have a massive amount of historical data that simply won't fit in a standard prompt.

Write a Comment

Your email address will not be published. Required fields are marked (*)

Join the LearnersEra Community

Ask questions, share knowledge and learn from professionals across technology, project management and certification topics.

Change Country and Nearest City

Select your country and nearest city to see courses available in your region.