
I Stored Every Conversation. My AI Agent Still Didn't Have a Memory
What building persistent memory with Amazon Bedrock and CockroachDB taught me about what an agent should remember - and how it finds that information again.
Growth Portal started with a simple idea: one place to track personal goals, projects, and certification study, with an AI Coach to help along the way. I built it for the CockroachDB × AWS Build with Agentic Memory Hackathon, stepping into both CockroachDB and persistent agent memory for the first time.
But that quickly raised a more interesting question:
What good is a personal AI Coach if it forgets how you work every time you talk to it?
I told my AI Coach:
“I prefer 30 min study sessions for AWS.”
Later, I asked:
“How should I study for AWS?”
It recommended sticking to 30-minute focused study sessions.
That small response required more than saving a conversation. The application had to decide that my preference was worth remembering, avoid repeatedly storing the same idea, and retrieve it when it became relevant again.
I went into the project thinking mostly about where an agent's memory should be stored. Building it made me realize that the harder questions came before and after storage:
What deserves to be remembered? Have I already remembered the same thing? And can I find the right memory when it actually matters?
Those became my three biggest lessons.
1. Not everything deserves to be remembered
My first assumption was simple: if I stored the conversations, the AI Coach would have memory.
But conversation history and persistent memory aren't the same thing.
Compare:
“What should I study tonight?”
with:
“I prefer 30-minute study sessions.”
Both belong in the conversation history. But the second contains information that could remain useful weeks later.
So I separated storing conversations from extracting memories.
Growth Portal looks for durable information such as goals, preferences, interests, projects, habits, and useful context. The extraction logic is deliberately instructed not to turn every question, one-time request, or temporary intention into persistent memory.
That gave me my first takeaway:
Memory quality starts with deciding what is worth remembering.
An agent that stores everything doesn't necessarily remember better. It may simply have more noise to search through.
2. Remember the meaning, not just the sentence
Once I started storing durable memories, another problem appeared.
Suppose I say:
“I prefer short AWS study sessions.”
Later, I say:
“I like studying AWS in short focused sessions.”
The sentences aren't identical, but they may represent essentially the same preference.
An exact duplicate check alone won't catch that.
Growth Portal therefore checks a new memory in two stages. First, it looks for an exact match. If one exists, processing stops there - there's no need to generate another embedding.
If there isn't an exact match, Amazon Titan Text Embeddings V2 converts the memory into a normalized 1024-dimensional embedding. CockroachDB can then compare that vector with existing memories of the same type.
The flow is essentially:
New memory ↓Exact duplicate? ↓ NoCreate embedding ↓Compare with existing memories ↓Same meaning? ↙ ↘Yes NoSkip StoreFor this prototype, I used a vector-distance threshold of
0.7 when checking for semantic duplicates. I treat that as a prototype decision, not a universal value - a production system would need to evaluate an appropriate threshold against its own data.The number wasn't the interesting discovery for me. This was:
If memory represents meaning, sometimes you need to compare meaning rather than text.
That's when embeddings stopped feeling like an abstract AI concept and became a solution to a very practical problem.
3. A memory you can't recall isn't useful
Now Growth Portal could decide what was worth remembering and avoid blindly storing the same information repeatedly.
But there was still one missing piece.
A stored memory doesn't help the AI Coach unless the application can find it again when it matters.
When I later ask:
“How should I study for AWS?”
Growth Portal creates an embedding for the question and compares it with my stored memories in CockroachDB.
Conceptually:
"How should I study for AWS?" ↓ Query embedding ↓ Vector retrieval ↓"Prefers 30-minute AWS study sessions" ↓ AI Coach contextThe retrieved memories are included in the context supplied to the AI Coach, which uses Amazon Nova Lite through Amazon Bedrock to generate its response.
That's how the preference from the beginning of this article came back.
The model didn't magically remember something from an earlier interaction.
The application remembered it, retrieved it, and gave it back to the model when it mattered.
That gave me my biggest takeaway from the project:
Persistence answers “what did I know?” Retrieval answers “what matters now?”
But retrieval exposed another problem
My prototype also exposed an important limitation. Finding the closest memories doesn't necessarily mean they're relevant enough. Even an unrelated question has a nearest vector.
So a stronger implementation shouldn't only ask:
Which memories are closest?
It should also ask:
Are any of these memories relevant enough to use?
That's one of the first things I would evaluate as the memory system evolves.
The pattern I'd reuse
After building the complete flow, I can reduce it to a surprisingly small pattern:
Extract → Embed → Deduplicate → Store → Retrieve → Use
If I were adding persistent memory to another agent tomorrow, that's where I'd start.
Not with “Which vector database should I use?”
I'd start with:
What deserves to become memory?
How will I recognize that I already know something?
How will I decide when an old memory is relevant again?
Growth Portal uses Amazon Bedrock for embeddings and response generation, while CockroachDB stores the application's users, goals, tasks, conversations, and vector-backed memories.
But the technology choices weren't my biggest takeaway.
I started this project thinking persistent agent memory was primarily a question of where information should be stored.
I finished it thinking much more about selection, meaning, and retrieval.
Growth Portal is still a prototype. There are areas I want to take further, including authentication, better discussion summaries, integrations with external platforms, and stronger relevance filtering. But the memory experiment already changed how I think about building agentic applications.
A database can persist everything I give it.
The harder problem is deciding what deserves to survive and when it deserves to come back.
An agent doesn't need everything you've ever said. It needs the right piece of your past at the right moment.
See Growth Portal in action
Growth Portal was built using Amazon Bedrock, Amazon Titan Text Embeddings V2, Amazon Nova Lite, CockroachDB, and Python.
Want to see it working? I recorded a short demo of Growth Portal showing the complete flow, including how the AI Coach uses persistent context across interactions.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article