<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/chdb-durable-layer-for-agent-memory-pgqovni4a" -->

---
title: chDB Durable Layer for agent memory | daily.dev
description: ClickHouse introduces the chDB Durable Layer, a durability extension for chDB (an embedded SQL OLAP engine) that lets agent memory stay fast to query locally...
canonical: https://daily.dev/posts/chdb-durable-layer-for-agent-memory-pgqovni4a
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: chDB Durable Layer for agent memory | daily.dev
og:description: ClickHouse introduces the chDB Durable Layer, a durability extension for chDB (an embedded SQL OLAP engine) that lets agent memory stay fast to query locally...
og:url: https://daily.dev/posts/chdb-durable-layer-for-agent-memory-pgqovni4a
og:image: https://api.daily.dev/og/posts/pGQovni4A.png
og:image:alt: chDB Durable Layer for agent memory
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# chDB Durable Layer for agent memory

**[ClickHouse](https://daily.dev/sources/clickhouse)** · 16 min read · 1 upvotes · 0 comments

## Summary

ClickHouse introduces the chDB Durable Layer, a durability extension for chDB (an embedded SQL OLAP engine) that lets agent memory stay fast to query locally while its analytical state can be recovered across laptops, CI jobs, and short-lived sandboxes. The design keeps recall as a local, in-process query while making the authoritative copy live in object storage (S3, GCS, or Azure Blob) rather than requiring a database server. Key primitives include flush() for durability boundaries, checkpoint() to compact the write-ahead log, and a lease mechanism using head.json plus conditional writes for single-writer safety. The post compares this approach against SQLite checkpointers, SQLite+Litestream, server databases like Postgres/pgvector, and Cloudflare Durable Objects, arguing each leaves a gap the Durable Layer fills. It walks through best practices for modeling agent memory as append-only tables, compressing evidence, and flushing/checkpointing strategy, and highlights real projects (ClickMem, Maple Local, ReplayHouse, vcfclick) using the same pattern. chDB 4.4 ships the Python implementation with S3/GCS/Azure extras, with parallel support in Node, Go, and Rust bindings built on a shared Durable V1 contract in chdb-core 26.7.3.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://clickhouse.com/blog/chdb-durable-layer-for-agent-memory>

## Questions this post answers

### What is the chDB Durable Layer and how does it make agent memory recoverable across machines?

It is a durability extension shipped in chDB 4.4 that keeps a local MergeTree working copy for fast in-process queries while writing an authoritative copy to object storage (S3, GCS, or Azure Blob) via explicit flush() and checkpoint() calls. A head.json file with conditional writes enforces a single-writer lease, so the same named object can be reopened and recovered on another laptop, in CI, or inside a short-lived sandbox.

_Developers designing recoverable agent memory can track releases like this chDB durability layer on daily.dev._

### How much does append-only agent memory in JSONL format compress when loaded into ClickHouse MergeTree?

In a small local experiment, a 1.45 GB Claude Code transcript sample with 213,721 rows compressed to 521 MiB using ZSTD(3), or 991 MiB with LZ4, after loading into MergeTree. Text compressed well, but screenshots, only 0.8% of rows, made up about two-thirds of the bytes, which is why binary blobs are recommended to live outside the table with only references stored in typed columns.

_Teams tuning storage costs for agent transcripts can follow compression benchmarks like this one on daily.dev._

### How much faster are local queries compared to remote database queries for agent memory recall?

Local queries were measured to be 58 times faster than remote queries in a local-vs-remote benchmark, reinforcing why keeping the hot recall path embedded in-process, rather than routing it through a network round trip to a server database, matters for agent memory systems that need low-latency recall.

_Engineers weighing local versus remote database architectures for agent workloads can compare benchmarks like this on daily.dev._

## Similar posts on daily.dev

- [chDB as the Agent's Local Data Engine](https://daily.dev/posts/chdb-as-the-agent-s-local-data-engine-h45718yyv) · ClickHouse · 1 upvotes · 0 comments
- [Under the hood, off the hot path: how D1 scales to millions of databases](https://daily.dev/posts/under-the-hood-off-the-hot-path-how-d1-scales-to-millions-of-databases-in1dnwimc) · Cloudflare · 2 upvotes · 0 comments
- [Introducing chdb Postgres extension: High-performance imports from cloud storage](https://daily.dev/posts/introducing-chdb-postgres-extension-high-performance-imports-from-cloud-storage-obcssxgxe) · ClickHouse · 4 upvotes · 1 comments
- [Designing a Production-Ready Agent Harness With Persistence and Checkpointing](https://daily.dev/posts/designing-a-production-ready-agent-harness-with-persistence-and-checkpointing-4ygffqjsx) · SitePoint · 1 upvotes · 0 comments

---

Tags: [#ai-agents](https://daily.dev/tags/ai-agents), [#sqlite](https://daily.dev/tags/sqlite), [#clickhouse](https://daily.dev/tags/clickhouse)

[View this post on daily.dev](https://daily.dev/posts/chdb-durable-layer-for-agent-memory-pgqovni4a)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"chDB Durable Layer for agent memory","url":"https://daily.dev/posts/chdb-durable-layer-for-agent-memory-pgqovni4a","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/chdb-durable-layer-for-agent-memory-pgqovni4a"},"datePublished":"2026-09-28T09:43:43.777Z","dateModified":"2026-09-28T10:24:43.263Z","description":"ClickHouse introduces the chDB Durable Layer, a durability extension for chDB (an embedded SQL OLAP engine) that lets agent memory stay fast to query locally...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/b7b1a30b393cecc0e84b4c8dfc72c6df?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/b7b1a30b393cecc0e84b4c8dfc72c6df?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"ClickHouse","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"ClickHouse","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/clickhouse","url":"https://daily.dev/sources/clickhouse"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/chdb-durable-layer-for-agent-memory-pgqovni4a","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ai-agents,sqlite,clickhouse","timeRequired":"PT16M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"ClickHouse","item":"https://daily.dev/sources/clickhouse"},{"@type":"ListItem","position":3,"name":"chDB Durable Layer for agent memory"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/chdb-durable-layer-for-agent-memory-pgqovni4a#faq","mainEntity":[{"@type":"Question","name":"What is the chDB Durable Layer and how does it make agent memory recoverable across machines?","acceptedAnswer":{"@type":"Answer","text":"It is a durability extension shipped in chDB 4.4 that keeps a local MergeTree working copy for fast in-process queries while writing an authoritative copy to object storage (S3, GCS, or Azure Blob) via explicit flush() and checkpoint() calls. A head.json file with conditional writes enforces a single-writer lease, so the same named object can be reopened and recovered on another laptop, in CI, or inside a short-lived sandbox. Developers designing recoverable agent memory can track releases like this chDB durability layer on daily.dev."}},{"@type":"Question","name":"How much does append-only agent memory in JSONL format compress when loaded into ClickHouse MergeTree?","acceptedAnswer":{"@type":"Answer","text":"In a small local experiment, a 1.45 GB Claude Code transcript sample with 213,721 rows compressed to 521 MiB using ZSTD(3), or 991 MiB with LZ4, after loading into MergeTree. Text compressed well, but screenshots, only 0.8% of rows, made up about two-thirds of the bytes, which is why binary blobs are recommended to live outside the table with only references stored in typed columns. Teams tuning storage costs for agent transcripts can follow compression benchmarks like this one on daily.dev."}},{"@type":"Question","name":"How much faster are local queries compared to remote database queries for agent memory recall?","acceptedAnswer":{"@type":"Answer","text":"Local queries were measured to be 58 times faster than remote queries in a local-vs-remote benchmark, reinforcing why keeping the hot recall path embedded in-process, rather than routing it through a network round trip to a server database, matters for agent memory systems that need low-latency recall. Engineers weighing local versus remote database architectures for agent workloads can compare benchmarks like this on daily.dev."}}]}
```

