# Memory system

Concept · [Building with AI](https://ecosystem.samcarlton.com/ai)

Also called: agent memory, long-term memory, persistent memory, memories, memory feature

A setup that tries to give an agent memory across [sessions](https://ecosystem.samcarlton.com/session) by saving notes to files or a [database](https://ecosystem.samcarlton.com/database) and loading them back when a new session starts. The model itself is [stateless](https://ecosystem.samcarlton.com/stateless), so any memory has to live outside it.

**For example:** A [chatbot](https://ecosystem.samcarlton.com/chatbot) product greets a returning customer by her [preferred](https://ecosystem.samcarlton.com/preferred-stock) name because a memory system saved it and adds it to each new [conversation](https://ecosystem.samcarlton.com/session).

## Connects to (8)

- [Stateless](https://ecosystem.samcarlton.com/stateless): Describes something that keeps nothing between uses.
- [Stateful](https://ecosystem.samcarlton.com/stateful): Describes something that carries information forward from one moment to the next.
- [Session](https://ecosystem.samcarlton.com/session): One stretch of work with an AI agent, from a blank start until it is cleared, closed or compacted.
- [AGENTS.md](https://ecosystem.samcarlton.com/agents-md): A plain text file in a project that many coding agents read automatically at the start of every session.
- [Filesystem](https://ecosystem.samcarlton.com/filesystem): The files and folders on a computer.
- [Handoff artifact](https://ecosystem.samcarlton.com/handoff-artifact): The written document that carries a handoff, produced by one session for another to read.
- [Database](https://ecosystem.samcarlton.com/database): Organized storage for your app's information, such as users, orders and messages, so it can be saved and looked up later.
- [Secondary source](https://ecosystem.samcarlton.com/secondary-source): A description of the original material rather than the material itself, such as a summary, a README or a compaction note.

Map view: https://ecosystem.samcarlton.com/memory-system
