Paul Dlug (@pdlug) profile picture

Building Nicia + TypeGraph: typed semantic state for durable agents. Graph merge, provenance, and memory for multi-agent systems.

Bend, OR
Joined January 2008
Photo by Paul Dlug (@pdlug)Photo by Paul Dlug (@pdlug)Photo by Paul Dlug (@pdlug)Photo by Paul Dlug (@pdlug)
A folder of markdown gives an agent five calls: list, open, read, write, seek. A smarter model uses them better. It will still quote a retired policy to a customer. No call returns "this is out of date." I'm at Seattle AI Week through Thurs. Building agents? Find me.
2
3
278
Surprise from building on Durable Objects: FTS5 is allowed in DO SQLite, so BM25 search runs inside the object with nothing to load. sqlite-vec isn't (no loadable extensions in workerd), so vectors are brute-force cosine. Is anyone doing indexed ANN inside a DO?
1
1
27
Matches what I've seen. Log everything, add retrieval, and it mostly just works. It also fails later: the log grows forever, every agent keeps its own, experiments sit next to production. What's in force can't be decided deterministically at read time.
I wrote about the bitter lesson for agent memory. We show that an agent running SQL queries on its own event logs achieves SOTA on all major memory benchmarks, and scales with model intelligence. We also found that dreaming doesn't add meaningful gains over raw logs as models get more capable. Current memory systems lose valuable task-relevant information during compression. In contrast, agentic search over an event log defers compression until query time. As model capability increases, they get better at finding relevant information directly from the uncompressed logs. An engineered memory store eventually becomes a bottleneck. Inspired by information theory (and epistemic foraging), this essay proposes that the goal of memory systems is to increase the epistemic value of search over an event log. It also suggests a design for a memory system that's built as a hierarchy of derived views over an immutable event log. Read more here: hatchery.build/blog/the-bitt…
1
22
The question everyone should be asking: what's the Lean for X? (where X is any knowledge work)
1
27
Loving formal verification, using everystate all over now and Lean where it makes sense. Great results adding it first then telling the agent to aggressively refactor knowing it's safe now.
18
Weird how bitemporal stores mostly get used to look backward: what did we know on Oct 15? For agents, forward matters more: this rule takes effect Dec 1. Docs can't say that, so you edit them too early or too late.
11
Happy December 1 to every AI agent confidently citing November's pricing from a Notion page nobody remembered to update.
7
Bullets 1, 2 and 4 are one missing layer. Skill files rot because a pile of files has no idea what depends on what, so nothing tells an agent a rule went stale. Memory forgets because it saves snippets with no notion of what's still true. Integrations flake because every agent reconciles the same slow tools from scratch on every run. Agents need one durable store they read from and write to, where changes are reviewed and every agent sees the same current state. Until then, long-running agents keep breaking exactly like this.
I use a lot of agents. A lot. Both personally and for work. And it's hard to overstate how shitty / not ready for production they are for generalized, long running tasks. Some of the issues I routinely run into: - context rot : there is a long tail of things you want agents to do. No set of skill files can capture those. And they'll quickly loose the ability to prioritize context right. Having per-task agents helps, but it basically kicks the can - memory issues : even basic things are routinely forgotten. Perhaps it's a corollary to the context prioritization issue. But agents are frustratingly forgetful even if I ask them to explicitly remember key things - scheduled tasks get lost or misfire : task schedulers tend to not be durable. For example during agent upgrade. And if that's the case you can't use the agents for anything that requires guarantees on state. Even if they do fire, you can have correctness issues. And unless you have some end to end state guarantees you're fucked. - third party integrations are horrid : I'm sure in a bespoke frontier lab environment where everything is controlled you can do long running tasks. But integrating into other software and hardware devices is consistently flakey and problematic. - reward hacking is real : agents often say they've done something when they haven't. It's frustrating as fuck. Especially if you're depending on it actually having done the thing - the upgrade loop isn't hands off : I constantly have to VNC into various mac minis to upgrade / debug agents. Even commercial ones. - .. I'm a huge believer and fan of agents. But I don't even think the asymptote of progress is converging on something actually working without key innovations. It's all just delayed frustration. tl;dr still tons of work to do.
1
48
Building this at Nicia. Happy to show anyone who's hitting this what it looks like on their own docs (or whatever your current pile of knowledge is).
14
Eval your data moat before you sell it. Same questions, split: model alone, model plus your corpus. Score correct and cited separately. Correct barely moves, cited jumps: you're selling attribution. Neither moves: you built a fancy cache.
48
An ontology that doesn't reject bad writes is a mood board. Most of them are. OWL infers. Graph databases shrug. Your "data model" doc sits in Notion. New in TypeGraph: an ontology the database enforces. Typed, in TypeScript, on the SQLite or Postgres you already run. 🧵
9
83
The usual options: Graph DB: a second database to run, sync, and get paged about. Queries are strings your compiler has never met. OWL/RDF: a reasoner and a PhD. Palantir: a procurement process. TypeGraph: npm install. Schemas are Zod. Queries are TypeScript.
1
52
Agents: the contractor who only works while you’re on the call. Always-on agents: the overeager intern who reorganized your inbox at 3am. I want the a coworker who knows when to bother you.
1
44
A graph database per tenant, per agent, per document. Each one is a Durable Object with its own SQLite, addressed by name. No provisioning, no WHERE tenant_id. We built that on Cloudflare with TypeGraph. As of this week the same code runs anywhere.
5
1
74
@rivet_dev's OpenOrange runs Workers and Durable Objects on AWS, GCP, Azure or your own servers. We pointed it at our demo and changed nothing: wrangler dev → orange dev
23
Agent memory benchmarks time how fast it answers. I haven't seen one time how long it keeps answering from a source that was retracted. TypeGraph records why each derived fact holds when it's written: these sources, this rule. Retract or supersede a source and one transaction walks those edges, recomputes support, and soft-deletes only what lost it. A fact with another justification stays. No scheduled cleanup pass. Edges stay put, so un-retracting reuses them. MIT, TypeScript, Postgres, SQLite or Durable Objects. Link below.
5
1
105
In Nicia we go further and that retract becomes a change notification and a review, so the agent re-derives only what got flagged. TypeGraph is our open-source typed graph library for TypeScript: typegraph.dev/blog/truth-mai…
33
TypeGraph makes bitemporal easy, two timelines: when a fact was true, and when the system learned it. An agent blocked a deploy at 2am. At 7 the bad feed was retracted. asOfRecorded(before): block current. asOfRecorded(after): gone. You audit 2am against what the agent knew at 2am.
1
29
Recorded reads are for audit and replay: slower than current reads, and find, search and vector predicates aren't available at a past anchor. 0.74 adds neighbor reads at a past commit. TypeGraph is our open-source TypeScript graph library: typegraph.dev/blog/truth-mai…
23
I'm seeing these decision models separate on order sensitivity. Gemini Decision 1, measured today: perfect recall on agent write admission, then 3 of 85 decisions flip when we reverse the record order. Jev, Clef and Microsoft Decision 1 held every gate across all seven passes.
Introducing Gemini Decision 1, our new frontier decision model in the Gemini API. It is $0.10 per 1M input tokens with no additional cost. With support for image, audio, video, and PDF natively, 256K context window, & 1K questions. You can try it for free in the API!
1
1
62
This is gold. I've been combining it with: For each choose a strategy: - Leave simple clear ones alone - Refactor for clarity (rename, extract helpers, use typed state unions) - Convert to explicit state machine (XState or custom) if complex
good prompt "find all of the implicit state machines in my app"
1
43
The metal-instance tax is gone. Firecracker-grade isolation on ordinary EC2, at no extra charge, with EFS mounted. Every "we run bare metal so you don't have to" pitch just died, maybe the "sandbox FS" pitches too. Sandboxes are still a hack, but this is solid you need one.
19
We're open-sourcing Countercheck: a contradiction-detection API plus the full eval harness behind it. Decision models rarely cry wolf. When they miss a contradiction, they don't say "no." They say "not sure." 🧵
5
32
We tested 9 decision models. None of them is good enough yet. Including the one we ship. Precision is mostly there: the best are ~96% precise. Recall isn't. Even the best miss about a third of contradictions, and nearly 9 in 10 misses are a "not sure."
11
TypeGraph: models can grow their own graph schema at runtime with store.evolve(). One model made two fields required because its three samples all had them. The smoke test failed, the typed errors went back, and the retry passed. All 922 events ingested. Under 30s, about $0.003.
2
20
The point: an agent that hits a new kind of record mid-corpus extends the schema itself, with no migration or redeploy. Bad proposals fail in a scratch store first. One query over the new kinds then found 4 known retraction chains and 3 more. typegraph.dev/blog/runtime-s…
7
TypeGraph: search a catalog for "PROD-1005-E" with embeddings and unrelated products outrank it. The SKU barely registers in the vector. store.search.hybrid() runs BM25 and vector search in the same store and fuses by rank (RRF). 0.8ms on SQLite, no second database.
2
1
25