Skip to content

BuildNot yet confirmed elsewhere1 publisher2 min readPublished

Agent memory under a million rows: a timestamp column beats top-k

A dev.to writeup drops vector stores for a SQLite table with tag and timestamp columns. Its own numbers put the practical ceiling at a million rows, not a hundred million.

The Engineer · Build desk

How we use AISend a correction

Illustration accompanying Agent memory under a million rows: a timestamp column beats top-k
Generated illustration

What happened

  • A dev.to writeup argues that below hundred-million-vector scale, a vector database for agent memory is mostly sync glue, ops overhead and unpredictable recall.
  • Its replacement is a SQLite table of text, timestamp, tag and embedding blob, with recall done by a WHERE clause on tag and time.
  • The author reports brute-force numpy similarity over embeddings held in SQLite running at 5 to 20 ms per query on tables under 100k items.
  • The same post concedes SQL loses past a million rows or under multi-writer concurrency, absent a move to faiss or a quantised index.
  • The envelope it claims to cover is agent memory under 4k tokens, or fewer than 50 documents recalled per turn.

Why it matters

  • contradiction The two ceilings in the same argument are 100x apart, so the number to size a build against is a million rows, and the hundred-million headline is doing rhetorical work rather than engineering work.
  • constraint The multi-writer half of the author's own fallback trigger carries no row count, so a second agent writing the same store can force the migration while the table is still small enough to scan in...
  • capability Scoped recall in one query turns incident review into a lookup: you can name the agent, the tier and the time window and get exactly what it held, which is not something a top-k call promises.
  • cost The overhead being avoided is on-call work, paid by whoever maintains the sync path and debugs recall that shifts under them, in return for scale most agent deployments never reach.

A hundred thousand rows of 384-dimension float32 embeddings, the size the post's own example generates [3], is 153.6 MB of vectors that a brute-force scan has to read on every query [9]. The quoted 5 to 20 milliseconds per query [14] therefore implies read bandwidth somewhere between 7.7 and 31 GB/s [10]. The slow end of that is an unremarkable single-threaded numpy pass over an in-memory buffer. The fast end is not, unless the table sits well below the stated ceiling or the scan is spread across cores. The post ships working code but no hardware, dataset or timing method behind the number [8], so treat it as an order of magnitude rather than a result: a few thousand memories are free, a hundred thousand cost real milliseconds. Even the slow end stays inside a network round trip, which is the author's basis for saying networked vector stores rarely win on individual queries [c7b].

Latency is not the strongest part of the case. The WHERE clause is. A predicate on tag and timestamp returns every row that satisfies both and nothing else, one row out of three in the worked example [2], with no approximation step and no hybrid postfilter to reason about [6]. The equivalent against a vector store is top-k with filtering bolted on before or after the ANN lookup, or a query-and-filter loop you maintain yourself [13], and what comes back depends on k and on how the index handles the predicate. According to the author, that recall also moves when embeddings drift or the embedding model is upgraded [17]. A timestamp comparison does not move. When an agent misbehaves, the gap between those two properties is the gap between reconstructing the context it had and estimating it.

What the SQL route actually charges you is a schema decision taken at insert time. The author's model of agent memory has a recent cache, a working or episodic slice, and a long-term archive rather than one flat event log [7], which in the proposed table becomes a `level` column on `memory_event` alongside `agent_id`, `tag` and `embedding` [5]. Something has to classify each memory as it is written, and the compound index on `(agent_id, level, timestamp)` [5] only earns its keep if queries name all three. Determinism has a price and that is where it is paid: the shape of recall is fixed in advance, in code you can read, instead of by tuning k until the answers look reasonable. The author is explicit that this trade only applies to layered episodic memory, and that pure semantic retrieval is what vector stores are for [4].

What to watch

  • A published benchmark harness with hardware and dataset behind the 5 to 20 ms claim, which would settle whether the fast end of the range is reachable at 100k rows.
  • Whether SQLite vector extensions or Postgres pgvector close the gap the post concedes at a million rows, removing the faiss migration it treats as the fallback.
  • Multi-agent deployments hitting the write-concurrency limit early and reporting where the single-writer design actually breaks.

Clarity's read

What the record supports and how the coverage leans. The claims behind it follow.

Reality

Evidence24
Adoption
Insufficient
Hype gap+42
Incentives
Insufficient
Confidence33
Why these scores

Claim ledger

Ranked by verification strength, evidence, and original report placement.

  1. [1]

    The post claims classic SQL wins where you need precise, scoped recall, such as what facts are in recent working memory for topic X since 10 minutes ago, in a single query.

    ReportedSupportedView cited source
  2. [2]

    The worked example creates a SQLite table memory(id, text, ts REAL, tag, embedding BLOB), inserts three rows, and a SELECT with WHERE tag = 'alpha' AND ts > now - 120 returns only 'Fix bug in alpha repo'.

    ReportedSupportedView cited source
  3. [3]

    The post's example embedding function returns 384-dimension float32 vectors, stored as BLOBs via tobytes().

    ReportedSupportedView cited source

Sources

1 independent publisher whose own reporting we read for this story.

  1. dev.to

    1 article · August 23, 2026

    Everyone's Trying Vectors and Graphs for AI Memory. We Went Back to SQL.

Share your take

Let Clarity write the post for you.

Signed-in readers get a short post drafted on this story in the register they choose — narrative, analytical, or a direct position — editable to the last word before it goes anywhere. The share buttons at the top of this story work without an account.

Topics and entities

Follow any of these and your For You feed starts watching them — no settings page required.

Topics

Loading related stories