All resources

GoodMem · TCO Brief

The Total Cost of Agent Memory

What a 33× storage footprint costs, what a 28% token reduction returns, and a calculator to run both against your own workload

PAIR Systems engineering ·

Token cost per conversation
$2.23 → $1.05
benchmark median, memory off → on, at list prices
To store one document's full footprint
13¢ / year
an 80-page, 1.5 MB PDF stores as 48 MB (33×)
Token savings to infrastructure cost
9:1
worked example, conservative −28% · ~6-week payback

A 1.5 MB PDF ingested into GoodMem occupies 48 MB on disk. The same memory layer, in a controlled benchmark, cut a production agent's token consumption 28%. One number is a cost, the other a saving. How they net out is a matter of prices, and the prices are public. This brief works through them: what GoodMem writes to disk and why, what that disk costs, what the saved tokens are worth. At August 2026 list prices, the savings outrun the added infrastructure by about nine to one. A calculator at the end applies the same arithmetic to your workload.

What GoodMem writes to disk

Ingesting a document produces five kinds of stored data, all of it in PostgreSQL. There is no separate object store; the reasons are covered in Built Like Enterprise Infrastructure. For an 80-page, 1.5 MB PDF — NIST SP 800-63B, a representative text-dense enterprise document — ingested at default settings:

Stored components and approximate sizes for a 1 MB, 20-page PDF
ComponentWhat it isApprox. sizeShare
Original documentThe ingested bytes, stored verbatim1.5 MB3%
Chunk text + metadataExtracted text in 512-character chunks, with indexes1.0 MB2%
Embeddings + vector indexOne 1,536-dimension float32 vector per chunk, plus the HNSW working copy7.0 MB14%
Page imagesOne 200-DPI render per page, for visual grounding38.9 MB80%

Total 48.3 MB, or 33× the source document. Measured against the published server image; sizes are whole-schema growth per ingestion — heap, TOAST, and indexes. See the appendix.

Two rows explain nearly all of the amplification. Page images are 80% of the footprint: GoodMem renders every page at 200 DPI and keeps the image, so an answer can be grounded in what the page looked like — the tables, stamps, figures, and layout that text extraction discards. That capability is the subject of Garbage In, Garbage Out; the footprint is what it costs to keep. A letter page of text renders to 350–470 KB of PNG regardless of how few bytes produced it, and a megabyte of text PDF is 40 to 55 pages. The text documents in the appendix amplified 23× to 33×; the heavy scan, at more than a megabyte per page, 8×. Deployments that don't need visual grounding disable page images per ingestion, and text documents drop to about 6×.

Most of what remains is embeddings. Each 512-character chunk carries a 1,536-dimension float32 vector, and the index keeps a working copy — 17 KB per chunk measured, about five times the source document for dense text.

What the footprint costs

Managed PostgreSQL SSD lists at about $0.115 per gigabyte-month, twice that with multi-AZ replication. Object storage runs $0.023. A self-hosted drive costs a cent or two per gigabyte, paid once. At the most expensive of these tiers, the 48 MB footprint of the NIST document above comes to about a penny a month. A 50 GB corpus of documents like it, grown to 1.5 TB inside GoodMem, costs $345 a month to store — about $4,100 a year.

Documents are the fixed part of the store; memories are the growing part. GoodMem distills lessons from conversations — in the benchmark, the guidance the agent retrieved was built from prior conversations, not from the documents — and stores each lesson as text with its embeddings, like any other content. A lesson is small against the conversation that produced it: the median benchmark conversation runs over a megabyte of text, a distilled lesson a kilobyte or two, and many conversations write nothing. Modeled at 25 KB stored per conversation, the worked example's 240,000 annual conversations grow the store by about 6 GB in a year — $17 of storage. The calculator carries the term.

What a megabyte costs in tokens

Frontier models list at $5 per million input tokens and $25 per million output. A million tokens is roughly 4 MB of text, so a megabyte pushed into a model costs about $1.25 — and it is pushed repeatedly, because LLM APIs are stateless and an agent retransmits its accumulated context on every call. Stored on multi-AZ managed SSD, the same megabyte costs a quarter of a cent per year. Per megabyte, one pass through a model costs five to ten thousand times what a month on disk costs, depending on the storage tier. A context layer is a bet on that ratio.

What the memory layer saves

Memory That Pays for Itself measured the other side of the ledger on a production enterprise BI agent, with memory as the only variable. Aggregate token consumption fell 28% across 17 scenarios (95% CI 2–47%). The median query dropped from 318K tokens to 150K. Answer quality did not change. At the prices above, the median conversation costs $2.23 without memory and $1.05 with it. The savings concentrated where the money goes: on the heavy, retrieval-intensive queries.

A worked example

Assume a mid-size deployment: 20,000 agent conversations a month at the benchmark's median of 318K tokens each, each writing an average of 25 KB of distilled memory; a 50 GB corpus of text documents with page images on, so 1.5 TB stored at the measured 30×; multi-AZ managed storage; and $1,000 a month of compute charged entirely to the context layer — the database instance, the GoodMem service, and embedding inference.

Annual costs and savings for the worked example
Line itemAnnual
Token spend, memory off (240,000 conversations)$535,000
Token savings at −28% (aggregate, conservative)$150,000
Context-layer storage (1.5 TB, multi-AZ managed SSD)$4,100
Memory distilled from conversations (6 GB by year-end)$17
Context-layer compute allowance$12,000
Net annual savings~$133,000

The conservative line uses the aggregate −28%. If traffic resembles the benchmark's median query, savings roughly double. The interval is wide because the benchmark is pilot-scale: at its floor of −2%, savings would not cover the infrastructure; at its ceiling of −47%, the ratio approaches 16:1. At the point estimate it is about 9:1, and six weeks of savings pay the year's infrastructure bill.

Run your own numbers

The model above is five multiplications. The calculator applies them to your workload; every input is editable, including the prices.

Estimate your own numbers

Workload
LLM token prices
$/M tokens
$/M tokens
Context-layer infrastructure
$/GB-mo
$/mo

Annual impact

Net annual savings

$133,431

≈ 9.3:1 savings to infrastructure

Annual token spend, memory off

$534,240

$2.23 per conversation

Annual token savings

$149,587

at −28%

Annual context-layer infrastructure

$16,157

1,500 GB documents + 6.0 GB year-one memories + compute

An estimate, not a quote: arithmetic on your inputs at the prices you enter, assuming a 90/10 input/output token split, the full compute allowance charged to the context layer, and the year-end memory store charged for the full year.

Against a traditional RAG pipeline

A conventional RAG pipeline already runs embedding inference, a vector index, a chunk store, and ingestion workers. GoodMem runs the same components in one PostgreSQL database:

Component-by-component comparison of a traditional RAG pipeline and GoodMem
ComponentTraditional RAG pipelineGoodMem
Embedding inferenceRequiredRequired — same class of compute
Vector indexDedicated vector database, often separately billedpgvector, inside the same PostgreSQL
Chunk / document storeDatabase or object storeSame PostgreSQL
Ingestion and parsing workersRequiredRequired — comparable
Page-image captureTypically absentAdditive; optional per ingestion

The structural addition is the page-image term, optional and priced above. Deployments that retire a separately billed vector-database service often come out ahead on fixed infrastructure; the worked example takes no credit for that.

Assumptions and limitations

  • Prices are published list prices as of August 2026: $5 / $25 per million input / output tokens; managed SSD at $0.115–0.23 per GB-month; object storage at $0.023. Token arithmetic assumes a 90/10 input/output split.
  • The savings figures come from one controlled benchmark on one production workload, at pilot scale. The aggregate interval is wide (2–47%), and savings were concentrated on retrieval-heavy queries; a workload of trivial lookups will save less.
  • The footprint multiplier depends on the corpus. A megabyte of text PDF is 40 to 55 pages, and each page becomes a 350–470 KB image, so text documents amplify most: 23–33× measured, against 8× for heavy scans and about 6× for text with page images disabled.
  • Memory accumulation is modeled, not measured: 25 KB stored per conversation on average — distilled text plus its embeddings, across conversations that write nothing — with the year-end store charged for the full year. How much memory a conversation yields varies widely by system and workload; the calculator exposes it as a dial, including zero.
  • Per-token prices have fallen steadily and may keep falling. That shrinks the spend and the savings in proportion; the ratio between savings and infrastructure cost does not move. So far, volume growth has outrun the price declines.

Appendix: how the footprint was measured

The footprint numbers in this brief were measured on August 1, 2026, against the published server image (ghcr.io/pair-systems-inc/goodmem/server:latest) on a clean PostgreSQL 17 instance with pgvector. Defaults throughout: recursive chunking at 512 characters with 64 overlap, one dense embedder, page images on. The embedder was a synthetic endpoint returning 768-dimension vectors — GoodMem pads every embedding to a fixed 1,536-dimension float32 column stored uncompressed, so vector storage is identical for any model. Footprint is the growth of every table in the schema — heap, TOAST, and indexes — captured before and after each ingestion, with a checkpoint between.

Measured storage amplification for each ingested test document
DocumentSourcePagesStoredMultiple
NIST SP 800-63B (text-dense standard)1.5 MB8048.3 MB33×
Bitcoin whitepaper (text paper)184 KB94.3 MB24×
Two-page product whitepaper98 KB21.5 MB15×
Twelve-slide widescreen deck (image-only)810 KB1217.3 MB21×
Twelve-page scan analog (photographic, letter)17.0 MB12140 MB

The last two documents are synthetic, built to bracket the density range: a widescreen deck of line art and a letter-size scan analog of photographic content. Both are image-only; a stock install has no OCR configured, so text extraction fails cleanly and their totals carry no chunk or embedding term — page images store regardless. For the text documents, page images ran 355 to 467 KB per letter page and embedding storage 17 KB per chunk, index included. The 13.3-inch-wide deck pages rendered to 1.3 MB apiece; page area is as expensive as page count.

Why PAIR Systems

GoodMem is built by PAIR Systems, which develops the information-retrieval layer for enterprise AI — bringing techniques once limited to specialized search teams into any product as self-hostable software. Its founder helped pioneer practical zero-shot neural retrieval at Google and productized enterprise retrieval at Vectara. For the heaviest token spenders, GoodMem extends into model distillation and self-tuning that compound the gains shown here.

Sources. Token reductions: "Memory That Pays for Itself" (PAIR Systems, June 2026) — a controlled A/B benchmark on a production enterprise BI agent. Storage anatomy: measured August 1, 2026, by ingesting the appendix documents into the published GoodMem server image on a clean instance and sizing every table before and after. Prices: published cloud and model list prices as of August 2026; they change, and the calculator accepts your own. © 2026 PAIR Systems, Inc.

Want us to follow up?

This report is free to read and share — no sign-up, no wall. If you’d like to discuss a benchmark on your workload, deployment, pricing, or a security review, leave a few details and our team will contact you.

Loading secure verification…

Prefer email? [email protected]

We’ll use these details only to contact you about GoodMem. No newsletter, no lists. See our Privacy Policy.