AWS Builder Center
Stop Adding a Vector Database to Every Agent — Memory Is a Loop, Not a Lookup

Stop Adding a Vector Database to Every Agent — Memory Is a Loop, Not a Lookup

The reflex is universal: agent needs memory, spin up a vector store. For a large class of agent workloads that is the wrong default — slower to build, expensive while idle, and passive where the problem demands active processing.

Cloud Architect
Somewhere along the way, 'add memory' became a synonym for 'add embeddings.' But look at what agent memory is actually asked to do — remember what happened, connect it to what came before, and stay current — and the vector store answers only a fraction of it. The rest needs something a similarity index cannot provide: a process that runs when nobody is asking.

Lookup and loop are different machines

A vector store is a lookup: content is embedded once on arrival, sits unchanged, and waits to be found by similarity. Nothing ever reads it again except a query. A memory loop is different in kind, not degree: it captures information as structured notes, then re-reads them on a schedule — linking notes that describe the same thing, resolving what changed, compressing episodes into conclusions. The lookup answers 'what did I store that resembles this question.' The loop answers 'what does everything I stored add up to' — and no retrieval, however good, produces that at query time.
Same ingredients, opposite behavior: the top path waits to be asked; the bottom path thinks between questions.


What a lookup structurally cannot do

What the memory layer costs per month before the first question arrives — the loop's serverless parts round to pocket change.

The cost argument would be secondary if the expensive option were the capable one — but for agent memory it is inverted. The priciest baseline buys a similarity index that never re-processes anything, while the near-free loop actively improves its own store 48 times a day. When vectors genuinely earn their keep — see below — S3 Vectors now delivers them at a tenth of the classic price, which removes the last excuse for defaulting to the heavyweight option.

The idle bill nobody models

The chart above makes the decision look financial, but the money is really a proxy for fit: each option on it is the cheapest way to do one specific job and an expensive way to do any other. The table below reframes the choice around the workload rather than the technology — and the first question to ask of any memory requirement is deceptively simple: does the value live in individual records, or in the relationships between them? A support-ticket search wants individual records back verbatim; an agent's memory of a customer wants the pattern across twenty interactions. The first is a lookup problem no matter how it is dressed up. The second cannot be solved by retrieval at any price point, because the pattern was never stored — it has to be produced.
Workload
Right default
Why
Personal or team agent memory
The loop (DynamoDB + scheduled Lambda)
Small corpus, high value per record, needs connection and freshness
Exact recall of rules and preferences
Key-value lookup (DynamoDB)
A rule retrieved 'approximately' is a rule not enforced
Similarity search over a huge corpus
Vector store — S3 Vectors first
This is what embeddings are actually for
Both of the above at once
Loop for memory + vectors for the corpus
Two different jobs; let each tool do its own
The second row is the one teams skip and regret. Rules and preferences — formatting conventions, approval thresholds, per-customer quirks — get tossed into the vector store alongside everything else, and then retrieval ranks them by similarity to the current question. A rule that does not resemble the question simply does not surface, and the agent breaks a convention it technically 'knows.' Exact things deserve exact retrieval: a key-value read is not a less sophisticated version of semantic search, it is a different contract — guaranteed recall for a known key — and mixing the two contracts in one store is how agents end up inconsistently obedient. The fourth row then follows naturally: real systems usually need two or three of these at once, and the mistake is not using multiple stores — it is using one store for jobs with incompatible contracts.

Choosing the right memory for the job

The implementation is almost embarrassingly small: notes land in DynamoDB with a consolidated flag, and a scheduled function reads the pending ones, asks a lightweight Bedrock model what connects them, and writes the conclusions back as first-class records the next query can cite.
# The consolidation pass — the part a vector store will never do
def consolidate(event, context):
pending = table.query(IndexName="pending")["Items"]
if not pending: return
insight = converse("nova-lite",
f"Link related notes, resolve conflicts (newest wins), "
f"and state any conclusion no single note contains: {pending}")
table.put_item(Item={"kind": "insight", **insight})
mark_consolidated(pending)


The loop, concretely

Staleness is the objection the lookup crowd raises first, and it deserves a real answer rather than a hand-wave. The loop stays current through three layered mechanisms, each covering a different way information goes bad. Raw notes carry a TTL: episodic records — what happened, when, from which source — age out automatically after a retention window, so the store gradually forgets what nobody re-confirms. Conclusions get re-derived: each consolidation pass reads new notes alongside existing insights, so a conclusion contradicted by fresh evidence is revised or superseded within one cycle rather than persisting indefinitely. And recall weighs recency: when two records conflict at question time, newer wins, and because every answer carries citations with capture dates, a stale answer is at least visibly stale.
What none of this catches is external drift — facts that changed in the world without any new note arriving. No memory system catches that, vector stores least of all: an embedding of last year's org chart is exactly as retrievable as this year's. The honest mitigation is the TTL, which is precisely a policy of forgetting the unconfirmed — something a lookup, which never deletes anything on purpose, does not even have a vocabulary for.

How the loop stays current

Fairness cuts both ways, so here are the loop's own failure modes — because it has real ones, and pretending otherwise is how architecture articles lose their readers' trust. The serious one is insight poisoning: consolidation is an inference pass, and inference passes can be wrong. A hallucinated connection written back as a first-class insight does not just sit there — the next cycle reads it as input, and a bad conclusion can compound. The defenses are provenance and reversibility: every insight stores the note IDs it was derived from, so a wrong conclusion can be traced to its sources and deleted with a cascade, and a periodic spot-check of recent insights against their cited notes catches drift while it is still shallow.
The second is scale. The consolidation pass reads pending notes in one context window, which is fine at tens of notes per cycle and breaks at thousands. The mitigations are the obvious ones — shorter cycles, batching by topic, hierarchical consolidation where batch summaries get their own summary pass — but there is a point, somewhere around corpora that stop fitting in anyone's head, where the workload has quietly become a search problem and the vector index earns its place. Which is the real conclusion of this section: the loop's failure modes are bounded and inspectable — a wrong insight has an author, sources, and a delete button. A lookup's failure mode is silence: it returns something plausible, forever, and never once tells you the world has moved on.

Where the loop itself goes wrong

For readers who want to build this: the whole design is two record kinds in one table, distinguished by a single attribute.
// An episodic note — written by capture, aged out by TTL
{ "pk": "note#2026-07-17T09:14:02Z",
"kind": "note",
"summary": "Customer X escalated the onboarding delay again",
"entities": ["Customer X", "onboarding"],
"source": "s3://inbox/call-2026-07-17.mp3",
"consolidated": false, "expires": 1760000000 }
// An insight — written by the loop, kept until superseded
{ "pk": "insight#2026-07-17T09:44:11Z",
"kind": "insight",
"conclusion": "Onboarding delays for Customer X recur after each release",
"derived_from": ["note#...02Z", "note#...5Z", "note#...8Z"],
"supersedes": "insight#2026-06-30T..."
}


The record, concretely

Everything the article promised is visible in those two records: provenance (derived_from), reversibility (delete the insight, its sources remain), freshness (expires on the note, supersedes on the insight), and citability (the pk is the citation). There is no schema version two waiting to happen — the design is small because the problem, at team scale, is small.

When you genuinely need vectors

None of this is an argument against embeddings — it is an argument about defaults. If users search tens of thousands of documents by meaning, if the corpus is the product, if recall over a massive collection is the requirement, a vector index is the right machine and S3 Vectors makes it affordable. The failure mode this article targets is narrower and more common: a team-sized agent whose entire memory would fit in a spreadsheet, sitting on top of $345-a-month infrastructure that re-reads nothing, connects nothing, and forgets nothing on purpose.

Closing thoughts

Memory is a verb disguised as a noun. Storage is the easy part — every option on the chart stores faithfully. What separates a memory from an archive is the loop that reads it back: linking, compressing, correcting, forgetting. Start with the loop, add vectors when scale demands them, and your agent will know more tomorrow than it does today — which is, in the end, the only definition of memory that matters.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article