MemQL vs. vector memory for AI agents
There are two common ways to give an AI agent memory. The popular one is vector memory — embed everything and retrieve by similarity (the Mem0 / vector-store approach). The other is what MemQL does: an append-only, time-series graphthat treats memory and an agent’s working state as the same queryable data. They are good at different things.
| Dimension | Vector memory | MemQL |
|---|---|---|
| Storage model | Embeddings in a vector index; memories are points in similarity space. | Append-only, time-series graph rows on PostgreSQL + TimescaleDB; memories are versioned records with relationships. |
| Time-awareness | Usually none natively — recency is bolted on as metadata filters. | First-class. Every row is keyed by createdAt; temporal queries and time-decay are built in. |
| Retrieval | Pure semantic similarity (nearest-neighbour) over embeddings. | recall() blends recency × relevance in one query (pgvector similarity + exponential time-decay), plus exact DSL queries. |
| Relationships | Flat — memories don't natively reference each other. | Graph — rows relate (a step belongs to a plan, an observation to a step), traversable and typed. |
| Working state | Out of scope — you store an agent's task state elsewhere. | The harness spine — plan, step, observation — is first-class data, so memory and working state share one substrate. |
| History & provenance | Typically overwrite/replace; little built-in history. | Append-only: nothing is edited in place, so every version and who wrote it is preserved and inspectable. |
| Queryability | Vector search + metadata filters. | A full DSL — queries, mutations, automations, policies — over the same memory. |
When to use which
Reach for vector memorywhen the job is semantic search over a pile of documents or past messages — “find me things like this” — and you don’t need time, relationships, or durable task state. It’s simple and great at that one thing.
Reach for MemQL when an agent needs to behavelike it has memory: resume tasks, remember what it tried, reason over time (“what changed since yesterday?”), follow relationships, and let you inspect and replay exactly what it did. MemQL still does semantic retrieval (it uses embeddings under the hood) — it just isn’t only that. It’s the memory and state layer for the whole agent harness.
- Memory & the agent harness — recall(), consolidation, and the plan/step/observation model.
- Read the docs — the data model, the DSL, and the rest.