cd /news/artificial-intelligence/your-ai-agent-has-a-memory-but-it-s-… Β· home β€Ί topics β€Ί artificial-intelligence β€Ί article
[ARTICLE Β· art-122687] src=dev.to β†— pub= topic=artificial-intelligence verified=true sentiment=Β· neutral

Your AI Agent Has a Memory. But It's Not Chat History

Rijul, a developer building LiveReview, an AI code review tool, explains the distinction between chat history and agent memory in AI systems. He clarifies that chat history is conversation-scoped, while agent memory preserves useful information across conversations, enabling agents to recall user preferences and project details in new sessions.

read6 min views3 publishedSep 7, 2026

Hello, I'm Rijul, and I'm building LiveReview β€” a blast-radius aware AI code review built for your business-critical systems. Star us to help devs discover the project, give it a try, and share your feedback to help improve the product.

When we think about memory as humans, the first things that come to mind are usually past conversations, past events, experiences, and things we have learned.

So it is easy to assume that when an AI agent "remembers" something, it simply looks back through an array of previous chat messages.

But there is more to it than that.

To understand how agents remember things, we need to understand two concepts that are often used interchangeably:

Chat history and agent memory.

Let's start with chat history.

Suppose you start a conversation with an agent:

You: I'm building a fitness tracking app.

Agent: Nice. What stack are you using?

You: React and FastAPI.

Agent: Got it. What database?

You: PostgreSQL.

Now, in this conversation, I can ask again which database I'm using.

The agent can infer from the conversation that the database is PostgreSQL.

So basically:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚       Chat History          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ User: I'm building...       β”‚
β”‚ Agent: Nice...              β”‚
β”‚ User: React and FastAPI     β”‚
β”‚ Agent: What database?       β”‚
β”‚ User: PostgreSQL            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              ↓
        LLM sees context

Now, if you start a new conversation and ask a question like:

You: What's a good database for my app?

If the new conversation only has its own history:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚    New Chat History         β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ User: What's a good         β”‚
β”‚ database for my app?        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

The agent doesn't automatically know:

React
FastAPI
PostgreSQL
fitness tracking app

Those belonged to the previous conversation.

This is where memory comes in.

So far, what we saw is that specific information, like the database we use, is scoped to the current conversation and doesn't necessarily go beyond it.

But agent memory allows the agent to preserve useful information beyond the current conversation.

For example, the agent could store:

User prefers PostgreSQL.
User is building a fitness tracking app.
User uses React + FastAPI.

Now, when we start a new conversation, the agent can retrieve these memories and use them as additional context.

Conceptually:

                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                 β”‚  New message  β”‚
                 β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                         ↓
                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚ Memory retrievalβ”‚
                β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         ↓
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚ Relevant memories   β”‚
              β”‚                     β”‚
              β”‚ React               β”‚
              β”‚ FastAPI             β”‚
              β”‚ PostgreSQL          β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         ↓
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚   LLM   β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

The important thing to understand is that memory is not the same thing as chat history.

Chat history contains the messages from a conversation.

Memory contains information that the agent has decided is useful to preserve and potentially use later.

In a real agent, these two usually work together.

Imagine you start a new conversation:

You: I want to add authentication to my app.

The current chat history might only contain:

You: I want to add authentication to my app.

But the memory system might retrieve:

User is building a fitness tracking app.
User uses React + FastAPI.
User prefers PostgreSQL.

The agent can then combine both pieces of information:

             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
             β”‚  Chat history   β”‚
             β”‚                 β”‚
             β”‚ Current         β”‚
             β”‚ conversation    β”‚
             β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β”‚
                      β”‚
             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”
             β”‚     Memory      β”‚
             β”‚                 β”‚
             β”‚ Previous useful β”‚
             β”‚ information     β”‚
             β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β”‚
                      β–Ό
                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚    LLM    β”‚
                β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜
                      β”‚
                      β–Ό
                   Response

This gives the LLM more useful context than either source could provide on its own.

The chat history tells the agent:

What are we talking about right now?

Memory tells it:

What do I already know that might be useful here?

This is where things get a little more interesting.

An agent doesn't necessarily save every single message as a memory.

For example:

You: My name is Alex.

You: I'm building an e-commerce application.

You: I'm using Django and React.

You: I had pizza for lunch today.

It probably doesn't make sense to permanently remember:

Alex had pizza for lunch.

But these could be useful:

User's name is Alex.
User is building an e-commerce application.
User uses Django and React.

So a memory system can take information from the conversation, identify what is useful, and store it separately.

             Chat history
                  β”‚
                  β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚ Memory extraction β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β”‚
                  β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚ Useful informationβ”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β”‚
                  β–Ό
          Persistent memory

Later, when another conversation starts, the system can retrieve the relevant memories.

Agent memory needs some kind of persistent storage.

It could be stored in:

PostgreSQL
Redis
MongoDB
Vector databases

or even a combination of these.

For example, a simple memory table could look like:

user_id    memory
-------    ----------------------------------
123        User prefers PostgreSQL
123        User uses React and FastAPI
123        User is building a fitness app

For more advanced systems, memories can also be converted into embeddings and stored in a vector database.

This allows the agent to retrieve memories based on semantic similarity.

For example, if the user later asks:

What's a good database for my project?

the system can search its memories and find:

User prefers PostgreSQL.
User is building a fitness tracking app.

Those memories can then be added to the context given to the LLM.

So a vector database is not itself "the memory".

It is simply one possible technology used to store and retrieve memories.

At this point, you can think of an agent as having three different sources of context:

                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚     LLM     β”‚
                    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
                     Context
                           β”‚
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚                β”‚                β”‚
          β–Ό                β–Ό                β–Ό
    Chat history        Memory             RAG
          β”‚                β”‚                β”‚
          β–Ό                β–Ό                β–Ό
   Current context   User-specific     External
                     information       knowledge

Chat history tells the agent what is happening in the current conversation.

Memory allows the agent to carry useful information across conversations.

RAG allows the agent to retrieve external information that it doesn't already know.

And ultimately, all three have the same purpose:

Give the LLM the right context at the right time.

That's what makes an agent feel like it can remember things instead of treating every conversation as if it were starting from zero.

Your team's attention is limited, and the deluge of AI-generated code is making it harder to keep production reliable and secure without slowing you down.

I'm building LiveReview, a blast-radius aware AI code review built for your business-critical systems.

Instead of presenting every diff with equal emphasis, LiveReview scores each change by blast radius β€” how far its impact reaches through your call graph β€” so you can focus attention where it actually matters.

Spend code review effort where business risk is highest β€” not spread evenly across every diff.

⭐ Star it on GitHub:

LiveReview is an AI code reviewer that scores every hunk of a diff by blast radius: how far a change reaches through your call graph, how much persistent state it touches, and how well-tested it is. A 3-line change to a shared auth check can outrank a 300-line UI tweak. Your team's attention goes to the highest-risk code first, not spread evenly across every diff.

LiveReview's Blast Radius & Review Priority scoring, live in the diff viewer.

The exact math, not a black box Visualize blast radius at a glance Every factor that feeds the score

Here's the goal:

Click below to try LiveReview with your codebase:

── more in #artificial-intelligence 4 stories Β· sorted by recency
── more on @rijul 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/your-ai-agent-has-a-…] indexed:0 read:6min 2026-09-07 Β· β€”