---
title: "What Self-Hosted AI Memory Actually Costs to Run"
url: https://adityaarsharma.com/self-hosted-ai-memory-cost/
date: 2026-09-16
modified: 2026-09-03
author: "Aditya Sharma"
description: "Four line items, priced from published rates with the date read. Embeddings are two cents a million tokens. The bill is somewhere else."
categories:
  - "AI"
  - "Automation"
image: https://adityaarsharma.com/wp-content/uploads/2026/09/7151609c-9371-4279-b3bd-b873cec9e6d6_2912x1632-1024x574.webp
word_count: 2026
---

# What Self-Hosted AI Memory Actually Costs to Run

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.

![Where the money in self-hosted AI memory goes.](https://adityaarsharma.com/wp-content/uploads/2026/09/7151609c-9371-4279-b3bd-b873cec9e6d6_2912x1632-scaled.png)
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.

On this page

- What JFIF actually is- Why Windows and Chrome keep producing them- The one minute fix: rename it- When a rename is not enough- Converting it with Grabio- What to do with a folder of them- The thing not to do- While you are at it- Questions people ask

## 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](https://adityaarsharma.com/running-claude-code-against-wordpress-the-complete-setup/), 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.

![Bar chart: 120 dollars of extraction against 3.20 dollars of embeddings on 160 million ingested tokens.](https://adityaarsharma.com/wp-content/uploads/2026/09/d6ee62ff-2159-4414-9f10-f6b5430dc7af_2912x1632-scaled.png)Built from the published rates and the worked example in this post, read 2 September 2026.

## 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.

![The Graphiti repository on GitHub, which documents a separate graph database as a requirement.](https://adityaarsharma.com/wp-content/uploads/2026/09/4a19f015-8eea-4dae-96ce-afe21e8a2168_2800x2000-scaled.png)github.com/getzep/graphiti, screenshot taken 3 September 2026. The graph database requirement is in this README.

## 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.

Newsletter

## Automating the boring half

I publish one researched piece a week on putting agents to work on real sites. What I built, what broke, and the commands to check it yourself.

Email address

Get it weekly

Free. One email a week. Unsubscribe in one click, and I do not send anything else.

## 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](https://adityaarsharma.com/mem0-vs-mempalace/), and the wider set of choices in [the comparison of AI memory tools for a second brain](https://adityaarsharma.com/ai-memory-tools-compared/).

![The Cognee repository on GitHub, whose README documents the LLM_API_KEY requirement and the Postgres graph store.](https://adityaarsharma.com/wp-content/uploads/2026/09/79ebaab0-2a8d-4545-a515-d6443b409aaf_2800x2000-scaled.png)github.com/topoteretes/cognee, screenshot taken 3 September 2026.

## 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](https://adityaarsharma.com/managing-wordpress-plugin-subscriptions-for-clients/): 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](https://adityaarsharma.com/cognee-alternatives/) 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.

https://www.youtube.com/watch?v=514j1YCF-Z8How to Self-Host Plausible on VPS with RunCloud

## More on ai memory and mcp

- [Cognee Alternatives: What You Are Actually Replacing](https://adityaarsharma.com/cognee-alternatives/)- [mem0 vs MemPalace: The Benchmark Numbers Are Not Measuring the Same Thing](https://adityaarsharma.com/mem0-vs-mempalace/)- [MCP Server vs RAG: Which One You Actually Need](https://adityaarsharma.com/mcp-server-vs-rag/)

## Resources

- OpenAI model and embedding prices: [platform.openai.com/docs/pricing](https://platform.openai.com/docs/pricing)- DigitalOcean Droplet pricing: [digitalocean.com/pricing/droplets](https://www.digitalocean.com/pricing/droplets)- Hetzner Cloud server documentation, including the IPv4 charge: [docs.hetzner.com/cloud/servers/overview](https://docs.hetzner.com/cloud/servers/overview/)- Qdrant Cloud pricing and free tier limits: [qdrant.tech/pricing](https://qdrant.tech/pricing/)- mem0 pricing: [mem0.ai/pricing](https://mem0.ai/pricing)- Cognee pricing: [cognee.ai/pricing](https://www.cognee.ai/pricing)- Graphiti installation requirements, for the graph database line: [github.com/getzep/graphiti](https://github.com/getzep/graphiti)- MemPalace requirements and embedding model sizes: [github.com/MemPalace/mempalace](https://github.com/MemPalace/mempalace)