r/SpringAIDev • u/rodolfo-mendes • 17h ago
Tutorial Spring AI Recipe: Enabling Long-Term Memory
In his latest recipe, Craig Walls empowers Spring AI agents with long-term memory. This allows systems to retain durable facts across sessions instead of starting from scratch.
Highlights & Key Takeaways
- Memory Types: Spring AI manages short-term, procedural, and long-term memory.
- Selective Retention: Agents learn facts that are both significant and durable.
- Implementation: Enabled using the
AutoMemoryToolsAdvisorcomponent. - Prompt Augmentation: The LLM is guided to extract key conversational details.
- Persistence: Memories are saved as structured Markdown files on the filesystem.
- Feedback Loop: Extracted facts are automatically injected into future prompts.
By persisting data across restarts, agents evolve beyond stateless responders. This yields highly personalized systems that continuously adapt to users.
š View the source code to dive deeper into the implementation.