What Self-Hosted AI Memory Actually Costs to Run
On this page, 12 sections
Embedding one million tokens with OpenAI’s text-embedding-3-small costs two cents. That is the published rate on developers.openai.com, read on 2 September 2026.

Two cents per million tokens is why “what does the vector database cost” is the wrong first question. Embeddings are not your bill.
In every self-hosted AI memory stack I have costed out from published rates, the money is in one of two places: the language model call that some systems make every time you save something, and the second service you have to run because your chosen project needs a graph database.
Here is the arithmetic, with every rate sourced and the assumptions stated, so you can substitute your own numbers.
What I am counting, and what I am not
What this is, and what it is not
This is arithmetic on published prices, not a measured invoice. I have not run any of these systems at 200,000 saves a month and I am not going to pretend I did.
Every rate below is quoted from a vendor page with the date I read it.
Every assumption about your workload is labelled as an assumption. Where a real number would need a benchmark nobody has published, I say so instead of inventing one.
The two variables that decide everything
- Items saved per month. A solo operator storing notes and chat transcripts is in the low thousands. An agent that saves every tool call is in the hundreds of thousands. If you are running agents against real systems the way I describe in running Claude Code against production WordPress, you are in the second group and you will get there faster than you expect.
- Average tokens per item. A note is a few hundred. A full Claude Code session transcript is tens of thousands.
I will work through two volumes: 2,000 saves a month at 800 tokens each, and 200,000 saves a month at the same size. Substitute yours.
Line one: the model that reads every save
This is the line that decides the bill, and it is set by which project you chose, not by how you deploy it.
Which projects call a model on save
mem0’s write path, per its README, is a single LLM call per add, with gpt-5-mini as the documented default. Cognee will not run without LLM_API_KEY set.
Graphiti defaults to OpenAI for both inference and embeddings, and ships SEMAPHORE_LIMIT=10 to keep you under provider rate limits.
LightRAG needs a model in its EXTRACT role. MemPalace’s default path uses local embeddings and its README states that no API key is required for the core benchmark path.
Published rates on developers.openai.com, read 2 September 2026, per 1M tokens:
| Model | Input | Output |
|---|---|---|
| text-embedding-3-small | $0.02 | n/a |
| text-embedding-3-large | $0.13 | n/a |
| gpt-5-nano | $0.05 | $0.40 |
| gpt-5-mini | $0.25 | $2.00 |
| gpt-5 | $1.25 | $10.00 |
At 2,000 saves a month, 800 tokens each, so 1.6M tokens ingested, and assuming extraction emits 200 output tokens per item:
- Embeddings only: 1.6M x $0.02/1M = $0.03
- Plus gpt-5-mini extraction: 1.6M x $0.25/1M = $0.40 input, 0.4M x $2.00/1M = $0.80 output, so $1.23 total
- Local embeddings, no model: $0.00
At that volume the whole argument is worth a dollar twenty a month. If this is you, stop optimising cost and choose on licence and data ownership instead.
At 200,000 saves a month
So 160M tokens ingested:
- Embeddings only: 160M x $0.02/1M = $3.20
- Plus gpt-5-mini extraction: $40.00 input, $80.00 output, so $123.20 total
- Local embeddings, no model: $0.00 variable, plus the RAM to hold the model
Embeddings are 2.6% of that $123.20. The extraction model is the other 97.4%. Switching your vector store to save money at this scale is optimising the wrong line by a factor of forty.

Line two: the read path, which nobody budgets for
The query-time model call
Ingest budgets miss this. Cognee’s README documents an environment flag, AUTO_FEEDBACK, and describes setting it to false as removing “the one LLM call cognee makes after each answered query to self-tune its memory”.
On by default. That is a per-query charge with no relationship to how much you ingested.
The same shape appears anywhere a system reranks with a model. MemPalace’s benchmark table lists an optional LLM rerank pass over the top 20 retrieved sessions that lifts recall from 96.6% to 99% or better.
That pass is a real cost and the project is explicit that it is optional, which is the right way to ship it: the default costs nothing and the upgrade is a choice you make with your eyes open.
Count reads separately from writes. For a system used by an agent, reads usually outnumber writes.
Line three: the box
The binding constraint on a memory server is RAM, not CPU. A local embedding model plus an embedded vector store is resident memory that never goes away.
DigitalOcean’s published Basic Droplet rates, read 2 September 2026:
| Memory | vCPU | SSD | Per month |
|---|---|---|---|
| 1 GiB | 1 | 25 GiB | $6.00 |
| 2 GiB | 1 | 50 GiB | $12.00 |
| 4 GiB | 2 | 80 GiB | $24.00 |
| 8 GiB | 4 | 160 GiB | $48.00 |
The step that costs you is the second service
It is not 1 GiB to 2 GiB. It is the step you take when your chosen project needs a second service. Graphiti’s documented requirement is a separate graph database:
Neo4j 5.26, or FalkorDB 1.1.2, or an Amazon Neptune cluster plus an OpenSearch Serverless collection for full-text search.
Neo4j on the same box is a second JVM-sized resident set. Neptune plus OpenSearch Serverless is not a $6 droplet in any configuration.
Cognee’s 1.0 release note makes exactly this argument in reverse: the traditional stack is a graph database for relationships, a vector database for embeddings, Redis for sessions and a relational database for metadata, and it collapses all four into one Postgres.
That is a cost decision presented as an architecture decision, and it is the right instinct whichever project you use.
Note the caveat in the same README though: the Postgres graph store is “a demo feature” and the production version is “available as a licenced product”.
Small lines people forget
Hetzner charges EUR 0.50 per month excluding VAT for an IPv4 primary IP, and nothing for IPv6 (docs.hetzner.com, article CL-B8510).
Qdrant Cloud’s free tier is a single node with 0.5 vCPU, 1 GB RAM and 4 GB disk, free forever (qdrant.tech/pricing, read 2 September 2026), which is enough to prototype on and not enough to run on.

Line four: disk, which is arithmetic you can do yourself
A vector is dimensions x 4 bytes at float32. Multiply by chunk count, then add index overhead, which varies by store and which I am not going to guess at.
# raw vector bytes, before any index structure
200000 chunks x 1536 dims x 4 bytes = 1.23 GB
200000 chunks x 384 dims x 4 bytes = 0.31 GB
Those two dimension counts are common sizes rather than a claim about any particular model. Read your own model card for its output dimension and put that in the formula.
A four-times difference in embedding dimension is a four-times difference in your vector footprint, and it is the one storage decision that actually moves the number.
Verbatim systems add the source text on top of that, which is cheap on disk and is what buys you the ability to re-index later.
Then there is the model itself.
MemPalace’s README puts the embedding model download at roughly 30 MB for all-MiniLM-L6-v2 and roughly 300 MB for embeddinggemma-300m, cached in the data volume so it is a one-off as long as the volume persists.
Trivial on disk. Not trivial the first time a container starts with no network, which the README warns about specifically because a slow first call reads as a hung container.
The line item nobody prices: changing your mind
Re-embedding is bounded. Losing the source is not.
Change your embedding model and you re-embed everything. That is a known, bounded, one-off cost: at 160M tokens it is $3.20 on text-embedding-3-small, or an afternoon of CPU if you run the model locally.
MemPalace documents the operation directly: switching to a server-side embedding endpoint requires mempalace repair rebuild-index, because a different embedder is a different vector space.
The unbounded version of this cost is what happens when you stored only what a model extracted. You cannot re-derive the source, because you never kept it.
Whatever a 2026 model considered a fact is what you have in 2029. That is a real cost with no invoice, and it is the strongest argument for verbatim storage that has nothing to do with money.
I go through the mechanism in mem0 vs MemPalace, and the wider set of choices in the comparison of AI memory tools for a second brain.

Self-hosted against managed, at real prices
Self-hosting is not automatically cheaper and the published numbers say so.
| Option | Price | What it covers |
|---|---|---|
| mem0 Hobby | Free | 10,000 add and 1,000 retrieval requests a month, 1 project |
| mem0 Starter | $19/mo | 50,000 add and 5,000 retrieval requests, 1 project |
| mem0 Pro | $249/mo | 500,000 add and 50,000 retrieval, unlimited projects, graph memory |
| Cognee Free | $0 | 1M tokens, 1 workspace |
| Cognee Standard | $2.50 per 1M tokens | Plus $5 per additional workspace |
| Self-host, LLM extraction | ~$123/mo at 160M tokens | Plus your droplet and your time |
| Self-host, local embeddings | $6 to $24/mo | Droplet only, no per-token cost |
Where the crossover sits
Prices from mem0.ai/pricing and cognee.ai/pricing, both read 2 September 2026. Note the crossover. At 2,000 saves a month, mem0’s free Hobby tier covers you and self-hosting saves you nothing but gives you your data.
At 200,000 saves a month you are past mem0’s $249 Pro tier limits, and Cognee Standard at $2.50 per million tokens would be roughly $400 for the same 160M tokens if their token counting maps to ingested tokens, which is an assumption I cannot verify from the pricing page.
The honest summary is that self-hosting wins on cost only at high volume, or when the data cannot leave your network at any price.
Below that, it wins on ownership, and you should say that out loud rather than dressing it up as savings.
What these numbers do not tell you
Three things I cannot give you, and would be making up if I did.
- Actual token counts per item. The 800-token average is my assumption for the worked example, not a measurement of your data. Count a hundred of your real items before you trust any of the totals above.
- Resident memory per project. Nobody has published a like-for-like memory profile of these projects on the same corpus and the same hardware. Until somebody does, size your box by testing, not by reading.
- Your time. An hour a month keeping a self-hosted stack alive costs more than mem0’s Starter tier at any professional rate. This is the line that makes self-hosting expensive, and it never appears in a comparison table, including mine. It is the same accounting problem as deciding who pays for recurring plugin subscriptions on client sites: the recurring number is visible, the labour around it is not, and only one of them gets budgeted.
Do this before you commit
Open your data, count a hundred items, get an average token length. Multiply by your monthly volume.
Multiply by $0.02 per million for embeddings and by $0.25 plus $2.00 per million for extraction if the project you are looking at calls a model on save.
If the answer is under five dollars, cost is not your deciding factor and you have been arguing about the wrong thing.
Pick on licence, on whether the source text survives, and on whether you can still read your own data when the project changes hands. The alternatives post sorts them on exactly those axes.
Watch this part instead
The same VPS arithmetic applies to anything else you self-host. I go through it here.
More on ai memory and mcp
- Cognee Alternatives: What You Are Actually Replacing
- mem0 vs MemPalace: The Benchmark Numbers Are Not Measuring the Same Thing
- MCP Server vs RAG: Which One You Actually Need
Resources
- OpenAI model and embedding prices: platform.openai.com/docs/pricing
- DigitalOcean Droplet pricing: digitalocean.com/pricing/droplets
- Hetzner Cloud server documentation, including the IPv4 charge: docs.hetzner.com/cloud/servers/overview
- Qdrant Cloud pricing and free tier limits: qdrant.tech/pricing
- mem0 pricing: mem0.ai/pricing
- Cognee pricing: cognee.ai/pricing
- Graphiti installation requirements, for the graph database line: github.com/getzep/graphiti
- MemPalace requirements and embedding model sizes: github.com/MemPalace/mempalace
