<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sanjayrani Kamminana</title>
    <description>The latest articles on DEV Community by Sanjayrani Kamminana (@sanjayrani_kamminana_0b74).</description>
    <link>https://dev.to/sanjayrani_kamminana_0b74</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4120656%2F2df4c745-7656-44b2-adff-ef91ab879187.png</url>
      <title>DEV Community: Sanjayrani Kamminana</title>
      <link>https://dev.to/sanjayrani_kamminana_0b74</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sanjayrani_kamminana_0b74"/>
    <language>en</language>
    <item>
      <title>You pay for the same context three times a day</title>
      <dc:creator>Sanjayrani Kamminana</dc:creator>
      <pubDate>Fri, 11 Sep 2026 09:49:52 +0000</pubDate>
      <link>https://dev.to/sanjayrani_kamminana_0b74/you-pay-for-the-same-context-three-times-a-day-3dic</link>
      <guid>https://dev.to/sanjayrani_kamminana_0b74/you-pay-for-the-same-context-three-times-a-day-3dic</guid>
      <description>&lt;p&gt;I opened Claude to reason about a schema change. Then Cursor, to make it. Then Claude again the next morning, because the session was gone.&lt;/p&gt;

&lt;p&gt;Each of those was a cold start. Same repo, same decision history, same five files re-read from scratch, same explanation of why the &lt;code&gt;Order&lt;/code&gt; → &lt;code&gt;Payment&lt;/code&gt; edge is nullable typed out for the third time. Nothing in that sequence was new information. All of it was billed.&lt;/p&gt;

&lt;p&gt;That's the part of agent memory that bothers me more than forgetting. Forgetting is annoying. Re-reading is &lt;em&gt;expensive&lt;/em&gt;, and it's expensive in a way that scales with how useful the agent is — the more context it needs, the more you pay to rebuild it, every session, in every tool.&lt;/p&gt;

&lt;p&gt;MCP is the obvious place to fix this, and mostly it isn't used that way. Most MCP servers are verbs: send the message, open the PR, run the query. Very few are a place where context &lt;em&gt;lives&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the tokens actually go
&lt;/h2&gt;

&lt;p&gt;Do the arithmetic on a normal session. Twelve files at 400 lines each is somewhere north of 60k tokens before the agent has said anything useful. A retrieval step over a vector store trims that, but not as much as the demos suggest: top-k pulls back chunks that scored well on similarity, which is a different question from whether the agent needed them. You get ten chunks, three of which matter, and you pay for ten.&lt;/p&gt;

&lt;p&gt;Then the session ends and you do it again.&lt;/p&gt;

&lt;p&gt;The framing I've landed on: there are two separate costs, and they get conflated.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Volume&lt;/strong&gt; — how much you send per turn.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Repetition&lt;/strong&gt; — how many times you send it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Vector retrieval attacks volume. It does nothing about repetition, because the embedding index answers "what looks like this" and the agent still has to reconstruct the &lt;em&gt;state&lt;/em&gt; — what was decided, what depends on what, what changed last Tuesday — from whatever it can read this session.&lt;/p&gt;

&lt;p&gt;Repetition is the one that compounds across tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  Context that's shared, not copied
&lt;/h2&gt;

&lt;p&gt;A graph behind an MCP server changes the ownership of the context. The memory isn't in the client; it's in the database, and the client is a reader.&lt;/p&gt;

&lt;p&gt;That sounds like a small distinction and it isn't, because it means the same context is addressable from anywhere that speaks MCP. Claude writes a decision node during design. Cursor reads it two hours later while implementing, without being told. Nothing was exported, re-pasted, or summarised into a handoff doc that goes stale in a week.&lt;/p&gt;

&lt;p&gt;The CognoDB MCP server is deliberately thin — two tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;read the schema&lt;/li&gt;
&lt;li&gt;run a Cypher query&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's it. No pre-baked &lt;code&gt;get_user_context&lt;/code&gt; endpoint, no fixed set of retrieval verbs someone had to anticipate. The agent inspects the graph's actual shape, then writes a query for the question in front of it. When you add a node type next month, no tool definitions change and no client needs updating. The schema &lt;em&gt;is&lt;/em&gt; the tool surface.&lt;/p&gt;

&lt;p&gt;Configuration is the standard block:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"cognodb"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"-y"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"@cognodb/mcp"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"env"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"COGNODB_URI"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"bolt+s://db-7f3a2c1e.databases.cognodb.cloud"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"COGNODB_PASSWORD"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${DB_PASSWORD}"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Drop that into Claude Desktop, Cursor, Windsurf, Cline, Zed, JetBrains, Warp or Gemini CLI and they're all reading the same graph. Run it read-only while you're getting a feel for it — the agent can explore everything and write nothing.&lt;/p&gt;

&lt;p&gt;One honest caveat, because I've seen people hit it: &lt;strong&gt;ChatGPT is not a stdio client.&lt;/strong&gt; Custom connectors there are remote HTTPS only, on Plus and above with Developer Mode enabled, and Business/Enterprise workspaces need an admin to approve the connector first. The graph is the same graph; the transport is the part you have to solve separately. Anyone telling you one &lt;code&gt;npx&lt;/code&gt; line lights up every assistant on the market is selling something.&lt;/p&gt;

&lt;h2&gt;
  
  
  Relevant means bounded, not ranked
&lt;/h2&gt;

&lt;p&gt;The other half of "no noise" is what comes back.&lt;/p&gt;

&lt;p&gt;Similarity search returns a ranked list and you choose a cutoff. Graph traversal returns a &lt;em&gt;neighbourhood&lt;/em&gt;, and the boundary is structural rather than statistical — you asked for two hops from this entity, you get two hops from this entity:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cypher"&gt;&lt;code&gt;&lt;span class="k"&gt;MATCH&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="py"&gt;d:&lt;/span&gt;&lt;span class="n"&gt;Decision&lt;/span&gt; &lt;span class="ss"&gt;{&lt;/span&gt;&lt;span class="py"&gt;id:&lt;/span&gt; &lt;span class="n"&gt;$decision_id&lt;/span&gt;&lt;span class="ss"&gt;})&lt;/span&gt;
&lt;span class="k"&gt;OPTIONAL&lt;/span&gt; &lt;span class="k"&gt;MATCH&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="ss"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;:AFFECTS&lt;/span&gt;&lt;span class="ss"&gt;]&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="py"&gt;c:&lt;/span&gt;&lt;span class="n"&gt;Component&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;OPTIONAL&lt;/span&gt; &lt;span class="k"&gt;MATCH&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;-&lt;/span&gt;&lt;span class="ss"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;:SUPERSEDES&lt;/span&gt;&lt;span class="ss"&gt;]&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="py"&gt;newer:&lt;/span&gt;&lt;span class="n"&gt;Decision&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;OPTIONAL&lt;/span&gt; &lt;span class="k"&gt;MATCH&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="ss"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;:MADE_IN&lt;/span&gt;&lt;span class="ss"&gt;]&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="py"&gt;s:&lt;/span&gt;&lt;span class="n"&gt;Session&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;RETURN&lt;/span&gt; &lt;span class="n"&gt;d.summary&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;decision&lt;/span&gt;&lt;span class="ss"&gt;,&lt;/span&gt;
       &lt;span class="n"&gt;d.rationale&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;why&lt;/span&gt;&lt;span class="ss"&gt;,&lt;/span&gt;
       &lt;span class="nf"&gt;collect&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="k"&gt;DISTINCT&lt;/span&gt; &lt;span class="n"&gt;c.name&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;affects&lt;/span&gt;&lt;span class="ss"&gt;,&lt;/span&gt;
       &lt;span class="nf"&gt;collect&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="k"&gt;DISTINCT&lt;/span&gt; &lt;span class="n"&gt;newer.summary&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;superseded_by&lt;/span&gt;&lt;span class="ss"&gt;,&lt;/span&gt;
       &lt;span class="n"&gt;s.date&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;decided_on&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That returns a handful of rows. Not the twelve files the decision was made about — the decision, what it touches, and whether something later overrode it. If the agent needs the file, it can go read the file; it no longer has to read twelve of them hoping one explains the situation.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;SUPERSEDES&lt;/code&gt; edge is the part I'd underline. It's the thing a pile of retrieved text is worst at: an agent reading two conflicting notes has no way to know which one won. An edge says so directly, and the path it came back on is the explanation you show a human when they ask why the agent did that.&lt;/p&gt;

&lt;p&gt;Our own measurement on this is about a &lt;strong&gt;98.7% reduction in tokens at 3,700 entities&lt;/strong&gt;, comparing a bounded traversal against loading the equivalent corpus. Treat that as directionally true rather than a promise — the ratio moves with how dense your graph is and how deep you traverse, and a five-hop query on a hairball graph will happily hand you back the whole dataset. Bounded means bounded because &lt;em&gt;you&lt;/em&gt; bounded it.&lt;/p&gt;

&lt;p&gt;Latency matters here more than it looks like it should: two-hop traversals land around 0.27 ms, p95 0.51 ms. When retrieval is that cheap the agent can afford several small, specific queries per turn instead of one enormous speculative fetch — which is the actual mechanism by which the noise goes away.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where this doesn't apply
&lt;/h2&gt;

&lt;p&gt;It isn't graph versus vectors, and I'd rather say that plainly than pretend otherwise.&lt;/p&gt;

&lt;p&gt;If your question is "find me things that read like this" — semantic search over documents, fuzzy dedup, recommendations from unstructured text — embeddings are the right tool and a graph is a worse one. Graphs earn their place when the relationships are themselves the data you're querying: dependencies, provenance, ownership, sequence, supersession. Most real agent memory is a mix, and the useful version is a graph holding the structure with vector or BM25 lookup for the entry point.&lt;/p&gt;

&lt;p&gt;The other honest limit: someone has to decide what a node is. A vector store will accept whatever you throw at it. A graph makes you commit to a model up front, and a bad model is worse than no model. Start with three node types you're sure about and let it grow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trying it
&lt;/h2&gt;

&lt;p&gt;Full disclosure: I work on CognoDB. None of the reasoning above is specific to it — you can build exactly this on any Bolt-speaking graph with an MCP server in front.&lt;/p&gt;

&lt;p&gt;What made me stop prototyping this on a local cluster was the setup tax. The free &lt;code&gt;c0&lt;/code&gt; instance is enough to hold a real project's decision graph, it's Bolt 5.x so existing Neo4j drivers work unchanged, and the MCP server is the same &lt;code&gt;npx&lt;/code&gt; line above. Point two clients at it and watch the second one already know things.&lt;/p&gt;

&lt;h2&gt;
  
  
  Over to you
&lt;/h2&gt;

&lt;p&gt;The unsolved part, for me, is &lt;strong&gt;pruning&lt;/strong&gt;. A decision graph grows monotonically and a six-month-old superseded decision is noise, but deleting it destroys the provenance chain that made the graph worth having. Time-scoped edges? A &lt;code&gt;status&lt;/code&gt; property and every query filtering on it? Both feel wrong in different ways.&lt;/p&gt;

&lt;p&gt;If you've run shared agent memory across more than one tool for a while — how are you keeping it from silting up?&lt;/p&gt;

&lt;p&gt;More in this series under #cognodb.&lt;/p&gt;

</description>
      <category>cognodb</category>
      <category>mcp</category>
      <category>ai</category>
      <category>graphdatabase</category>
    </item>
  </channel>
</rss>
