This integration demonstrates how to use Mem0 with AWS Bedrock and Amazon OpenSearch Service (AOSS) to enable persistent, semantic memory in intelligent agents.
Use Mem0 with your Bedrock-powered LLM and OpenSearch storage backend:
Copy
Ask AI
# Store conversational contextmessages = [ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"}, {"role": "assistant", "content": "How about a thriller?"}, {"role": "user", "content": "I prefer sci-fi."}, {"role": "assistant", "content": "Noted! I'll suggest sci-fi movies next time."}]m.add(messages, user_id="alice", metadata={"category": "movie_recommendations"})# Search for memoryrelevant = m.search("What kind of movies does Alice like?", user_id="alice")# Retrieve all user memoriesall_memories = m.get_all(user_id="alice")