Skip to content

Commit 4063c36

Browse files
committed
add "Keeping an eye on the costs" section
1 parent c946c5c commit 4063c36

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎posts/2026-08-11-maintaining-an-organizational-knowledge-graph-with-an-llm-and-event-sourcing.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,12 +268,24 @@ Each node's page shows its full history: created in, last updated in, read by N
268268

269269
<img src="<%= src_original("arkency-planet/provenance.png") %>" width="100%">
270270

271+
## Keeping an eye on the costs
272+
273+
Besides auditing changes in the graph, we also track how much each extraction costs: token usage and the resulting price.
274+
When you work with an LLM API, it is worth keeping a hand on the pulse here.
275+
A transcript of a few hours of conversation, processed in multiple rounds interleaved with tool calls, can generate serious costs.
276+
[Prompt caching](https://rubyllm.com/chat/#anthropic-prompt-caching) helps a lot - the system prompt and the content stay identical between rounds, so most of the input is billed at the cache-read rate.
277+
278+
The exact numbers depend on the model you run the extraction on, but most of ours fit within a dozen or so cents.
279+
280+
<img src="<%= src_original("arkency-planet/extractions-cost.png") %>" width="100%">
281+
271282
## Human in the loop
272283

273284
We don't let the LLM write to the graph directly.
274285
Extraction produces a **proposal** with the before/after diffs, and applying it to the graph is a separate step.
275286

276287
Proposals can sit in a review window before they get applied.
288+
As soon as an extraction completes, we get a short summary of it on Slack.
277289
A human can inspect the diff, apply it early, or just let it flow after the configured delay.
278290

279291
Time passes between propose and apply, so the graph may have moved in the meantime.

0 commit comments

Comments
 (0)