How to Do Graph Engineering With Opus 5
Your agent's memory layer is quietly outspending your model. I rebuilt mine on Opus 5 for under a third of the cost - here's the exact config.
Most people building agent memory are lighting money on fire and calling it a knowledge graph.
They wire up Graphiti, point it at Opus, feed in a few thousand conversations, and watch the bill outrun their actual model calls. Then they blame graphs. “Too expensive.” It was never the graph. It was the config.
I rebuilt my memory layer on Opus 5 last week - same 5,000 episodes, same Neo4j container. The bill went from ~$35 down to ~$10, and the backfill ran overnight while I slept.
Gift at the bottom: the full CLAUDE.md routing block plus the copy-paste extraction script, Notion-ready for paid members. Filled in. No placeholders.
I’ve now got a temporal graph that survives every compaction, every restart, every new session - and the extraction feeding it bills at cache-read rates instead of frontier rates. My agent remembers who said what, when, and how it connects, and the memory layer is no longer my top cost line. It’s near the bottom.
That flip took one config change. Not a new tool. Not a rewrite. One block.
By the end of this issue, you’ll be the person who runs a temporal knowledge graph that costs less to feed than embeddings cost to store - while everyone around you is still running extraction at max effort and wondering why their “cheap” memory layer outspends their model.


