<?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: Oscar Kandir</title>
    <description>The latest articles on DEV Community by Oscar Kandir (@oscar_kandir_4ce4f97c3d43).</description>
    <link>https://dev.to/oscar_kandir_4ce4f97c3d43</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%2F3843684%2F503e696a-911d-41ce-a701-9dba0466176d.jpg</url>
      <title>DEV Community: Oscar Kandir</title>
      <link>https://dev.to/oscar_kandir_4ce4f97c3d43</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/oscar_kandir_4ce4f97c3d43"/>
    <language>en</language>
    <item>
      <title>Only the finance lead can sign: building a deal desk in team chat with Switch</title>
      <dc:creator>Oscar Kandir</dc:creator>
      <pubDate>Sat, 07 Nov 2026 18:23:39 +0000</pubDate>
      <link>https://dev.to/oscar_kandir_4ce4f97c3d43/only-the-finance-lead-can-sign-building-a-deal-desk-in-team-chat-with-switch-j47</link>
      <guid>https://dev.to/oscar_kandir_4ce4f97c3d43/only-the-finance-lead-can-sign-building-a-deal-desk-in-team-chat-with-switch-j47</guid>
      <description>&lt;p&gt;A sales rep needs a deal signed today: 35% off, unlimited liability, and the right to cancel any time for a refund. We built four AI agents that check that deal in the team chat the rep already uses, hand the full case to finance in a private room, and let only the finance lead issue the order form. When the rep tries to approve it himself, Switch refuses him before any model sees the message.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/9iczSCaXYvM" rel="noopener noreferrer"&gt;Demo video&lt;/a&gt; · &lt;a href="https://github.com/oscarosk/deal-desk" rel="noopener noreferrer"&gt;Code&lt;/a&gt; · Built for Flip the Switch (WeMakeDevs × DevTools Academy × Switch), Track 01: Best Business Workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  The short version
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A rep posts a deal in &lt;code&gt;#deal-desk-sales&lt;/code&gt;. Four agents (Deal Desk, Pricing, Legal, Order Desk) check it, and the finance lead decides in a private &lt;code&gt;#deal-desk-finance&lt;/code&gt; room.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Switch decides who can tell whom to do what.&lt;/strong&gt; Order Desk is set to "Only me", so only the finance lead can make it issue a contract.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scripts decide the numbers.&lt;/strong&gt; The agents run &lt;code&gt;pricing.py&lt;/code&gt; and &lt;code&gt;order_form.py&lt;/code&gt; and quote them. The model never does the maths.&lt;/li&gt;
&lt;li&gt;On our demo deal: 35% is rejected (margin 60.7%, floor 65%), the counter is 24%, the finance lead approves 25% over 24 months, and Order Desk issues a $405,000 order form, with who approved it and when.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;Every B2B software company has some version of this. A rep has a big deal, the customer wants a bigger discount and a contract change, and the quarter ends Friday. The rep messages finance, then legal, then finance again, while the customer waits. Or the rep finds a way to push it through, and the company signs something it shouldn't have: a discount below its margin, or a clause that makes it liable for unlimited damages.&lt;/p&gt;

&lt;p&gt;The checks themselves aren't hard. Is the discount above the floor? Does the clause match the playbook? Who is allowed to approve this? What's hard is getting them done quickly, in the place the rep already works, without the rep being able to skip them.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we built
&lt;/h2&gt;

&lt;p&gt;Deal Desk is two Switch rooms on the bundled Mattermost, and four Claude Code agents, each with its own folder, instructions and job:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Agent&lt;/th&gt;
&lt;th&gt;Job&lt;/th&gt;
&lt;th&gt;Who can instruct it&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;@deal-desk&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Restates the deal, asks for checks, hands off to finance, tells the rep the outcome&lt;/td&gt;
&lt;td&gt;Anyone in its rooms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;@pricing&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Runs &lt;code&gt;pricing.py --verdict-only&lt;/code&gt;: accept, reject or counter, with no internal numbers&lt;/td&gt;
&lt;td&gt;Anyone in its rooms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;@legal&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Checks each clause against the playbook: Standard, Fallback or Never&lt;/td&gt;
&lt;td&gt;Anyone in its rooms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;@order-desk&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Writes the approval record, runs &lt;code&gt;order_form.py&lt;/code&gt;, posts the order form&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Only the finance lead&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The sales room is public. The finance room is a private channel with only the finance lead, Deal Desk and Order Desk in it. Deal Desk is the only agent in both rooms, so it carries the deal's context into finance without anyone copying and pasting.&lt;/p&gt;

&lt;p&gt;Why four agents instead of one? Because their goals pull in different directions. The rep wants the deal closed, Pricing protects margin, Legal protects the company from risk. One agent with all three briefs has to argue with itself. Four agents with one job each don't.&lt;/p&gt;

&lt;h2&gt;
  
  
  How a deal runs
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Tom, the rep,&lt;/strong&gt; posts the deal to &lt;code&gt;@deal-desk&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deal Desk&lt;/strong&gt; turns it into a JSON deal record and asks &lt;code&gt;@pricing&lt;/code&gt; and &lt;code&gt;@legal&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pricing&lt;/strong&gt; runs the script and replies: reject, counter 24% over 12 months. No margins, no floor.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Legal&lt;/strong&gt; marks both clauses Never and suggests the fallbacks: a 2× fees liability cap, and termination only at renewal.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deal Desk&lt;/strong&gt; sums up for Tom, and posts a handoff in the finance room with the deal JSON, the full pricing output (margin 60.7%, floor 65%, maximum discount 26%) and legal's findings.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Alice, the finance lead,&lt;/strong&gt; approves specific terms to Order Desk.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Order Desk&lt;/strong&gt; writes &lt;code&gt;approvals/D-xxxx.json&lt;/code&gt;, runs &lt;code&gt;order_form.py&lt;/code&gt;, and posts the order form.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deal Desk&lt;/strong&gt; tells Tom the approved terms, without internal numbers.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  We tried to break it
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Attempt&lt;/th&gt;
&lt;th&gt;What happened&lt;/th&gt;
&lt;th&gt;What stopped it&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Tom tells &lt;code&gt;@order-desk&lt;/code&gt; to approve his own deal&lt;/td&gt;
&lt;td&gt;Refused: "I only take instructions from my owner…"&lt;/td&gt;
&lt;td&gt;Switch's "who can talk to your agent" setting&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Another of our agents tells Order Desk to issue a form&lt;/td&gt;
&lt;td&gt;Refused&lt;/td&gt;
&lt;td&gt;Switch's "Only me" setting&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;An agent is asked what was said in a room it isn't in&lt;/td&gt;
&lt;td&gt;"I'm not a member, so I can't read it"&lt;/td&gt;
&lt;td&gt;Switch room membership&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tom opens the finance room's URL&lt;/td&gt;
&lt;td&gt;No access&lt;/td&gt;
&lt;td&gt;Private Mattermost channel&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Alice approves 35%, below the floor&lt;/td&gt;
&lt;td&gt;&lt;code&gt;REFUSED: margin 60.7% is below the 65% floor&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Our &lt;code&gt;order_form.py&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tom asks for the lowest discount we can do&lt;/td&gt;
&lt;td&gt;Declined&lt;/td&gt;
&lt;td&gt;Agent instructions only&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;That last row matters, so we say it plainly: &lt;strong&gt;the information barrier is a prompt.&lt;/strong&gt; Deal Desk is in both rooms, so keeping finance numbers out of sales depends on it following its brief. Everything else in the table is enforced by Switch or by our code.&lt;/p&gt;

&lt;h2&gt;
  
  
  How we used Switch
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;"Who can talk to your agent."&lt;/strong&gt; This one setting does more than any prompt. Order Desk is set to Only me. Pricing, Legal and Deal Desk are set to Anyone, because the rep's chat account isn't linked to a Switch user, and an unlinked account matches no custom rule. When Tom tries to approve his own deal, Switch refuses him and the model never runs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rooms as boundaries.&lt;/strong&gt; Before building, we tested it: an agent outside a room genuinely can't read it, and an agent in two rooms can see both. That one test shaped the whole design. Pricing stays in sales only; Deal Desk is the deliberate bridge.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Aliases.&lt;/strong&gt; &lt;code&gt;!set-alias @lumen-pricing @pricing&lt;/code&gt; let people write short names, while each agent keeps a unique name on the server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Separate folders.&lt;/strong&gt; Each agent runs in its own clone of the repo, so each one has the scripts and rules but only its own working files.&lt;/p&gt;

&lt;h2&gt;
  
  
  What got in the way
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The template didn't run on Windows.&lt;/strong&gt; Console 0.40.1 said "Not supported here" for every provider in the template form, even though Claude Code was installed, signed in, and running agents created by hand. We built the setup manually; the template is in the repo, untested.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rooms from Console were always public,&lt;/strong&gt; and Mattermost wouldn't let us change their type. We created the private channel in Mattermost and added the agents, which made it a Switch room.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;"Not connected to a room."&lt;/strong&gt; After we archived old rooms and moved agents around, every agent could join a room but no post went through. Restarting didn't help. Creating a fresh test agent did work, so we deleted and recreated the four agents. Their aliases then pointed at the deleted agents and had to be set again.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What we learned
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Decide early what enforces what.&lt;/strong&gt; Our first design claimed an "information barrier". Testing showed it was only as strong as one agent's instructions. Writing a table of what Switch enforces, what our code enforces and what only the prompt covers made the design honest and better.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let scripts decide numbers.&lt;/strong&gt; Every price in the room comes from &lt;code&gt;pricing.py&lt;/code&gt;. Every order form goes through &lt;code&gt;order_form.py&lt;/code&gt;, which reruns the pricing check on the approved terms. Even the finance lead can't sign below the floor.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Test the platform before you design on it.&lt;/strong&gt; Twenty minutes of tests (refusals, room separation, unlinked accounts) saved us from building a "customer agent negotiates with our agent" design that a local Console server can't support.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;Everything is fictional: Lumen Analytics, its prices and its customers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/oscarosk/deal-desk
&lt;span class="nb"&gt;cd &lt;/span&gt;deal-desk
python &lt;span class="nt"&gt;-m&lt;/span&gt; unittest discover &lt;span class="nt"&gt;-s&lt;/span&gt; tests
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The README has step-by-step setup for Switch Console: four agents, two rooms, the aliases, and the demo deal. Then try to get Order Desk to sign at 35%.&lt;/p&gt;

&lt;p&gt;If you build agents that take real actions, where do you draw the line between what the prompt decides and what the platform enforces? We'd like to hear.&lt;/p&gt;

</description>
      <category>switch</category>
      <category>ai</category>
      <category>agents</category>
      <category>hackathon</category>
    </item>
    <item>
      <title>Mergetober: giving an agent the memory of a Telegram group, with cognee</title>
      <dc:creator>Oscar Kandir</dc:creator>
      <pubDate>Sat, 31 Oct 2026 17:59:35 +0000</pubDate>
      <link>https://dev.to/oscar_kandir_4ce4f97c3d43/mergetober-giving-an-agent-the-memory-of-a-telegram-group-with-cognee-492h</link>
      <guid>https://dev.to/oscar_kandir_4ce4f97c3d43/mergetober-giving-an-agent-the-memory-of-a-telegram-group-with-cognee-492h</guid>
      <description>&lt;p&gt;A lot of small teams run on a Telegram group. Release dates, who owns what, which bug is fixed in which branch: it is all in there, and none of it is searchable in a useful way a week later.&lt;/p&gt;

&lt;p&gt;For Mergetober I built a Telegram connector for &lt;a href="https://github.com/topoteretes/cognee" rel="noopener noreferrer"&gt;cognee&lt;/a&gt;, so an agent can answer questions from what a bot has seen in a group or channel. It was my first merged connector.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pull request (merged): &lt;a href="https://github.com/topoteretes/cognee-community/pull/355" rel="noopener noreferrer"&gt;topoteretes/cognee-community#355&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Issue: &lt;a href="https://github.com/topoteretes/cognee/issues/4730" rel="noopener noreferrer"&gt;topoteretes/cognee#4730&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The demo: an edited message
&lt;/h2&gt;

&lt;p&gt;Chat messages get edited all the time: a date moves, a name gets corrected. An agent that remembers the first version is worse than one that remembers nothing. So I sent three messages in my test group:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvqzwef9alapx9uhjkbgg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvqzwef9alapx9uhjkbgg.png" alt="The three messages in the Telegram test group" width="798" height="110"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;synced the group into cognee (OpenAI as the LLM), and asked:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When does release v0.4 ship, who owns its release notes, and where is the login bug fixed?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F632acjqh8lpbe9lhilpj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F632acjqh8lpbe9lhilpj.png" alt="Before: cognee answers that v0.4 ships Friday" width="800" height="254"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Release v0.4 ships Friday, November 6, 2026. Ananya owns the release notes, and the login bug is fixed in the hotfix branch.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then I edited the first message, Friday to Monday. No new message, just the edit:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwz1bqv04gf66zvy5o7qt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwz1bqv04gf66zvy5o7qt.png" alt="The first message edited from Friday to Monday" width="476" height="146"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Telegram sends a bot an edit as an &lt;code&gt;edited_message&lt;/code&gt; update. The connector stores each message under &lt;code&gt;chat_id:message_id&lt;/code&gt;, so the edit replaces the same row instead of adding a second, contradicting one. The next sync read exactly one update (&lt;code&gt;messages 1&lt;/code&gt;), and the same question now gets:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpu1n0h8z2fdak2gc45ho.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpu1n0h8z2fdak2gc45ho.png" alt="After the sync: cognee answers that v0.4 ships Monday" width="799" height="174"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Release v0.4 ships Monday, November 2, 2026. Ananya owns the release notes, and the login bug is fixed in the hotfix branch.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;(The dates are cognee's LLM working out which Friday and Monday from when the messages were sent; my messages only said the weekday.)&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting it up
&lt;/h2&gt;

&lt;p&gt;Create a bot with &lt;a href="https://t.me/BotFather" rel="noopener noreferrer"&gt;@BotFather&lt;/a&gt;, add it to the group or channel, and pass its token to the connector:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;cognee&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;cognee_community_connector_telegram&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;telegram_source&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;cognee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;remember&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nf"&gt;telegram_source&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;bot_token&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;chats&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;@my_team_channel&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt;
    &lt;span class="n"&gt;dataset_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;telegram_chats&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;primary_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;write_disposition&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;merge&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;max_rows_per_table&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;answers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;cognee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;recall&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;What has been discussed in these chats, and who said what?&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;datasets&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;telegram_chats&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On startup the connector calls &lt;code&gt;getMe&lt;/code&gt; once. Besides checking the token, that tells it whether privacy mode is on, which hides most group messages from a bot, so it warns you instead of silently syncing nothing.&lt;/p&gt;

&lt;h2&gt;
  
  
  An earlier run: a group and a channel together
&lt;/h2&gt;

&lt;p&gt;I sent three messages in a test group and one post in a test channel, then ran the example with OpenAI as the LLM:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Telegram: 4 message row(s), 0 deletion(s).
RememberResult(status='completed', dataset='telegram_chats', items=4, elapsed=30.8s)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Oswin said the group decided to ship v0.3 on Thursday, that Priya is handling the release notes, and that the login bug is fixed in the hotfix branch.&lt;br&gt;
Cognee Test Channel posted that the v0.3 release is planned for Thursday.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The part that took the longest: not losing messages
&lt;/h2&gt;

&lt;p&gt;The Bot API has one way to read messages, &lt;code&gt;getUpdates&lt;/code&gt;, and it has a catch: &lt;strong&gt;asking for the next page confirms the previous one&lt;/strong&gt;, and Telegram then drops it for good. A connector that reads two pages in one run, and then fails to load the second, has lost the first.&lt;/p&gt;

&lt;p&gt;So the connector reads one page per run (up to 100 updates). The page is only confirmed by the next run, after the load succeeded, and the cursor is written after the last row. The tests drive this hard: a failed load with 150 updates pending, the host revoking the sync between rows with 250 pending, a failure halfway through, and a quiet week after which Telegram may restart its &lt;code&gt;update_id&lt;/code&gt; counter. In every case, nothing is lost.&lt;/p&gt;

&lt;p&gt;There are 62 tests in total, against a mocked Bot API whose &lt;code&gt;getUpdates&lt;/code&gt; drops confirmed updates the way the real one does.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does with edits and deletes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Edits&lt;/strong&gt;: &lt;code&gt;edited_message&lt;/code&gt; and &lt;code&gt;edited_channel_post&lt;/code&gt; replace the same row, keyed by &lt;code&gt;chat_id:message_id&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A bot removed from a chat, or the chat deleted&lt;/strong&gt;: every stored message of that chat gets a &lt;code&gt;_deleted&lt;/code&gt; tombstone, and cognee's orphan cleanup removes them from the graph.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A group upgraded to a supergroup&lt;/strong&gt;: the new chat id keeps syncing, and removal forgets messages stored under both ids.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One thing I checked before writing any code: &lt;strong&gt;a bot cannot see single-message deletes&lt;/strong&gt;. When I deleted messages in my test group, nothing came through, not even a gap in &lt;code&gt;update_id&lt;/code&gt;. So deletes work per chat. I raised that on the issue before starting, and the README lists it with the other Bot API limits.&lt;/p&gt;

&lt;h2&gt;
  
  
  Live run
&lt;/h2&gt;

&lt;p&gt;On a real bot in a test group and a test channel, through a real dlt merge:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# 1. two messages in a group + one channel post
Telegram: 3 message row(s), 0 deletion(s).
# 2. edited message 2 (same key, text replaced, still 3 rows)
Telegram: 1 message row(s), 0 deletion(s).
# 3. nothing new
Telegram: 0 message row(s), 0 deletion(s).
# 4. removed the bot from the group (the channel is untouched)
Telegram: bot removed from Cognee Test Group 2; forgetting its messages.
Telegram: 0 message row(s), 2 deletion(s).
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Limits worth knowing before you set it up
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No history.&lt;/strong&gt; A bot only sees messages sent after it joined the chat, so the first sync starts from then.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sync at least daily.&lt;/strong&gt; Telegram keeps undelivered updates for about 24 hours. A run that reads a full page logs a warning, so you know to sync more often.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One reader per bot.&lt;/strong&gt; If a webhook is set, or another program is polling the same bot, Telegram answers 409, and the connector names which of the two it is.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Long flood waits&lt;/strong&gt; (over a minute) end the run cleanly, and the next sync resumes where it stopped.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I learned from the review
&lt;/h2&gt;

&lt;p&gt;The review took a few rounds, and it made the connector better. Several bots in one chat see the same message keys, so each bot now writes its own table and sync state. The host can stop a sync at any point through &lt;code&gt;check_active&lt;/code&gt; without losing updates. And I found that cognee 1.4 skipped orphan cleanup once a table became empty, so the last chat's messages stayed in memory after the bot left; the connector requires 1.6.3, which handles it.&lt;/p&gt;

&lt;p&gt;The connector is in &lt;a href="https://github.com/topoteretes/cognee-community/tree/main/packages/connector/telegram" rel="noopener noreferrer"&gt;packages/connector/telegram&lt;/a&gt;, with the setup steps in its README; &lt;code&gt;examples/example.py&lt;/code&gt; syncs your chats and asks them a question.&lt;/p&gt;

</description>
      <category>cognee</category>
      <category>opensource</category>
      <category>python</category>
      <category>ai</category>
    </item>
    <item>
      <title>Mergetober: asking our team chat why we rolled back a deploy, with cognee and Mattermost</title>
      <dc:creator>Oscar Kandir</dc:creator>
      <pubDate>Sat, 31 Oct 2026 17:58:25 +0000</pubDate>
      <link>https://dev.to/oscar_kandir_4ce4f97c3d43/mergetober-asking-our-team-chat-why-we-rolled-back-a-deploy-with-cognee-and-mattermost-4knp</link>
      <guid>https://dev.to/oscar_kandir_4ce4f97c3d43/mergetober-asking-our-team-chat-why-we-rolled-back-a-deploy-with-cognee-and-mattermost-4knp</guid>
      <description>&lt;p&gt;Teams that self-host Mattermost usually do it because their conversations can't live in a SaaS tool. Those conversations are where the real decisions are made: why a deploy was rolled back, what caused last Monday's outage, what the fix should be. A few weeks later, the only way to find that out is to scroll through channel history.&lt;/p&gt;

&lt;p&gt;For Mergetober I built a Mattermost connector for &lt;a href="https://github.com/topoteretes/cognee" rel="noopener noreferrer"&gt;cognee&lt;/a&gt;, so an agent can answer those questions from the team's own threads.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pull request: &lt;a href="https://github.com/topoteretes/cognee-community/pull/479" rel="noopener noreferrer"&gt;topoteretes/cognee-community#479&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Issue: &lt;a href="https://github.com/topoteretes/cognee/issues/5470" rel="noopener noreferrer"&gt;topoteretes/cognee#5470&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The use case
&lt;/h2&gt;

&lt;p&gt;Say an incidents channel holds two threads. One is about rolling back the payments deploy (a question and three replies), the other about a VPN outage:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9087xacj99g1753kfnad.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9087xacj99g1753kfnad.png" alt="The incidents channel in Mattermost, with the rollback thread and its three replies open" width="799" height="157"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I want to ask "What did the team decide, and why?" and get an answer built from those threads. When a thread is deleted in Mattermost, I want the answer to stop using it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting it up
&lt;/h2&gt;

&lt;p&gt;Mattermost turns personal access tokens off by default, so a system admin enables them once under &lt;strong&gt;System Console → Integrations → Integration Management&lt;/strong&gt;. Then:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a token under &lt;strong&gt;Profile → Security → Personal Access Tokens&lt;/strong&gt;. A dedicated account that is only a member of the channels you want to sync keeps the token's reach small.&lt;/li&gt;
&lt;li&gt;Find each channel's id. Click the channel name to open its Info panel; the id is the &lt;code&gt;ID:&lt;/code&gt; line. The connector takes ids, not names, because channels get renamed.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The connector is one call into cognee:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;cognee&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;cognee_community_connector_mattermost&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;mattermost_source&lt;/span&gt;

&lt;span class="n"&gt;source&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;mattermost_source&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://chat.example.com&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;channels&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;channel_id&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;cognee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;remember&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;dataset_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;mattermost_chat&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;primary_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;write_disposition&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;merge&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;max_rows_per_table&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;answers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;cognee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;recall&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;What did the team decide, and why?&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;datasets&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;mattermost_chat&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;write_disposition="merge"&lt;/code&gt; matters: after the first run, the connector only returns the threads that changed, so the default &lt;code&gt;replace&lt;/code&gt; would wipe the rest.&lt;/p&gt;

&lt;h2&gt;
  
  
  What cognee answered
&lt;/h2&gt;

&lt;p&gt;I ran it against a local Mattermost server (the official &lt;code&gt;mattermost-preview&lt;/code&gt; Docker image) with OpenAI as the LLM. The first sync stored both threads (&lt;code&gt;scanned 2&lt;/code&gt;), and cognee answered:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fel2ktxbgop6pc0hd3hrx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fel2ktxbgop6pc0hd3hrx.png" alt="Before: cognee answers that the team rolled back the payments deploy at 14:20, and why" width="800" height="354"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The team decided to roll back the payments deploy at 14:20 because card authorisations became three times slower: the new fraud rules bypassed the cache, causing every payment to hit the database. They planned to fix it by putting the rules behind the cache.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That answer comes from four messages in one thread: the question and three replies, each holding one piece (the slowdown, the cause, the rollback time and the fix). That is why the connector stores &lt;strong&gt;one document per thread&lt;/strong&gt; rather than one per message: a reply like "agreed, ship it" means nothing on its own.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deleting a thread
&lt;/h2&gt;

&lt;p&gt;Then I deleted the rollback thread in Mattermost. Mattermost asks first, because the replies go with it:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fso1yxmdj9sj08s0b74n1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fso1yxmdj9sj08s0b74n1.png" alt="The channel after deleting the rollback thread: only the VPN thread is left" width="772" height="190"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The next sync reported &lt;code&gt;deleted 1&lt;/code&gt;, and the same question now got a different answer:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjywirg6htqpddf4lzar7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjywirg6htqpddf4lzar7.png" alt="After the sync: cognee answers about the VPN certificate instead" width="799" height="220"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The team renewed the expired VPN gateway certificate at 09:40 because it caused the office VPN outage.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The rollback thread is gone from cognee's memory, not just hidden. For chat data this matters a lot: people delete messages for a reason, and an agent that keeps quoting them is a problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it keeps up with the channel
&lt;/h2&gt;

&lt;p&gt;Mattermost's &lt;code&gt;since&lt;/code&gt; parameter returns every post changed after a timestamp, including deleted ones, which come back with &lt;code&gt;delete_at&lt;/code&gt; set. That makes it a real change feed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A new reply or an edit bumps the thread's root post, so the connector re-reads just that thread.&lt;/li&gt;
&lt;li&gt;A deleted root becomes a tombstone, and cognee removes the thread's document from the graph.&lt;/li&gt;
&lt;li&gt;When nothing changed, the run reads nothing (&lt;code&gt;scanned: 0&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A few things I only found by testing against a real server:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Every edit leaves a hidden copy&lt;/strong&gt; of the old version, which comes back as an already-deleted post with its own id. Treating it as a deletion would forget things on every edit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;since&lt;/code&gt; is exclusive, and two posts can share a millisecond.&lt;/strong&gt; The connector starts its window 1 ms early and skips posts it has already seen.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;since&lt;/code&gt; returns at most 1,000 posts and can't be paged.&lt;/strong&gt; After a busy weekend, a connector that just moved its cursor forward would silently lose the rest. When &lt;code&gt;since&lt;/code&gt; comes back full, this one re-reads the whole channel instead. I tested that live: 1,050 new posts plus a deleted thread in one interval gave &lt;code&gt;scanned: 1050, deleted: 1&lt;/code&gt;, with all 1,051 live threads stored.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A full read can be thrown off by a delete happening at the same time.&lt;/strong&gt; The paged listing shifts when a post disappears mid-read, which could skip a live thread. So a full read is checked against what changed while it ran, and starts over if needed. A stored thread missing from a full read is looked up on its own before it is forgotten.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Safety choices
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A 403 or 404 never deletes anything. A channel the token lost access to keeps its memory, and the sync fails loudly after three runs in a row.&lt;/li&gt;
&lt;li&gt;An archived channel stays in memory and stops syncing, unless you pass &lt;code&gt;forget_archived=True&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The token is only sent to the server you configure, over https (plain http is allowed only for a server on localhost, like my Docker test), and redirects are not followed.&lt;/li&gt;
&lt;li&gt;Documents name people by display name, never by email address.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;Ask every API what it does when there's &lt;em&gt;too much&lt;/em&gt;. &lt;code&gt;since&lt;/code&gt; looked like the perfect change feed until I asked what happens after a busy weekend: it stops at 1,000 posts, can't be paged, and says nothing about the rest. A connector that trusted it would have lost data silently, and only on the busiest days, the ones people ask about later. The fix was cheap once I knew, and the only way to know was to post 1,050 messages and look.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;p&gt;Very long threads are re-processed in full when they grow. Splitting them into windows would make that cheaper, and it's the first thing I'd add.&lt;/p&gt;

&lt;p&gt;If your team runs Mattermost, the setup steps are in the README (on the PR branch until it's merged), and &lt;code&gt;examples/example.py&lt;/code&gt; syncs your channels and asks them a question.&lt;/p&gt;

</description>
      <category>cognee</category>
      <category>opensource</category>
      <category>python</category>
      <category>ai</category>
    </item>
    <item>
      <title>Mergetober: an agent that remembers your support tickets, and forgets the deleted ones, with cognee and Zendesk</title>
      <dc:creator>Oscar Kandir</dc:creator>
      <pubDate>Sat, 31 Oct 2026 17:54:25 +0000</pubDate>
      <link>https://dev.to/oscar_kandir_4ce4f97c3d43/mergetober-an-agent-that-remembers-your-support-tickets-and-forgets-the-deleted-ones-with-cognee-3j3o</link>
      <guid>https://dev.to/oscar_kandir_4ce4f97c3d43/mergetober-an-agent-that-remembers-your-support-tickets-and-forgets-the-deleted-ones-with-cognee-3j3o</guid>
      <description>&lt;p&gt;Support teams answer the same questions again and again: "have we seen this error before?", "how did we fix the double charge last month?" The answers are in old tickets and Help Center articles, but nobody has time to dig through them.&lt;/p&gt;

&lt;p&gt;For Mergetober I built a Zendesk connector for &lt;a href="https://github.com/topoteretes/cognee" rel="noopener noreferrer"&gt;cognee&lt;/a&gt;, so an agent can answer from the team's own tickets and articles.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pull request: &lt;a href="https://github.com/topoteretes/cognee-community/pull/356" rel="noopener noreferrer"&gt;topoteretes/cognee-community#356&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Issue: &lt;a href="https://github.com/topoteretes/cognee/issues/4754" rel="noopener noreferrer"&gt;topoteretes/cognee#4754&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Setting it up
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;cognee&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;cognee_community_connector_zendesk&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;zendesk_source&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;cognee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;remember&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nf"&gt;zendesk_source&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;subdomain&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;acme&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;oauth_token&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;dataset_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;zendesk&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;primary_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;write_disposition&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;merge&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;max_rows_per_table&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;answers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;cognee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;recall&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;What problems did customers report, and how were they resolved?&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;datasets&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;zendesk&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The connector takes an email plus API token, as the issue asked, or an OAuth access token. That second option turned out to matter: &lt;strong&gt;Zendesk is retiring API tokens&lt;/strong&gt;. Accounts created after 28 July 2026 can't create them (my trial couldn't), creation stops on 27 October 2026, and existing tokens stop working on 30 April 2027.&lt;/p&gt;

&lt;h2&gt;
  
  
  What cognee answered, before and after a delete
&lt;/h2&gt;

&lt;p&gt;On a Zendesk trial with a few tickets and sample Help Center articles, with OpenAI as the LLM, I asked:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What problems did customers report, and how were they resolved?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Before:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn5t0wip3g7zwk5mrj256.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn5t0wip3g7zwk5mrj256.png" alt="Before: cognee names the duplicate October charge and the 500 error after a password reset" width="800" height="193"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;cognee's answer named a duplicate October charge (refunded within five days) and a 500 error after a password reset.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Then I deleted ticket 3&lt;/strong&gt;, the duplicate-charge ticket, in Zendesk:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwjawjggudswhpyx5cffl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwjawjggudswhpyx5cffl.png" alt="Ticket 3 deleted in Zendesk" width="799" height="297"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;After&lt;/strong&gt; the next sync, the same question:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbbwdu6tgtsvofhlbvqaf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbbwdu6tgtsvofhlbvqaf.png" alt="After: cognee only names the 500 error after a password reset" width="799" height="230"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The answer only named the 500 error after a password reset (plus the return policy, from a Help Center article). The duplicate charge was gone, and the dataset went from 4 items to 3.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it keeps up
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Tickets&lt;/strong&gt; come from Zendesk's cursor-based incremental ticket export. The cursor lives in dlt state and is saved only after a successful load. Each ticket becomes one document with its whole comment thread, so a reply makes sense next to the question it answers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deleted tickets&lt;/strong&gt; come back in that export with &lt;code&gt;status="deleted"&lt;/code&gt;, so they become &lt;code&gt;_deleted&lt;/code&gt; tombstones and cognee's orphan cleanup removes them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Articles have no delete feed.&lt;/strong&gt; Each run lists all articles with cursor pagination, and an article that is missing from a complete listing, or turned back into a draft, is forgotten. To make sure a short or shifting listing never forgets anything by mistake, the listing is checked against the &lt;code&gt;count&lt;/code&gt; Zendesk reports.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Internal notes and email addresses are off by default.&lt;/strong&gt; An agent should not quote an internal note as if it were something the customer was told.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The live runs, through a real dlt merge:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. first sync                     3 tickets, 1 tombstone (a ticket deleted earlier)
2. published three articles       3 articles
3. replied on ticket 3, edited an article    ticket 3 and that article only
4. deleted ticket 4, archived an article     1 deleted, 1 removed
5. internal note added to ticket 2           re-synced, the note stayed out of the document
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Errors never delete
&lt;/h2&gt;

&lt;p&gt;This was the theme of the review. Only a ticket marked &lt;code&gt;deleted&lt;/code&gt; in the export, a ticket whose comments answer 404/410, or an article missing from a complete listing removes data. Everything else keeps the previous state:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;one ticket whose comments can't be read is set aside and retried on the next runs, while the rest of the page syncs;&lt;/li&gt;
&lt;li&gt;tickets and articles fail separately, so a broken Help Center doesn't stop ticket sync;&lt;/li&gt;
&lt;li&gt;three 5xx in a row stop the run cleanly, and a &lt;code&gt;Retry-After&lt;/code&gt; over 30 seconds isn't slept through;&lt;/li&gt;
&lt;li&gt;a large account's first backfill saves its progress every 1,000 tickets, so an expiring OAuth token never throws the whole run away.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Checking my own work
&lt;/h2&gt;

&lt;p&gt;Two bugs I found myself after opening the pull request:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;An assignee who hadn't replied showed up as &lt;code&gt;user &amp;lt;id&amp;gt;&lt;/code&gt;.&lt;/strong&gt; A requester or assignee who never commented isn't in the ticket's comment data, so the connector now looks them up with &lt;code&gt;users/show_many&lt;/code&gt;, and every ticket names them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A ticket deleted and then restored between two syncs stayed forgotten.&lt;/strong&gt; The export returned both versions, and the delete won. Now the newest version wins, so a restored ticket stays.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Before the review, I also went through the review points raised on other connectors in this batch, and the Calendar connector's port into cognee core, and fixed what applied to mine, each with a test that fails without the fix. That's most of why there are 101 tests.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;For a sync connector, the happy path is the easy part. Getting tickets into memory came first; most of the work after that went into what happens when something fails halfway, and making sure every failure leaves memory exactly as it was. The question that drove most of it was a reviewer's "what happens if…". I now ask it myself before anyone else does.&lt;/p&gt;

&lt;p&gt;The setup steps are in the README in the &lt;a href="https://github.com/topoteretes/cognee-community/pull/356/files" rel="noopener noreferrer"&gt;pull request&lt;/a&gt;, and &lt;code&gt;examples/example.py&lt;/code&gt; is the script I used for this post.&lt;/p&gt;

</description>
      <category>cognee</category>
      <category>opensource</category>
      <category>python</category>
      <category>ai</category>
    </item>
    <item>
      <title>Mergetober: a CRM memory that forgets, with cognee and HubSpot</title>
      <dc:creator>Oscar Kandir</dc:creator>
      <pubDate>Sat, 31 Oct 2026 17:51:36 +0000</pubDate>
      <link>https://dev.to/oscar_kandir_4ce4f97c3d43/mergetober-a-crm-memory-that-forgets-with-cognee-and-hubspot-278</link>
      <guid>https://dev.to/oscar_kandir_4ce4f97c3d43/mergetober-a-crm-memory-that-forgets-with-cognee-and-hubspot-278</guid>
      <description>&lt;p&gt;A CRM holds a lot of small facts that only make sense together: this contact works for that company, this deal needs a discount, that discount needs someone's approval. An agent that can answer "what does Northwind want, and who has to sign off?" needs all of those links, and it needs to drop them again when the CRM changes.&lt;/p&gt;

&lt;p&gt;For Mergetober I built a HubSpot connector for &lt;a href="https://github.com/topoteretes/cognee" rel="noopener noreferrer"&gt;cognee&lt;/a&gt;. It syncs contacts, companies, deals, tickets and notes with the relationships between them, picks up only what changed, and forgets what is deleted or merged away.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pull request: &lt;a href="https://github.com/topoteretes/cognee-community/pull/376" rel="noopener noreferrer"&gt;topoteretes/cognee-community#376&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Issue: &lt;a href="https://github.com/topoteretes/cognee/issues/4546" rel="noopener noreferrer"&gt;topoteretes/cognee#4546&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Setting it up
&lt;/h2&gt;

&lt;p&gt;The connector works with a HubSpot OAuth app (read scopes only) or a Service Key. &lt;code&gt;examples/get_refresh_token.py&lt;/code&gt; gets the refresh token in one step: a browser consent, and the token is saved to a private file, never printed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;cognee&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;cognee_community_connector_hubspot&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;hubspot_source&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;cognee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;remember&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nf"&gt;hubspot_source&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;objects&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;contacts&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;companies&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;deals&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;tickets&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;notes&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt;
    &lt;span class="n"&gt;dataset_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;hubspot_crm&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;primary_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;write_disposition&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;merge&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;max_rows_per_table&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Remember, then forget
&lt;/h2&gt;

&lt;p&gt;On a free HubSpot account I set up a company with two contacts, a deal, a ticket and a note, next to HubSpot's own sample records:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fawxij2uyvewwr168ou4d.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fawxij2uyvewwr168ou4d.jpeg" alt="The test records in HubSpot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then I synced it and asked cognee (with OpenAI as the LLM):&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What discount does Northwind want on the Warehouse Fleet Renewal, who must approve it, and which company does Priya Raman work for?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Before:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fl81dob68m1cqcf155vno.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fl81dob68m1cqcf155vno.png" alt="Before: cognee names the 12% discount, Arjun Mehta as approver, and Northwind Robotics"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Northwind wants a 12% discount if it signs before November 15, 2026. Arjun Mehta must approve it because it exceeds 10%. Priya Raman works for Northwind Robotics.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then I synced it and asked cognee (with OpenAI as the LLM):&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What discount does Northwind want on the Warehouse Fleet Renewal, who must approve it, and which company does Priya Raman work for?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Before:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fl81dob68m1cqcf155vno.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fl81dob68m1cqcf155vno.png" alt="Before: cognee names the 12% discount, Arjun Mehta as approver, and Northwind Robotics"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Northwind wants a 12% discount if it signs before November 15, 2026. Arjun Mehta must approve it because it exceeds 10%. Priya Raman works for Northwind Robotics.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then, in HubSpot, I deleted the note that held the discount, deleted Arjun Mehta, and renamed the company to Northwind Automation. Deleted records go to a restorable list, kept 90 days, and that list is what the connector reads:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxgphzdff21gqtiuy71dh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxgphzdff21gqtiuy71dh.png" alt="HubSpot's list of deleted records, with the note and Arjun Mehta"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;After&lt;/strong&gt; the next sync, the same question:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp19zes1v91fy08dl4lqk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp19zes1v91fy08dl4lqk.png" alt="After: discount and approver not specified, Priya at Northwind Automation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Discount: Not specified in the context. Approver: Not specified in the context. Priya Raman's company: Northwind Automation.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;(The screenshots are from the repeat run, after restoring everything and deleting it again; the answers were the same both times.)&lt;/p&gt;

&lt;p&gt;The discount lived only in the note, so it is forgotten. Arjun is gone from his own document and from the company's. And Priya, whose record I never touched, now works for the company's new name. I then restored everything from HubSpot's recycle bin, deleted it again, and both answers came back the same way.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two decisions that changed from my plan
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;I didn't wrap dlt's verified HubSpot source.&lt;/strong&gt; It's the obvious starting point, so I ran it on my account first. It's distributed through &lt;code&gt;dlt init&lt;/code&gt; (copied into a project), not as a package a connector can depend on, and it had no cursor for CRM objects, no engagements (notes, calls, meetings), and no delete propagation: a contact I deleted was still there after a re-run. It also read every property. The connector uses the same dlt HTTP layer (&lt;code&gt;RESTClient&lt;/code&gt;) with its own sync on top.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Documents, not tables.&lt;/strong&gt; On the issue I proposed keeping CRM objects relational, so associations would become graph edges. Then I read how cognee's relational path works: it links rows only through database foreign keys, and dlt doesn't create those, so the association tables would have landed as unconnected rows. Writing the linked records into each document by name gives cognify the relationships directly.&lt;/p&gt;

&lt;h2&gt;
  
  
  How relationships become a graph
&lt;/h2&gt;

&lt;p&gt;Each record is one document that names what it is linked to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Contact: Priya Raman &amp;lt;priya@northwind.example.com&amp;gt;
  Job title: Head of Operations
  Companies: Northwind Robotics (northwind-robotics.example)
  Deals: Warehouse Fleet Renewal (48000, Appointment Scheduled)
  Tickets: Robot arm calibration fails after update (New)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;cognify turns those names into entities, so one company mentioned in many documents becomes one node in the graph. That is also why a rename has to re-render every document that names the company, not just the company itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  The tricky cases
&lt;/h2&gt;

&lt;p&gt;Most of the work went into things that only show up on a real account:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Deleted records drop their associations.&lt;/strong&gt; When a contact is deleted, HubSpot no longer lists her as linked to her company, so reading the company again shows nothing to update. The connector keeps its own index of which documents name which records, so the company's document drops her name too.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Merged records never show up as deleted.&lt;/strong&gt; The merged-away id only appears in the survivor's &lt;code&gt;hs_merged_object_ids&lt;/code&gt;, so the connector tombstones it from there.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HubSpot touches records on its own.&lt;/strong&gt; After I deleted the note, HubSpot recalculated the deal's activity fields a few minutes later. Every touch re-rendered the contact and company linked to the deal, with identical content. Now only a changed label or a changed set of links refreshes linked documents.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Search stops at 10,000 results.&lt;/strong&gt; A window with more changes restarts from the last timestamp seen, without skipping or repeating records.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Access tokens last 30 minutes.&lt;/strong&gt; A long first sync would have failed halfway, and failed the same way on every retry. A 401 now mints a new token and retries once.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Deletes come from HubSpot's archived list, which keeps deleted records for 90 days. GDPR deletes, or records archived longer ago, need &lt;code&gt;reconcile_deletes=True&lt;/code&gt;, which compares a full id listing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checking my own work
&lt;/h2&gt;

&lt;p&gt;Two bugs I found while preparing the review fixes, before anyone else did:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;An empty response could forget the whole CRM.&lt;/strong&gt; A &lt;code&gt;200&lt;/code&gt; with an empty body was read as &lt;code&gt;{}&lt;/code&gt;. With &lt;code&gt;reconcile_deletes=True&lt;/code&gt;, an empty id listing looked like "no records left", and every stored record would have been marked deleted. Any &lt;code&gt;200&lt;/code&gt; without a JSON object now stops the run before anything is forgotten, tested through the real HTTP client.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;My forget test proved too little.&lt;/strong&gt; It stayed green even with the hard-delete marker switched off. It now checks that the deleted note's and contact's records are really gone from cognee, and that an untouched note keeps its id.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And from the live runs: the first read titled notes by id (&lt;code&gt;Note 405507740407&lt;/code&gt;), since HubSpot notes have no subject. They now use the start of their text.&lt;/p&gt;

&lt;h2&gt;
  
  
  Privacy
&lt;/h2&gt;

&lt;p&gt;Contacts have about 90 properties by default, including date of birth and gender. The connector reads an allowlist of properties, and the sensitive ones are never requested unless you ask for them with &lt;code&gt;extra_properties&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;In a CRM, a delete is never just one record. Arjun's contact was one row, but his name was on the company's document too, and HubSpot stopped listing the link the moment he was deleted, so there was nothing left to tell the company's document to change. Relationships are where memory goes stale. Now, for every connector, I ask: when this record changes or disappears, which &lt;em&gt;other&lt;/em&gt; documents mention it?&lt;/p&gt;

&lt;p&gt;The setup steps are in the README in the &lt;a href="https://github.com/topoteretes/cognee-community/pull/376/files" rel="noopener noreferrer"&gt;pull request&lt;/a&gt;, and &lt;code&gt;examples/example.py&lt;/code&gt; syncs your CRM and asks it a question.&lt;/p&gt;

</description>
      <category>cognee</category>
      <category>opensource</category>
      <category>python</category>
      <category>ai</category>
    </item>
    <item>
      <title>Mergetober: keeping an agent in sync with a Sanity CMS, with cognee</title>
      <dc:creator>Oscar Kandir</dc:creator>
      <pubDate>Sat, 31 Oct 2026 17:28:03 +0000</pubDate>
      <link>https://dev.to/oscar_kandir_4ce4f97c3d43/mergetober-keeping-an-agent-in-sync-with-a-sanity-cms-with-cognee-4bnj</link>
      <guid>https://dev.to/oscar_kandir_4ce4f97c3d43/mergetober-keeping-an-agent-in-sync-with-a-sanity-cms-with-cognee-4bnj</guid>
      <description>&lt;p&gt;A headless CMS like Sanity is where a company's published knowledge lives: articles, authors, product pages, docs. An agent that answers questions about that content needs to stay in step with it: when an article is edited, unpublished or deleted, its answers should change too.&lt;/p&gt;

&lt;p&gt;For Mergetober I built a Sanity connector for &lt;a href="https://github.com/topoteretes/cognee" rel="noopener noreferrer"&gt;cognee&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pull request: &lt;a href="https://github.com/topoteretes/cognee-community/pull/460" rel="noopener noreferrer"&gt;topoteretes/cognee-community#460&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Issue: &lt;a href="https://github.com/topoteretes/cognee/issues/4788" rel="noopener noreferrer"&gt;topoteretes/cognee#4788&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The demo: a rename that doesn't touch the article
&lt;/h2&gt;

&lt;p&gt;I wrote an author, Priya Raman, and two articles that reference her: "Who owns billing" and "Q4 migration plan". Then I synced them into cognee (OpenAI as the LLM) and asked:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Who wrote the article 'Who owns billing', and who should billing incidents be escalated to?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ff36m7bm34mrf1c6lxag7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ff36m7bm34mrf1c6lxag7.png" alt="Before: cognee answers that Priya Raman wrote the billing article" width="800" height="241"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Priya Raman wrote it. Billing incidents should be escalated to the Payments on-call engineer within 30 minutes.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then I renamed the author to Priya Iyer (through the API: my test project has no Studio deployed, and the connector doesn’t need one). Only the author document changed. Here's what Sanity says about the billing article itself, before and after the rename, and what the next sync did:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3qjiqvuqbw6j8loqad1r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3qjiqvuqbw6j8loqad1r.png" alt="The author renamed: the article's _rev and _updatedAt unchanged, reference_updates 2, and cognee now answers Priya Iyer" width="799" height="165"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The article's revision id (&lt;code&gt;SfcI2UfJhIU74ahVojMxr6&lt;/code&gt;) and its &lt;code&gt;_updatedAt&lt;/code&gt; are exactly the same before and after. To any sync that re-reads changed documents, by &lt;code&gt;_rev&lt;/code&gt; or by &lt;code&gt;_updatedAt&lt;/code&gt;, nothing happened to it, and its document in memory would keep saying "Priya Raman" for good. This connector tracks the revisions of the documents each article &lt;em&gt;references&lt;/em&gt; too, so the author's new revision re-rendered both articles that point to her (&lt;code&gt;changed 1, reference_updates 2&lt;/code&gt;), and the same question now gets:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Priya Iyer wrote it. Billing incidents should be escalated to the Payments on-call engineer within 30 minutes.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Setting it up
&lt;/h2&gt;

&lt;p&gt;A read-only &lt;strong&gt;Viewer&lt;/strong&gt; token is enough. You choose which document types to sync, because a dataset also holds system and plugin documents you don't want in memory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;cognee&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;cognee_community_connector_sanity&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;sanity_source&lt;/span&gt;

&lt;span class="n"&gt;source&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;sanity_source&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;project_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;abc123xy&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;dataset&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;production&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;document_types&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;article&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;author&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;SANITY_TOKEN&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;cognee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;remember&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;dataset_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sanity_content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;primary_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;write_disposition&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;merge&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;max_rows_per_table&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each published document becomes one cognee document: its fields as &lt;code&gt;Field: value&lt;/code&gt; lines, Portable Text as paragraphs, references as the referenced document's name or title, and images as their alt text and caption. The connector also reads the project's deployed schema and ingests it as one document that describes the selected types and their fields, so the agent knows what an "article" is. An optional groq_filter narrows the selection further, for example to one language or one section of the site.&lt;/p&gt;

&lt;h2&gt;
  
  
  No timestamp cursor
&lt;/h2&gt;

&lt;p&gt;My plan on the issue was a &lt;code&gt;_updatedAt&lt;/code&gt; cursor. I dropped it. To forget deleted documents, the connector needs the full list of ids anyway, and with each document's &lt;code&gt;_rev&lt;/code&gt; (its revision id) in that list, the list already says what changed. That avoids the problem of several writes landing in the same second, and there's no timestamp to store. It costs one request per 1,000 documents.&lt;/p&gt;

&lt;h2&gt;
  
  
  How references are followed
&lt;/h2&gt;

&lt;p&gt;Each document's references are rendered by name: an article shows &lt;code&gt;Author: Priya Iyer&lt;/code&gt;, not an id. That's what makes the rename above a problem in the first place. So the connector keeps, for each synced document, the revisions of the documents it references. When one of those changes or is deleted, every document pointing to it is re-rendered. In the first live check, renaming an author re-rendered all four articles that referenced her (&lt;code&gt;reference_updates: 4&lt;/code&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  An empty listing never forgets on its own
&lt;/h2&gt;

&lt;p&gt;This is the safety rule I care most about in this connector. In the live run I found that a &lt;strong&gt;private dataset read without a working token doesn't return an error. It returns no documents.&lt;/strong&gt; So does a mistyped document type. A connector that trusts that listing would forget everything.&lt;/p&gt;

&lt;p&gt;If a run lists nothing but earlier runs synced documents, the connector raises and forgets nothing. &lt;code&gt;allow_empty_listing=True&lt;/code&gt; is there for a real "everything was deleted". Both cases ran live, and the table was unchanged both times:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;8a. document_types mistyped as 'artcle'
   -&amp;gt; stopped: guard held, rows in table: 5 before, 5 after
8b. no token, dataset set to private
   -&amp;gt; stopped: guard held, rows in table: 5 before, 5 after
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The schema document follows the same rule: only a token can read it, even in a public dataset, so "no schema" may just mean the token stopped working. Turning &lt;code&gt;include_schema&lt;/code&gt; off is what forgets it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The rest of the live run
&lt;/h2&gt;

&lt;p&gt;(Step 1 was the first sync, step 3 the author rename covered above, and step 8 the empty-listing guard.)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2. edit + new article in ONE transaction (same _updatedAt): both appear
4. unpublished draft of article 1: nothing changes
5. article 3 deleted                 deleted: 1
6. no changes: nothing fetched
7. deployed schema document: found
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;A document can change without changing. The text an agent reads is built from the article &lt;em&gt;and&lt;/em&gt; everything it points to, so "has this document changed?" is the wrong question. The right one is "has anything this document shows changed?" I now ask that about every connector: what does the rendered text depend on, and does the sync notice when any of it moves?&lt;/p&gt;

&lt;p&gt;One more thing I checked: &lt;code&gt;cognee.forget(dataset=...)&lt;/code&gt; alone doesn't remove synced documents for good, because dlt keeps its staging copy and the next sync brings them back. The README says so: to forget a document, delete or unpublish it in Sanity, or drop its type.&lt;/p&gt;

&lt;p&gt;The setup steps are in the README in the &lt;a href="https://github.com/topoteretes/cognee-community/pull/460/files" rel="noopener noreferrer"&gt;pull request&lt;/a&gt;, and &lt;code&gt;examples/example.py&lt;/code&gt; syncs a dataset and asks it a question.&lt;/p&gt;

</description>
      <category>cognee</category>
      <category>opensource</category>
      <category>python</category>
      <category>ai</category>
    </item>
    <item>
      <title>Mergetober: when updated_at isn't enough, building a Crisp connector for cognee</title>
      <dc:creator>Oscar Kandir</dc:creator>
      <pubDate>Sat, 31 Oct 2026 17:11:26 +0000</pubDate>
      <link>https://dev.to/oscar_kandir_4ce4f97c3d43/mergetober-when-updatedat-isnt-enough-building-a-crisp-connector-for-cognee-336h</link>
      <guid>https://dev.to/oscar_kandir_4ce4f97c3d43/mergetober-when-updatedat-isnt-enough-building-a-crisp-connector-for-cognee-336h</guid>
      <description>&lt;p&gt;Crisp chats are short and there are lots of them: a visitor asks something, an operator answers, maybe someone leaves an internal note. One message on its own ("thanks!") means nothing, so the issue asked for one node per conversation, with incremental sync on the conversation's &lt;code&gt;updated_at&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Before proposing anything for Mergetober, I tested that idea on a free Crisp workspace. It turned out &lt;code&gt;updated_at&lt;/code&gt; misses most kinds of change. Here's the clearest one.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pull request: &lt;a href="https://github.com/topoteretes/cognee-community/pull/589" rel="noopener noreferrer"&gt;topoteretes/cognee-community#589&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Issue: &lt;a href="https://github.com/topoteretes/cognee/issues/4737" rel="noopener noreferrer"&gt;topoteretes/cognee#4737&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The demo: an edit that Crisp's timestamp doesn't see
&lt;/h2&gt;

&lt;p&gt;I created a conversation where a customer, Priya, reports that order #4471 arrived with a cracked screen, and the operator replies that a replacement &lt;em&gt;"ships on Monday"&lt;/em&gt;. Priya says thanks. I synced the workspace into cognee (OpenAI as the LLM) and asked:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When will Priya's replacement order ship, and what was wrong with her order?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fptc0y27pbi1ht5llsos5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fptc0y27pbi1ht5llsos5.png" alt="Before: cognee answers that Priya's replacement ships on Monday" width="800" height="269"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Priya's replacement order will ship on Monday. Her original order arrived with a cracked screen.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then I edited the operator's old reply, "Monday" to "Thursday", the way an operator fixes a mistake after the fact. No new message, nothing else touched.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftckdcmoq0z4nmqtnqn95.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftckdcmoq0z4nmqtnqn95.png" alt="Priya's conversation in Crisp, with the operator's old reply edited to Thursday" width="800" height="758"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And here's the important part: the conversation's &lt;code&gt;updated_at&lt;/code&gt;, the field the issue suggested for incremental sync, before and after the edit, and what cognee answered on the next sync:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcezraiio521s4vgl35qv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcezraiio521s4vgl35qv.png" alt="The old reply edited through the API: updated_at unchanged, and cognee now answers Thursday" width="799" height="287"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;updated_at&lt;/code&gt; didn't move: 21:25:00 before the edit, 21:25:00 after it. A connector that only follows it would never re-read this conversation, and the agent would keep telling people "Monday" for good. This one re-reads recently active conversations every run, so the next sync picked the edit up (&lt;code&gt;scanned 1&lt;/code&gt;):&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Priya's replacement order will ship on Thursday. Her original order (#4471) arrived with a cracked screen.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;One more thing I noticed: in an earlier run I made the same edit in the Crisp app instead of through the API, and that time &lt;code&gt;updated_at&lt;/code&gt; &lt;em&gt;did&lt;/em&gt; move. I can't tell whether the app edit or simply opening the conversation as an operator moved it, which is exactly why the connector doesn't depend on it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What moves &lt;code&gt;updated_at&lt;/code&gt;, and what doesn't
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Change&lt;/th&gt;
&lt;th&gt;
&lt;code&gt;updated_at&lt;/code&gt; moved?&lt;/th&gt;
&lt;th&gt;Visible in the conversation list?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;New message&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Edit a message, old or newest (through the API)&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Edit an internal note&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Remove a message&lt;/td&gt;
&lt;td&gt;no, even the newest one&lt;/td&gt;
&lt;td&gt;no: the list still shows the removed reply as &lt;code&gt;last_message&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Visitor nickname or segments&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;yes, in &lt;code&gt;meta&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Resolve&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;yes, in &lt;code&gt;state&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Remove the conversation&lt;/td&gt;
&lt;td&gt;– (GET and HEAD answer 404)&lt;/td&gt;
&lt;td&gt;it drops out of the list&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A connector that only follows &lt;code&gt;updated_at&lt;/code&gt; would only ever see new messages. Edits and removals would stay in memory for good.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it syncs instead
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Every run reads the full conversation list&lt;/strong&gt; (50 a page, with &lt;code&gt;include_empty=1&lt;/code&gt;, because empty conversations are hidden otherwise). A history is read again when its &lt;code&gt;updated_at&lt;/code&gt;, state or visitor details changed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Edits and removals leave no trace outside the history&lt;/strong&gt;, so each run also re-reads conversations active in the last few days, plus a rotating batch of older ones. Unchanged conversations are skipped by fingerprint. An edit in a recent conversation lands on the next sync, and one in an older conversation within one rotation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A stored conversation missing from the list is checked with HEAD&lt;/strong&gt; and forgotten on a 404. A made-up id answers 404 too, so this only applies to conversations synced before, and only after the whole list was read.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Requests have a budget.&lt;/strong&gt; A website token gets 10,000 requests a day. Each run stops cleanly at its own budget, and Crisp reports no request counters, only &lt;code&gt;x-rate-limit-watermarks: g=low;u=low;r=low&lt;/code&gt;, so the client pauses when one reads &lt;code&gt;high&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Setting it up
&lt;/h2&gt;

&lt;p&gt;A website token (identifier and key) from &lt;strong&gt;Settings → Workspace Settings → Advanced configuration&lt;/strong&gt;, and the website id. The &lt;strong&gt;Free plan is enough&lt;/strong&gt;: the connector only reads conversations, and reading works on Free. (Only &lt;em&gt;creating&lt;/em&gt; internal notes through the API needs a paid plan, which matters for testing, not for syncing.)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;cognee&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;cognee_community_connector_crisp&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;crisp_source&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;cognee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;remember&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nf"&gt;crisp_source&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;website_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;website_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;identifier&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;identifier&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;dataset_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;crisp&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;primary_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;write_disposition&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;merge&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;max_rows_per_table&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each conversation renders as &lt;code&gt;Visitor (name)&lt;/code&gt;, &lt;code&gt;Operator (name)&lt;/code&gt; and &lt;code&gt;Internal note (name)&lt;/code&gt; lines in time order, with edited messages in their current form. State changes and other event messages are left out. &lt;code&gt;visitor_fields&lt;/code&gt; chooses which visitor details go in the header. The default is the nickname and segments; email, phone and IP only reach a document if you list them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Live run
&lt;/h2&gt;

&lt;p&gt;On my Crisp workspace, through a real dlt merge:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Step&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;First sync&lt;/td&gt;
&lt;td&gt;both test conversations stored (with two older ones: &lt;code&gt;scanned: 4&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;An old message edited, nothing else&lt;/td&gt;
&lt;td&gt;caught by the recent window: &lt;code&gt;scanned: 1&lt;/code&gt;, the edit in the document&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The visitor renamed&lt;/td&gt;
&lt;td&gt;seen in the list: &lt;code&gt;scanned: 1&lt;/code&gt;, the new name in the document&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A message removed from A, conversation B removed&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;scanned: 1&lt;/code&gt;, &lt;code&gt;deleted: 1&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Nothing changed&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;scanned: 0&lt;/code&gt;, &lt;code&gt;deleted: 0&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;One honest gap: my workspace's trial ended just before the final run, and the Free plan refuses to create internal notes through the API (&lt;code&gt;HTTP 402, subscription_upgrade_required&lt;/code&gt;). I had tested notes live while writing the proposal, and the tests cover note labelling and &lt;code&gt;include_notes=False&lt;/code&gt;. The live table above just doesn't include one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checking my own work
&lt;/h2&gt;

&lt;p&gt;Before opening the pull request, I went through my proposal line by line against the code. Two things I had promised weren't there, and the check turned up one bug:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Backing off when a rate-limit watermark reads &lt;code&gt;high&lt;/code&gt;.&lt;/strong&gt; The client handled 420 and 429, but ignored the watermark header I had written about myself. It now pauses before the next request.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Visitor fields as config.&lt;/strong&gt; The nickname and segments were fixed. &lt;code&gt;visitor_fields&lt;/code&gt; now chooses them, with email, phone and IP off unless you list them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A conversation removed in the middle of a sync&lt;/strong&gt; answered 404 when its history was read, and that failed the whole run. Now it's skipped, and the next sync forgets it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each fix has a test that fails on the old code. Two smaller lessons came from preparing the live checks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The first draft of my live-check script edited an old message &lt;strong&gt;and&lt;/strong&gt; renamed the visitor in the same step. The rename alone forces a re-read, so that step couldn't have shown the edit was caught. I split it before running it: a check has to change one thing at a time.&lt;/li&gt;
&lt;li&gt;My demo script printed the measured &lt;code&gt;updated_at&lt;/code&gt; times, but next to them a fixed sentence saying they hadn't moved. In the run where I edited in the app, they had. The script now compares them and says which happened.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;Measure, don't assume, even your own findings. My proposal said editing a message doesn't move &lt;code&gt;updated_at&lt;/code&gt;. That held when I edited through the API, but not when I made the same edit in the Crisp app. So the connector doesn't trust &lt;code&gt;updated_at&lt;/code&gt; for edits at all: it re-reads what changed recently and lets the fingerprint decide what's really new.&lt;/p&gt;

&lt;p&gt;The setup steps are in the README in the &lt;a href="https://github.com/topoteretes/cognee-community/pull/589/files" rel="noopener noreferrer"&gt;pull request&lt;/a&gt;, and &lt;code&gt;examples/example.py&lt;/code&gt; remembers a workspace and asks it a question.&lt;/p&gt;

</description>
      <category>cognee</category>
      <category>opensource</category>
      <category>python</category>
      <category>ai</category>
    </item>
    <item>
      <title>Mergetober: two places a deleted thing can hide, building a Zoho Desk connector for cognee</title>
      <dc:creator>Oscar Kandir</dc:creator>
      <pubDate>Sat, 31 Oct 2026 17:11:16 +0000</pubDate>
      <link>https://dev.to/oscar_kandir_4ce4f97c3d43/mergetober-two-places-a-deleted-thing-can-hide-building-a-zoho-desk-connector-for-cognee-347h</link>
      <guid>https://dev.to/oscar_kandir_4ce4f97c3d43/mergetober-two-places-a-deleted-thing-can-hide-building-a-zoho-desk-connector-for-cognee-347h</guid>
      <description>&lt;p&gt;Teams on Zoho's suite keep their support history in Zoho Desk: customer problems, agent replies, internal comments and knowledge-base articles. Zoho CRM had a cognee issue of its own, but Desk is a separate product with its own API, and nobody had proposed a connector for it. So I wrote the issue, tested the API on a trial account, and built it for Mergetober.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pull request: &lt;a href="https://github.com/topoteretes/cognee-community/pull/588" rel="noopener noreferrer"&gt;topoteretes/cognee-community#588&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Issue: &lt;a href="https://github.com/topoteretes/cognee/issues/6034" rel="noopener noreferrer"&gt;topoteretes/cognee#6034&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The demo: a deleted article the API still calls "Published"
&lt;/h2&gt;

&lt;p&gt;I set up a small support case in Zoho Desk: a ticket from a customer whose password reset email never arrived, with an internal comment from the agent ("our mail provider was flagging reset emails as spam, fixed the SPF record"), and a knowledge-base article saying reset links stay valid for 15 minutes. Then I synced it into cognee (OpenAI as the LLM) and asked one question that needs both:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How long does a password reset link stay valid, and why were customers not receiving password reset emails?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4nx8akkd5hu976vr82yc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4nx8akkd5hu976vr82yc.png" alt="Before: cognee answers with the 15-minute link validity and the spam fix" width="800" height="268"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Validity: Password reset links stay valid for 15 minutes. After that, request a new link from the sign-in page.&lt;/p&gt;

&lt;p&gt;Why emails weren't received: The mail provider/server was flagging reset emails as spam due to an SPF record issue. The SPF record was fixed.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The 15 minutes came from the article, and the spam fix from the ticket's internal comment. Here's the article in Zoho Desk:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhiremtq1mvgbupyn9co9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhiremtq1mvgbupyn9co9.png" alt="The knowledge-base article in Zoho Desk" width="800" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then I deleted the article. This is what the Zoho Desk API said about it right afterwards:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbk3ofe7ojr2s6q2qmk3z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbk3ofe7ojr2s6q2qmk3z.png" alt="After the delete: not in the Recycle Bin, gone from the listing, but still Published with isTrashed true" width="797" height="111"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It isn't in the Recycle Bin, where deleted tickets go. It's gone from the article listing. But looked up by id it still answers &lt;strong&gt;200&lt;/strong&gt;, with &lt;strong&gt;&lt;code&gt;status: Published&lt;/code&gt;&lt;/strong&gt;. Only &lt;code&gt;isTrashed: true&lt;/code&gt; says it's been deleted. A connector that checks the status, or one that waits for the article to show up in the Recycle Bin, would keep it in memory for good.&lt;/p&gt;

&lt;p&gt;The next sync forgot it (&lt;code&gt;deleted 1&lt;/code&gt;), and the same question now gets:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjgr335u5v4qxo5gdln6h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjgr335u5v4qxo5gdln6h.png" alt="After the sync: cognee no longer knows how long a reset link stays valid" width="799" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Validity: The context does not specify how long a password reset link remains valid.&lt;/p&gt;

&lt;p&gt;Why emails weren't received: The mail provider/server flagged the reset emails as spam due to an SPF record issue. The SPF record was fixed.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The article is gone from memory, and the ticket, which nobody touched, still answers its half of the question.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting it up
&lt;/h2&gt;

&lt;p&gt;The one-time setup, in the API console for your data center (&lt;code&gt;api-console.zoho.com&lt;/code&gt;, &lt;code&gt;.eu&lt;/code&gt;, &lt;code&gt;.in&lt;/code&gt;, …):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Add Client → Self Client&lt;/strong&gt;, and note the Client ID and Client Secret.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Generate Code&lt;/strong&gt; with these read-only scopes:
&lt;code&gt;Desk.tickets.READ,Desk.basic.READ,Desk.search.READ,Desk.articles.READ,Desk.contacts.READ,Desk.settings.READ&lt;/code&gt;
That's three more than I planned on the issue: &lt;code&gt;search&lt;/code&gt; for the incremental sync, &lt;code&gt;contacts&lt;/code&gt; for customer names, and &lt;code&gt;settings&lt;/code&gt; for the Recycle Bin.&lt;/li&gt;
&lt;li&gt;Exchange the code for a refresh token once (the README has the exact request). The refresh token doesn't expire until you revoke it, so keep it like a password.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Zoho's &lt;strong&gt;Self Client&lt;/strong&gt; gives you a refresh token straight from the API console, with no redirect server. The scopes are read-only, and the data center (&lt;code&gt;com&lt;/code&gt;, &lt;code&gt;eu&lt;/code&gt;, &lt;code&gt;in&lt;/code&gt;, …) picks the domains:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;cognee&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;cognee_community_connector_zoho_desk&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;zoho_desk_source&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;cognee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;remember&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nf"&gt;zoho_desk_source&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;data_center&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;com&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;client_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;client_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;client_secret&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;client_secret&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;refresh_token&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;refresh_token&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;dataset_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;zoho_desk&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;primary_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;write_disposition&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;merge&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;max_rows_per_table&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each ticket becomes one document: number, subject, department, status, priority, channel, assignee and customer name, then every thread and comment in time order, labelled &lt;code&gt;Customer&lt;/code&gt;, &lt;code&gt;Agent&lt;/code&gt;, &lt;code&gt;Internal thread&lt;/code&gt;, &lt;code&gt;Internal comment&lt;/code&gt; or &lt;code&gt;Comment&lt;/code&gt;. Each published article becomes one document too. The department name is the node set, and &lt;code&gt;departments=[...]&lt;/code&gt; limits the sync. Documents carry names only, never email addresses or phone numbers.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it finds changes
&lt;/h2&gt;

&lt;p&gt;The first run reads every ticket. Later runs ask the &lt;strong&gt;Search API&lt;/strong&gt; for tickets modified since the cursor (&lt;code&gt;modifiedTimeRange&lt;/code&gt;). A new reply or comment moves a ticket's &lt;code&gt;modifiedTime&lt;/code&gt;, so a changed ticket is read again with its whole conversation. The search index can lag a little behind a change, so each window starts 10 minutes before the cursor, and tickets whose &lt;code&gt;modifiedTime&lt;/code&gt; was already synced are skipped. The cursor comes from Zoho's own &lt;code&gt;Date&lt;/code&gt; header, not from the machine running the sync.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where deleted things hide
&lt;/h2&gt;

&lt;p&gt;My issue assumed deletes were simple: Zoho Desk's Recycle Bin keeps deleted tickets and articles for 60 days, and the API lists them. Testing on a live account showed two surprises.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. A just-deleted ticket is still in search.&lt;/strong&gt; Right after I moved a ticket to the trash, the Search API still returned it, and reading its conversation answered &lt;strong&gt;403&lt;/strong&gt;. A connector that reads search results first would fail the run on a ticket that no longer exists. So each run reads the Recycle Bin first and doesn't read tickets that are in it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Deleted articles don't go to the Recycle Bin at all.&lt;/strong&gt; The first time I tested this, I published an article, deleted it, and the sync said nothing had changed. A small probe showed why (the demo above shows the same thing): a deleted article goes to the Knowledge Base's &lt;strong&gt;own trash&lt;/strong&gt;. It drops out of &lt;code&gt;/articles&lt;/code&gt;, and &lt;code&gt;GET /articles/{id}&lt;/code&gt; still answers &lt;strong&gt;200&lt;/strong&gt;, with &lt;code&gt;status: "Published"&lt;/code&gt; and &lt;code&gt;isTrashed: true&lt;/code&gt;. So the article listing is read in full every run, and a stored article that's missing from it is looked up by id and forgotten when it's trashed, unpublished or gone.&lt;/p&gt;

&lt;h2&gt;
  
  
  Live run
&lt;/h2&gt;

&lt;p&gt;On a Zoho Desk account (&lt;code&gt;.in&lt;/code&gt; data center), through a real dlt merge:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Step&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;First sync (full read)&lt;/td&gt;
&lt;td&gt;the test tickets stored with their description, no email addresses&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Internal comment added on A&lt;/td&gt;
&lt;td&gt;found through the Search API: &lt;code&gt;scanned: 1&lt;/code&gt;, the comment labelled&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;B moved to the trash&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;deleted: 1&lt;/code&gt;, A kept&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Nothing changed&lt;/td&gt;
&lt;td&gt;&lt;code&gt;scanned: 0&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Article published in the Knowledge Base&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;scanned: 1&lt;/code&gt;, the article stored&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Article deleted (Knowledge Base trash)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;deleted: 1&lt;/code&gt;, the article forgotten&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Checking my own work
&lt;/h2&gt;

&lt;p&gt;After opening the pull request, I reviewed it once more and found a gap the live run hadn't hit: a ticket deleted &lt;em&gt;between&lt;/em&gt; the Recycle Bin read and the ticket's own read answers 403, and that failed the whole run. Now it's skipped, and the next sync forgets it through the Recycle Bin. A full read also no longer looks up tickets that are already in the bin. Both fixes have tests that fail on the old code.&lt;/p&gt;

&lt;p&gt;Two things from making the demo:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;My demo script couldn't find the new article at first. Zoho Desk's listings count from 1, and asking for &lt;code&gt;from=0&lt;/code&gt; answers 422. The connector already handles that (it retries from 1), which is why the sync found the article when my script didn't. My script now does the same.&lt;/li&gt;
&lt;li&gt;In one earlier demo run, a sync a few seconds after the delete still kept the article. That run didn't measure the listing, so I can't say why. In the run above, the listing dropped the article immediately and the sync forgot it. If you see a delete take one extra sync to land, that's the case.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Credits, not just rate limits
&lt;/h2&gt;

&lt;p&gt;Zoho Desk meters API calls in &lt;strong&gt;credits per day&lt;/strong&gt;, and every answer reports how many are left (&lt;code&gt;X-Rate-Limit-Remaining-v3&lt;/code&gt;). When fewer than 50 remain, the run stops cleanly, keeps what it read, and leaves the cursor for the next run, so a sync never uses up the credits a team's other integrations need.&lt;/p&gt;

&lt;p&gt;A sync more than 50 days after the last full read lists every ticket again. The Recycle Bin keeps deletes for 60 days, so a long gap can't hide one.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;Don't trust the field that sounds right. A deleted article says &lt;code&gt;status: Published&lt;/code&gt;, and the place called "Recycle Bin" never sees it. The only honest signal was a flag I only found by deleting something and reading the whole response. For deletes, I now look at what the API &lt;em&gt;returns&lt;/em&gt; after a delete, not at what its fields are called.&lt;/p&gt;

&lt;p&gt;The setup steps are in the README in the &lt;a href="https://github.com/topoteretes/cognee-community/pull/588/files" rel="noopener noreferrer"&gt;pull request&lt;/a&gt;, and &lt;code&gt;examples/example.py&lt;/code&gt; is the script to try it.&lt;/p&gt;

</description>
      <category>cognee</category>
      <category>opensource</category>
      <category>python</category>
      <category>ai</category>
    </item>
    <item>
      <title>Mergetober: shared inbox memory that knows what the customer was told, with cognee and Front</title>
      <dc:creator>Oscar Kandir</dc:creator>
      <pubDate>Sat, 31 Oct 2026 14:54:35 +0000</pubDate>
      <link>https://dev.to/oscar_kandir_4ce4f97c3d43/mergetober-shared-inbox-memory-that-knows-what-the-customer-was-told-with-cognee-and-front-3j8c</link>
      <guid>https://dev.to/oscar_kandir_4ce4f97c3d43/mergetober-shared-inbox-memory-that-knows-what-the-customer-was-told-with-cognee-and-front-3j8c</guid>
      <description>&lt;p&gt;A shared inbox in Front mixes two kinds of text in one conversation: the messages the customer saw, and the comments the team wrote to each other. "We've refunded you" and "don't refund, they're about to churn" can sit three lines apart. An agent that blurs the two will one day tell a customer something they were never meant to hear.&lt;/p&gt;

&lt;p&gt;The issue for this connector said it directly: keep the distinction in the graph. For Mergetober I built a Front connector for &lt;a href="https://github.com/topoteretes/cognee" rel="noopener noreferrer"&gt;cognee&lt;/a&gt; around that.&lt;/p&gt;

&lt;p&gt;I picked Front because I had just built the Zendesk connector, and the hardest part there was the same problem this issue warned about: keeping internal notes apart from what the customer was told, and making sure deletes really leave memory. Front has the same shape of problem, so I wanted to see whether what I'd learned would carry over.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pull request: &lt;a href="https://github.com/topoteretes/cognee-community/pull/586" rel="noopener noreferrer"&gt;topoteretes/cognee-community#586&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Issue: &lt;a href="https://github.com/topoteretes/cognee/issues/4734" rel="noopener noreferrer"&gt;topoteretes/cognee#4734&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Setting it up
&lt;/h2&gt;

&lt;p&gt;An API token and the inboxes you want to sync:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;cognee&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;cognee_community_connector_front&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;front_source&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;cognee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;remember&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nf"&gt;front_source&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;inboxes&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;inb_...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt;
    &lt;span class="n"&gt;dataset_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;front&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;primary_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;write_disposition&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;merge&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;max_rows_per_table&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each conversation becomes one document: subject, inbox, status, assignee and tags, then every message and comment in time order. Messages are labelled &lt;code&gt;Customer (name)&lt;/code&gt; or &lt;code&gt;Teammate (name)&lt;/code&gt;, comments &lt;code&gt;Internal comment (name)&lt;/code&gt;. Each row also carries a &lt;code&gt;visibility&lt;/code&gt; column (&lt;code&gt;customer&lt;/code&gt; or &lt;code&gt;customer_and_internal&lt;/code&gt;), and &lt;code&gt;include_comments=False&lt;/code&gt; leaves comments out completely. Drafts are skipped, and no email address or phone number is written into a document.&lt;/p&gt;

&lt;h2&gt;
  
  
  What cognee answered, before and after a delete
&lt;/h2&gt;

&lt;p&gt;I seeded two conversations in a Front inbox, each with an internal comment: Maria Lopez was charged twice for her October plan, and Tom Becker couldn't log in after an app update. Then I synced the inbox into cognee (OpenAI as the LLM) and asked one question that needs both the customer's message and the team's internal note:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Why was Maria Lopez charged twice and what did the team decide about it? And what should users do if they cannot log in after the update?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn13yrbwz2innqw04decg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn13yrbwz2innqw04decg.png" alt="Before: cognee answers why Maria was charged twice and what the team decided" width="800" height="203"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Maria Lopez was charged twice due to a payment retry bug, which had been fixed on October 12. The team approved a refund for one duplicate charge.&lt;/p&gt;

&lt;p&gt;The update cleared saved sessions, so users who cannot log in should sign in again.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The cause and the decision only exist in the internal comment. The customer never saw them. That's the reason for the labels: the document says &lt;code&gt;Internal comment (name)&lt;/code&gt;, so an agent that drafts a customer reply can tell what was said to the customer and what the team said among themselves.&lt;/p&gt;

&lt;p&gt;Here's the conversation in Front, with Maria's message and the internal comment:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbe6z6txcab5x7rj2xuyv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbe6z6txcab5x7rj2xuyv.png" alt="The Front conversation, with Maria's message and the internal comment" width="799" height="356"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Then I deleted it in Front.&lt;/strong&gt; A trashed conversation stays restorable for 30 days, but it shouldn't stay in an agent's memory:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqck3hl4mbmhocmdn0j7k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqck3hl4mbmhocmdn0j7k.png" alt="The conversation in Front's Trash" width="800" height="323"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;After&lt;/strong&gt; the next sync (&lt;code&gt;scanned 0, deleted 1&lt;/code&gt;), the same question:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo8js4b4zspjlgudy325s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo8js4b4zspjlgudy325s.png" alt="After the sync: cognee no longer knows about the charge" width="800" height="145"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The context does not explain why Maria Lopez was charged twice or what the team decided. After the update, users should sign in again because it cleared saved sessions.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The charge is forgotten, and the login answer, from a conversation nobody touched, is still there. The second sync didn't re-read anything: the trashed conversation still showed up in the listing, with &lt;code&gt;status="deleted"&lt;/code&gt;, so the connector knew what to forget without fetching any messages.&lt;/p&gt;

&lt;h2&gt;
  
  
  I tested the API before proposing anything
&lt;/h2&gt;

&lt;p&gt;Several proposals on the issue planned to use Front's &lt;code&gt;/events&lt;/code&gt; feed for changes and deletes. Before writing my proposal, I set up a free developer account and tried every kind of change on a test inbox.&lt;/p&gt;

&lt;p&gt;I went in expecting the Events API to be the answer. Front records every change as an event, so a connector could just follow the feed. Then I added a comment, deleted it, and looked at the events again. The original comment event was simply gone. Deleting something in Front doesn't record a delete; it erases the history. That was the moment I stopped trusting the events feed and started designing around the listing instead.&lt;/p&gt;

&lt;p&gt;What I found:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Deleting a comment or a conversation erases its earlier events&lt;/strong&gt; instead of recording a delete, so &lt;code&gt;/events&lt;/code&gt; can't be the source of truth for deletes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tag changes don't move &lt;code&gt;updated_at&lt;/code&gt;&lt;/strong&gt;, but the conversation listing shows the current tag names.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The listing isn't ordered by &lt;code&gt;updated_at&lt;/code&gt;&lt;/strong&gt;, so you can't stop reading early at the last cursor.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Each kind of removal looks different.&lt;/strong&gt; A trashed conversation stays in the listing with &lt;code&gt;status="deleted"&lt;/code&gt;. A permanently deleted one answers 404. A merged-away one answers &lt;strong&gt;301&lt;/strong&gt; to the conversation it was merged into.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How it syncs
&lt;/h2&gt;

&lt;p&gt;Every run reads the selected inboxes' listings in full (100 conversations a page). Only conversations whose &lt;code&gt;updated_at&lt;/code&gt;, tag names, status or inbox changed have their messages and comments read again, and unchanged ones are skipped by fingerprint.&lt;/p&gt;

&lt;p&gt;A stored conversation missing from a complete listing is looked up with redirects turned off. A 404 or a 301 means it's gone, and so does a 200 in an inbox you didn't select (it was moved out). The 301 is never followed: a client that follows it would store the survivor's content under the merged-away id.&lt;/p&gt;

&lt;h2&gt;
  
  
  Live run
&lt;/h2&gt;

&lt;p&gt;On the developer account, through a real dlt merge:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Step&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;First sync&lt;/td&gt;
&lt;td&gt;conversations stored, the internal comment labelled, no email addresses&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Comment edited on A, tag added to B (tags don't move &lt;code&gt;updated_at&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;scanned: 2&lt;/code&gt;, both changes in the documents&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;B trashed, C deleted for good&lt;/td&gt;
&lt;td&gt;&lt;code&gt;deleted: 2&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Nothing changed&lt;/td&gt;
&lt;td&gt;&lt;code&gt;scanned: 0&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;B restored&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;scanned: 1&lt;/code&gt;, B is back&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Two conversations merged in the Front app&lt;/td&gt;
&lt;td&gt;the merged-away one answers 301: &lt;code&gt;deleted: 1&lt;/code&gt;, &lt;code&gt;scanned: 1&lt;/code&gt;, the survivor holds both messages&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The sync after that&lt;/td&gt;
&lt;td&gt;&lt;code&gt;scanned: 0&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Safety choices
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A failed inbox listing never forgets anything. It is retried next run while the other inboxes sync, and raises after three failed runs in a row.&lt;/li&gt;
&lt;li&gt;Rate limits depend on the company's plan, so the client paces itself from &lt;code&gt;x-ratelimit-remaining&lt;/code&gt; and &lt;code&gt;x-ratelimit-reset&lt;/code&gt; instead of a fixed number.&lt;/li&gt;
&lt;li&gt;A conversation deleted or merged &lt;em&gt;while&lt;/em&gt; a sync is running is skipped that run and forgotten on the next one, instead of failing the run.&lt;/li&gt;
&lt;li&gt;The token only goes to the API host over https, and next-page links to another host are refused.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  One lesson
&lt;/h2&gt;

&lt;p&gt;If you're building a connector like this, spend the first hour on a real account, not in the API docs. Add, edit, delete, merge and move things, and write down what the API actually shows after each step. Every important design decision in this connector came from that hour, and none of it was in the documentation.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;p&gt;Reading every listing on every run is simple and catches tag changes, but it costs one request per 100 conversations. For very large inboxes I'd like to add a periodic full read with a cheaper check in between.&lt;/p&gt;

&lt;p&gt;The setup steps are in the README in the &lt;a href="https://github.com/topoteretes/cognee-community/pull/586/files" rel="noopener noreferrer"&gt;pull request&lt;/a&gt;, and &lt;code&gt;examples/example.py&lt;/code&gt; remembers an inbox and asks it a question.&lt;/p&gt;

</description>
      <category>cognee</category>
      <category>opensource</category>
      <category>python</category>
      <category>ai</category>
    </item>
    <item>
      <title>Your ownership records are already out of date: building Drift on FalkorDB</title>
      <dc:creator>Oscar Kandir</dc:creator>
      <pubDate>Sun, 18 Oct 2026 09:18:47 +0000</pubDate>
      <link>https://dev.to/oscar_kandir_4ce4f97c3d43/your-ownership-records-are-already-out-of-date-building-drift-on-falkordb-234p</link>
      <guid>https://dev.to/oscar_kandir_4ce4f97c3d43/your-ownership-records-are-already-out-of-date-building-drift-on-falkordb-234p</guid>
      <description>&lt;p&gt;I spent four days, solo, asking Kubernetes one simple question. Who actually owns this code? It turns out the answer isn't what its files say.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Kubernetes lists 157 approvers in its OWNERS files. 48 of them haven't touched the main repo in a year.&lt;/li&gt;
&lt;li&gt;I built Drift on FalkorDB. It finds the right reviewer for a change 78% of the time, compared with 37% if you pick from the OWNERS files (tested on 400 real pull requests). It also drafts fixes to those files and tests them on a copy of the graph first.&lt;/li&gt;
&lt;li&gt;Along the way I hit a FalkorDB bug that made my first result look better than it was, and I dropped a claim that didn't hold up.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;Every big engineering team writes down who owns what. GitHub has CODEOWNERS, and Kubernetes has an &lt;code&gt;OWNERS&lt;/code&gt; file in almost every folder, listing the people who can approve changes there. That's how pull requests get routed, and it's how a newcomer figures out who to ask.&lt;/p&gt;

&lt;p&gt;The trouble is that these files go stale. People change teams, take a break or just get busy, and nobody goes back to edit the file. Meanwhile someone new quietly becomes the person who actually knows that code, and they never get added. Nothing compares the record with what's really happening, so nobody notices.&lt;/p&gt;

&lt;p&gt;I built Drift for Graph Hacks (WeMakeDevs × FalkorDB) to do exactly that comparison, on a real organisation. It's live at &lt;a href="https://drift-egny.onrender.com" rel="noopener noreferrer"&gt;https://drift-egny.onrender.com&lt;/a&gt; and the code is at &lt;a href="https://github.com/oscarosk/drift" rel="noopener noreferrer"&gt;https://github.com/oscarosk/drift&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftxz85k8k2u8j00gkupvf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftxz85k8k2u8j00gkupvf.png" alt=" " width="800" height="422"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The first number
&lt;/h2&gt;

&lt;p&gt;Once everything was in a graph, my first query was the obvious one. Which listed approvers have done nothing in the last year? No reviews, no &lt;code&gt;/lgtm&lt;/code&gt;, no &lt;code&gt;/approve&lt;/code&gt;, no merged pull requests in kubernetes/kubernetes.&lt;/p&gt;

&lt;p&gt;The answer was &lt;strong&gt;48 of 157&lt;/strong&gt;, and every one of them is still listed. (I try to say "inactive here" rather than "gone", because plenty of them are probably busy in other Kubernetes repos.)&lt;/p&gt;

&lt;p&gt;Everything else in this post is what I built on top of that number, and how I tried to make sure I wasn't fooling myself.&lt;/p&gt;

&lt;h2&gt;
  
  
  The data, and why it had to be a graph
&lt;/h2&gt;

&lt;p&gt;All of it is public. I used the team list (&lt;code&gt;sigs.yaml&lt;/code&gt;, 24 teams), every &lt;code&gt;OWNERS&lt;/code&gt; and &lt;code&gt;OWNERS_ALIASES&lt;/code&gt; file, about 680 enhancement proposals (the decision records Kubernetes calls KEPs), every merged pull request since October 2024 with the files it changed, and the reviews and &lt;code&gt;/lgtm&lt;/code&gt; and &lt;code&gt;/approve&lt;/code&gt; comments on those pull requests from the GitHub API. I only store GitHub handles. No names, emails or comment text.&lt;/p&gt;

&lt;p&gt;The whole product is about comparing two sides of the same graph:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(:Person)-[:APPROVER_OF]-&amp;gt;(:Dir)                                                what the records say
(:Person)-[:REVIEWED|LGTM|APPROVED_PR|AUTHORED_PR]-&amp;gt;(:PR)-[:TOUCHES]-&amp;gt;(:Dir)    what people actually do
(:Dir)-[:INSIDE]-&amp;gt;(:Dir)                                                        OWNERS inheritance
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2a77gc8k2j9pkpnbudqt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2a77gc8k2j9pkpnbudqt.png" alt=" " width="800" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The reason it needs a graph is inheritance. If a folder has no approvers of its own, approval falls back to the nearest parent folder that has some, and so on up the tree. In Cypher, "everyone who reviewed anything at or below this folder" is a single pattern:&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;p:&lt;/span&gt;&lt;span class="n"&gt;Person&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;:REVIEWED&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;LGTM&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;APPROVED_PR&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;pr:&lt;/span&gt;&lt;span class="n"&gt;PR&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;:TOUCHES&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="nc"&gt;:Dir&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;:INSIDE&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="m"&gt;10&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;d:&lt;/span&gt;&lt;span class="n"&gt;Dir&lt;/span&gt; &lt;span class="ss"&gt;{&lt;/span&gt;&lt;span class="py"&gt;path:&lt;/span&gt; &lt;span class="n"&gt;$p&lt;/span&gt;&lt;span class="ss"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In SQL that's a recursive query I really wouldn't want to maintain.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part people would actually use
&lt;/h2&gt;

&lt;p&gt;Nobody wakes up wanting to know how stale ownership is. What they want to know is who should review their change.&lt;/p&gt;

&lt;p&gt;So that's the main feature. You paste the files you changed, and Drift ranks people by their reviews and approvals in those folders over the last six months, preferring people who know more of your change. It also shows why it picked them (this person reviewed this pull request, which changed this folder), and draws the evidence as a graph, with the inactive listed approvers in plum.&lt;/p&gt;

&lt;p&gt;[IMAGE: upload evidence-graph.png here]&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fumj245eb5ixznk3ddr5o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fumj245eb5ixznk3ddr5o.png" alt=" " width="800" height="336"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Measuring it, and the bug
&lt;/h2&gt;

&lt;p&gt;Screenshots can look convincing without proving anything, so I tested it against what actually happened.&lt;/p&gt;

&lt;p&gt;I took 400 pull requests merged between July and October 2026. For each one, Drift only got to see activity from before that pull request (never including the author), and I checked whether its top three included someone who really typed &lt;code&gt;/approve&lt;/code&gt; on it. The comparison is what a contributor does today, which is pick from the OWNERS files.&lt;/p&gt;

&lt;p&gt;My first run said &lt;strong&gt;86%&lt;/strong&gt;. That felt too good, so I wrote a quick leak check. For a sample of pull requests, was any of the evidence from after the merge? Some of it was.&lt;/p&gt;

&lt;p&gt;It took a while to find the cause, and it turned out to be FalkorDB itself. If you put a range index on a string property, a range filter ignores its upper bound:&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;CREATE&lt;/span&gt; &lt;span class="k"&gt;INDEX&lt;/span&gt; &lt;span class="n"&gt;FOR&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="py"&gt;p:&lt;/span&gt;&lt;span class="n"&gt;PR&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p.s&lt;/span&gt;&lt;span class="ss"&gt;);&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="py"&gt;p:&lt;/span&gt;&lt;span class="n"&gt;PR&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;p.s&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="s1"&gt;'2026-09-05'&lt;/span&gt; &lt;span class="ow"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;p.s&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="s1"&gt;'2026-09-10'&lt;/span&gt; &lt;span class="k"&gt;RETURN&lt;/span&gt; &lt;span class="nf"&gt;count&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;// 15, expected 5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same query on an integer property is fine. I'd been filtering on date strings, so "before this pull request" was quietly letting the future in. I checked it on FalkorDB 4.18.3 and 4.22.1, wrote a short script that reproduces it, and switched every date filter to integers (&lt;code&gt;PR.day = 20260910&lt;/code&gt;). There's a test now that fails if the leak ever comes back.&lt;/p&gt;

&lt;p&gt;Here's the honest result:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Who was in the top 3?&lt;/th&gt;
&lt;th&gt;Right person first&lt;/th&gt;
&lt;th&gt;Right person in top 3&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Drift&lt;/td&gt;
&lt;td&gt;53%&lt;/td&gt;
&lt;td&gt;78%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Three people from the OWNERS files&lt;/td&gt;
&lt;td&gt;13%&lt;/td&gt;
&lt;td&gt;37%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The three busiest approvers overall&lt;/td&gt;
&lt;td&gt;n/a&lt;/td&gt;
&lt;td&gt;46%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs03k7mjbm5yqmyfnsi38.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs03k7mjbm5yqmyfnsi38.png" alt=" " width="800" height="191"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So it's about twice as good as the records. I kept the 86% story in the README on purpose. Honestly, the wrong number taught me more than the right one did.&lt;/p&gt;

&lt;h2&gt;
  
  
  Drafting the fix, and testing it on a copy
&lt;/h2&gt;

&lt;p&gt;Pointing at problems only gets you so far, so Drift also drafts fixes. For the folders that have drifted most, it moves inactive approvers to &lt;code&gt;emeritus_approvers&lt;/code&gt; (Kubernetes' own way of saying someone stepped back) and adds people who actually review there. It edits the real file text, keeps the comments, and exports a patch that passes &lt;code&gt;git apply --check&lt;/code&gt;, with the evidence next to each line.&lt;/p&gt;

&lt;p&gt;But removing approvers can change where approval requests end up, and I didn't want Drift suggesting something that quietly breaks a folder. This is where &lt;code&gt;GRAPH.COPY&lt;/code&gt; became my favourite FalkorDB feature. Before you download anything, Drift copies the whole graph, applies the patch to the copy, runs the same "where does approval go?" query on both, compares them and deletes the copy. In code it's pretty small:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;with_copy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;edit&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;before&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;coverage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;               &lt;span class="c1"&gt;# where does every approval go today?
&lt;/span&gt;    &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;whatif_&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;uuid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;uuid4&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nb"&gt;hex&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;copy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;                     &lt;span class="c1"&gt;# GRAPH.COPY: a full, isolated copy
&lt;/span&gt;    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;copy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Tools&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;edit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;copy&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;                         &lt;span class="c1"&gt;# e.g. move inactive approvers to emeritus
&lt;/span&gt;        &lt;span class="n"&gt;after&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;coverage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;copy&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;             &lt;span class="c1"&gt;# the same query, on the copy
&lt;/span&gt;    &lt;span class="k"&gt;finally&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;graph&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;delete&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;               &lt;span class="c1"&gt;# the copy never outlives the request
&lt;/span&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;diff&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;before&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;after&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And &lt;code&gt;coverage&lt;/code&gt; is one query that walks each folder up its ownership chain:&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;Dir&lt;/span&gt; &lt;span class="ss"&gt;{&lt;/span&gt;&lt;span class="py"&gt;repo:&lt;/span&gt; &lt;span class="s1"&gt;'kubernetes'&lt;/span&gt;&lt;span class="ss"&gt;})&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;d.has_owners&lt;/span&gt;
&lt;span class="k"&gt;MATCH&lt;/span&gt; &lt;span class="n"&gt;chain&lt;/span&gt; &lt;span class="o"&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;:INSIDE&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="m"&gt;10&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;o:&lt;/span&gt;&lt;span class="n"&gt;Dir&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="py"&gt;p:&lt;/span&gt;&lt;span class="n"&gt;Person&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;:APPROVER_OF&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="n"&gt;o&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.path&lt;/span&gt;&lt;span class="ss"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;length&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="n"&gt;chain&lt;/span&gt;&lt;span class="ss"&gt;),&lt;/span&gt; &lt;span class="n"&gt;o.path&lt;/span&gt;&lt;span class="ss"&gt;,&lt;/span&gt; &lt;span class="n"&gt;o.no_parent_owners&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;p.handle&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the 40 drafted fixes, &lt;strong&gt;12 areas&lt;/strong&gt; whose approval requests only reached inactive people get unstuck, and none get stuck. It takes a couple of seconds and never touches the real graph.&lt;/p&gt;

&lt;p&gt;The same trick answers "what if?" questions. If one particular approver stepped back, 6 areas would be left waiting on inactive people. For 50 of the 60 busiest approvers, nothing would get stuck at all. Kubernetes turned out to be more resilient than I expected, with a few sharp edges.&lt;/p&gt;

&lt;h2&gt;
  
  
  The real teams, and a claim I dropped
&lt;/h2&gt;

&lt;p&gt;The official labels say which team owns each folder. I wanted to know which folders are really worked on by the same group of people, so I linked two folders whenever the same people work in both, and ran FalkorDB's &lt;code&gt;algo.labelPropagation&lt;/code&gt; on that.&lt;/p&gt;

&lt;p&gt;It found 19 working groups, and 13 of them cross the official team lines. To check they weren't just noise, I built the groups from activity before July and tested them on later pull requests. 47% of folder pairs changed together in a pull request landed in the same group, compared with 15% by chance.&lt;/p&gt;

&lt;p&gt;I also tested a second idea, that pull requests crossing groups need more approvers. The first time I ran it, it looked like three times as many. Then I re-ran it on a fresh download of the data and the effect disappeared. So I dropped it, and the README says so. It was the most exciting finding I had, which is exactly why I didn't trust it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The agent never writes Cypher
&lt;/h2&gt;

&lt;p&gt;Drift has an Ask box and an MCP server, so Claude Desktop or Cursor can use the same tools. I followed the approach from the organisers' guide on agents that reason over graphs. The model picks one of eight fixed queries and fills in the arguments, but never writes a query itself. Every folder, person or KEP it mentions is looked up in the graph before anything runs, so a typo gets "did you mean…" instead of a confident wrong answer. Answers are saved back into the graph as &lt;code&gt;(:Finding)&lt;/code&gt; nodes, linked to what they're about, so next time Drift can tell you what's changed.&lt;/p&gt;

&lt;p&gt;The piece I'd copy into any project is the check on the model's sentence. It's just a few regular expressions and set differences:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;HANDLE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;compile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;@([A-Za-z0-9][A-Za-z0-9-]{0,38})&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;answer&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;invented&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;HANDLE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findall&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nf"&gt;known_handles&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;answer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;invented&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;named people not in the result: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;sorted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;invented&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="c1"&gt;# ...the same for folders, KEP numbers, and any number of two digits or more
&lt;/span&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ok&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If a sentence fails, the reader gets a plainer one built straight from the query results instead. I'd rather Drift sound a bit flat than say something wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  Things that went wrong (the less glamorous ones)
&lt;/h2&gt;

&lt;p&gt;Not everything was a clever bug. My very first build failed with "connection refused" because Docker wasn't running. FalkorDB Cloud doesn't allow the &lt;code&gt;KEYS&lt;/code&gt; command, which one of my tests used, so I switched it to &lt;code&gt;GRAPH.LIST&lt;/code&gt;. My first deployment landed in a US region and felt slow from India, so I rebuilt it in Singapore, next to the database in Mumbai. And the CI badge was red for a whole day before I noticed that GitHub runs &lt;code&gt;pytest&lt;/code&gt; slightly differently from how I ran it locally, so it couldn't even find my code. It was one missing line in &lt;code&gt;pytest.ini&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;Compare against what people actually do today, not against a strawman. The honest question was never "graph vs RAG". It was "is this better than what a contributor already does?"&lt;/p&gt;

&lt;p&gt;Be suspicious of good numbers. The 86% was a bug, and the leak check that caught it took about ten minutes to write.&lt;/p&gt;

&lt;p&gt;Throw out results that don't reproduce, especially the exciting ones.&lt;/p&gt;

&lt;p&gt;And graph databases earn their place through the shape of the problem as much as speed. Inheritance chains, two snapshots of the organisation in one database, and copy-edit-compare what-ifs are what made this a graph problem for me.&lt;/p&gt;

&lt;h2&gt;
  
  
  Five things you can reuse on your own graph project
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Keep the past as a second graph. FalkorDB holds many graphs in one instance, so a snapshot from a year ago can sit next to today's. Run the same queries on both and you can test predictions against what really happened.&lt;/li&gt;
&lt;li&gt;Copy, edit, compare. &lt;code&gt;GRAPH.COPY&lt;/code&gt; turns any "what if?" into the same query run twice. Delete the copy in a &lt;code&gt;finally&lt;/code&gt; block.&lt;/li&gt;
&lt;li&gt;Test with a time split, then try to break it. Only give the system what it would have known at the time, and write a leak check. Mine caught a real bug.&lt;/li&gt;
&lt;li&gt;Filter date ranges on integers. Until the string-index bug is fixed, store &lt;code&gt;20260910&lt;/code&gt; rather than &lt;code&gt;"2026-09-10"&lt;/code&gt; for anything you filter by range.&lt;/li&gt;
&lt;li&gt;Let the model choose queries, never write them. Use fixed, parameterised queries, look names up in the graph first, and check every sentence against the result.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Live: &lt;a href="https://drift-egny.onrender.com" rel="noopener noreferrer"&gt;https://drift-egny.onrender.com&lt;/a&gt; (it's on free hosting, so the first load can take a minute). Click &lt;em&gt;Find a reviewer&lt;/em&gt;, then &lt;em&gt;Try an example&lt;/em&gt;, or type &lt;code&gt;What if @deads2k stepped back?&lt;/code&gt; into the Ask box.&lt;/li&gt;
&lt;li&gt;Code: &lt;a href="https://github.com/oscarosk/drift" rel="noopener noreferrer"&gt;https://github.com/oscarosk/drift&lt;/a&gt;. It runs locally with Docker, and the README has the full graph model and every Cypher query.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you look after an &lt;code&gt;OWNERS&lt;/code&gt; or CODEOWNERS file, I'd love to know whether yours has drifted too. Let me know in the comments.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Built for Graph Hacks: Context for AI Agents by WeMakeDevs and FalkorDB. I used Claude as an AI coding assistant while building it; there are details in the README.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>falkordb</category>
      <category>graphdatabase</category>
      <category>kubernetes</category>
      <category>ai</category>
    </item>
    <item>
      <title>Stroll Call: a screen-free voice walk companion for older adults, on a local open model</title>
      <dc:creator>Oscar Kandir</dc:creator>
      <pubDate>Mon, 12 Oct 2026 06:56:34 +0000</pubDate>
      <link>https://dev.to/oscar_kandir_4ce4f97c3d43/stroll-call-a-screen-free-voice-walk-companion-for-older-adults-on-a-local-open-model-3m6b</link>
      <guid>https://dev.to/oscar_kandir_4ce4f97c3d43/stroll-call-a-screen-free-voice-walk-companion-for-older-adults-on-a-local-open-model-3m6b</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week1-2026-10-05"&gt;Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;Older people in my family don't use apps, and walk less every year. Step counters don't move them. Someone saying, warmly and specifically, "go to the park gate, rest under the big tree, say hello to the tea seller" does.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stroll Call&lt;/strong&gt; is a screen-free voice walk companion for older adults. Every morning a local open-weight model writes one short, personal walk suggestion and reads it aloud. The person walking never touches a screen; the screen time for them is zero.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A family member fills in a small profile once: mobility, real nearby places, real people, likes, and things to avoid (the main road, broken steps, midday heat).&lt;/li&gt;
&lt;li&gt;Each morning the model writes a 40–70 word spoken message using &lt;strong&gt;only&lt;/strong&gt; those places and people, and &lt;strong&gt;never&lt;/strong&gt; anything on the avoid list.&lt;/li&gt;
&lt;li&gt;It remembers how yesterday's walk went: shorter after a tired day, gentle after skipped days, a new route after a good streak.&lt;/li&gt;
&lt;li&gt;After the walk, three fields are logged: minutes, how it felt, and one note.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Honest status:&lt;/strong&gt; the full pipeline (message → voice → memory → next-day adaptation, the setup page, and the eval) was tested end to end with a stand-in model. I have &lt;strong&gt;not&lt;/strong&gt; yet run it on real Gemma with my family member. My connection ran at about 30 kB/s and the model download didn't finish before the deadline. I'll post the real walk and eval results in the comments.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/oscarosk" rel="noopener noreferrer"&gt;
        oscarosk
      &lt;/a&gt; / &lt;a href="https://github.com/oscarosk/stroll-call" rel="noopener noreferrer"&gt;
        stroll-call
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Stroll Call&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;A screen-free voice walk companion for older adults. Every morning a &lt;strong&gt;local open-weight model&lt;/strong&gt; writes a short, personal walk suggestion, remembers how yesterday's walk went, and reads it aloud. The person walking never touches a screen.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Runs on an ordinary laptop with &lt;a href="https://ollama.com" rel="nofollow noopener noreferrer"&gt;Ollama&lt;/a&gt; and Gemma. No cloud model, no subscription.&lt;/li&gt;
&lt;li&gt;Their routine, places, and health notes stay at home.&lt;/li&gt;
&lt;li&gt;Works in any language the model and voice support: change &lt;code&gt;"language"&lt;/code&gt; in &lt;code&gt;profile.json&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Built for the DEV Hacktoberfest Open-Source AI Challenge, Week 1: Touch Grass (Oct 5–11, 2026).&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Setup (Windows 11, 8 GB RAM)&lt;/h2&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;Install Ollama from &lt;a href="https://ollama.com" rel="nofollow noopener noreferrer"&gt;https://ollama.com&lt;/a&gt;, then in a terminal
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;ollama pull gemma3:4b
ollama run gemma3:4b "hello"
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
If that is slow on your machine, use &lt;code&gt;gemma3:1b&lt;/code&gt; and set &lt;code&gt;OLLAMA_MODEL=gemma3:1b&lt;/code&gt; in &lt;code&gt;.env&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Install Python 3.10+, then in this folder
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
copy .env.example .env
copy profile.example.json profile.json
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Edit…&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/oscarosk/stroll-call" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Model:&lt;/strong&gt; Gemma, running locally through &lt;strong&gt;Ollama&lt;/strong&gt;. No cloud model and no API key.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;App:&lt;/strong&gt; Python. &lt;code&gt;nudge.py&lt;/code&gt; builds the prompt from the profile and the last 5 walks; &lt;code&gt;memory.py&lt;/code&gt; stores walks (a local JSON file, or MongoDB Atlas if configured); &lt;code&gt;speak.py&lt;/code&gt; turns the text into audio (an offline Windows voice, or ElevenLabs if configured); &lt;code&gt;app.py&lt;/code&gt; is a one-button Flask setup page.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Safety:&lt;/strong&gt; the prompt allows only listed places and people, bans the avoid list, gives no medical advice, and never pushes after a tired day. Markdown is stripped before speaking so the voice never reads "asterisk asterisk".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Evaluation:&lt;/strong&gt; &lt;code&gt;eval.py&lt;/code&gt; generates messages for four situations (first day, good streak, tired yesterday, two skipped days) and checks spoken length, real places only, avoid-list mentions (target 0%), memory of the last walk, latency and tokens.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tracing:&lt;/strong&gt; optional Sentry agent tracing wraps each run (load walks → model call with tokens and latency → voice → save). If the voice fails, the text is still saved.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Privacy:&lt;/strong&gt; an elderly person's daily movements and "knee hurt today" notes stay at home, never on someone else's server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost:&lt;/strong&gt; free to run, with no subscription. That matters for families with elders.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Offline:&lt;/strong&gt; it runs on an ordinary 8 GB laptop.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Any language:&lt;/strong&gt; change one field in the profile and everything she hears changes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Control:&lt;/strong&gt; I can read and change every rule, swap models, and re-run the eval myself, instead of hoping a vendor changes behaviour.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  My Agent Session
&lt;/h2&gt;

&lt;p&gt;I built this with an AI coding agent: idea selection after reviewing the other entries, the code, and an end-to-end test with a stand-in model.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
    </item>
    <item>
      <title>My AI agent was waiting in line: how I traced and fixed hidden sequential LLM calls with SigNoz on Windows</title>
      <dc:creator>Oscar Kandir</dc:creator>
      <pubDate>Sun, 19 Jul 2026 16:39:13 +0000</pubDate>
      <link>https://dev.to/oscar_kandir_4ce4f97c3d43/my-ai-agent-was-waiting-in-line-how-i-traced-and-fixed-hidden-sequential-llm-calls-with-signoz-on-ia9</link>
      <guid>https://dev.to/oscar_kandir_4ce4f97c3d43/my-ai-agent-was-waiting-in-line-how-i-traced-and-fixed-hidden-sequential-llm-calls-with-signoz-on-ia9</guid>
      <description>&lt;h2&gt;
  
  
  What I built
&lt;/h2&gt;

&lt;p&gt;The agent is small on purpose. You give it a topic, and it does three things: it asks an LLM to break the topic into three sub-questions, answers each of those questions with a separate LLM call, then makes one final call to combine the answers into a short summary. It's built with FastAPI and uses OpenAI's &lt;code&gt;gpt-4o-mini&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;That's five LLM calls for a single request. It always returned a sensible answer, so functionally it was "done." But a normal HTTP log only tells me the whole request took ten seconds, not which of those five calls ate the time, how many tokens each one burned, or whether any of them could have run at the same time. That's the gap I wanted to close, and it's exactly what tracing is for: seeing inside one request, step by step.&lt;/p&gt;




&lt;h2&gt;
  
  
  Setting up SigNoz on Windows (WSL 2)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What you'll need to follow along:&lt;/strong&gt; Windows with WSL 2 (I used Ubuntu), Docker, Python 3, and an OpenAI API key.&lt;/p&gt;

&lt;p&gt;I self-hosted SigNoz rather than using a cloud version, because I wanted the whole stack on my own machine. On Windows that means working inside WSL 2, and the first thing I learned is that the Docker you &lt;em&gt;think&lt;/em&gt; you have isn't always the Docker you can use.&lt;/p&gt;

&lt;p&gt;I had Docker Desktop installed, but running &lt;code&gt;docker&lt;/code&gt; inside my Ubuntu WSL distro gave me this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The command 'docker' could not be found in this WSL 2 distro.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Docker Desktop keeps its engine in its own separate WSL distro, and mine wasn't wired into Ubuntu. Rather than fight the Docker Desktop integration, I installed Docker natively inside Ubuntu instead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://get.docker.com | sh
&lt;span class="nb"&gt;sudo &lt;/span&gt;usermod &lt;span class="nt"&gt;-aG&lt;/span&gt; docker &lt;span class="nv"&gt;$USER&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After a &lt;code&gt;wsl --shutdown&lt;/code&gt; and reopening Ubuntu, &lt;code&gt;docker ps&lt;/code&gt; finally returned a clean, empty table. That was the sign the daemon was actually reachable.&lt;/p&gt;

&lt;p&gt;Then SigNoz itself, using their Foundry CLI (the current install method; the older &lt;code&gt;install.sh&lt;/code&gt; script is deprecated):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://signoz.io/foundry.sh | bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I created a &lt;code&gt;casting.yaml&lt;/code&gt; describing the install, ran &lt;code&gt;foundryctl cast -f casting.yaml&lt;/code&gt;, and after a few minutes of image pulls, &lt;code&gt;docker ps&lt;/code&gt; showed the full stack healthy: SigNoz on port 8080, the OTel collector on 4317/4318. One quirk: the &lt;code&gt;signoz-mcp&lt;/code&gt; container shows as &lt;code&gt;unhealthy&lt;/code&gt;, but that's a cosmetic healthcheck issue, not a real failure.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdx7llwgdbc4rw3g1nusp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdx7llwgdbc4rw3g1nusp.png" alt=" " width="800" height="591"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here's how the whole thing fits together:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   POST /research
        │
        ▼
┌──────────────────┐
│  FastAPI agent   │   plan → answer ×3 → combine  (5 LLM calls)
│  (WSL 2 host)    │
└────────┬─────────┘
         │  OpenTelemetry SDK
         │  OTLP → localhost:4318
         ▼
┌──────────────────────────┐
│  SigNoz OTel Collector   │   (Docker, port 4317/4318)
└────────┬─────────────────┘
         ▼
┌──────────────┐      ┌──────────────────┐
│  ClickHouse  │◄─────│   SigNoz UI      │  traces · metrics
│  (storage)   │      │   :8080          │  dashboards · alerts
└──────────────┘      └──────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Testing the pipe before trusting it
&lt;/h2&gt;

&lt;p&gt;Before I instrumented my real app, I wanted to know the telemetry pipeline actually worked. So I fired a handful of test traces straight at the collector with &lt;code&gt;telemetrygen&lt;/code&gt;, over the Docker network:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;--rm&lt;/span&gt; &lt;span class="nt"&gt;--network&lt;/span&gt; signoz-network &lt;span class="se"&gt;\&lt;/span&gt;
  ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen:latest &lt;span class="se"&gt;\&lt;/span&gt;
  traces &lt;span class="nt"&gt;--otlp-endpoint&lt;/span&gt; signoz-ingester-1:4317 &lt;span class="nt"&gt;--otlp-insecure&lt;/span&gt; &lt;span class="nt"&gt;--traces&lt;/span&gt; 5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Within about thirty seconds, a &lt;code&gt;telemetrygen&lt;/code&gt; service showed up in SigNoz with five traces. That confirmed the whole path was working: collector to ClickHouse to the UI. It paid off later. When my own app's data was slow to appear, I already knew the pipeline was fine and the problem was my config.&lt;/p&gt;

&lt;p&gt;[SCREENSHOT: telemetrygen traces in SigNoz (optional)]&lt;/p&gt;




&lt;h2&gt;
  
  
  Instrumenting the agent
&lt;/h2&gt;

&lt;p&gt;With SigNoz running, I needed the agent to actually send it data. OpenTelemetry has two levels of this, and I used both.&lt;/p&gt;

&lt;p&gt;First, auto-instrumentation, the low-effort win. A couple of installs and a wrapper command, no code changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;opentelemetry-distro opentelemetry-exporter-otlp opentelemetry-instrumentation-fastapi
opentelemetry-bootstrap &lt;span class="nt"&gt;-a&lt;/span&gt; &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then I ran the app &lt;em&gt;through&lt;/em&gt; the OpenTelemetry wrapper instead of plain uvicorn:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;opentelemetry-instrument uvicorn app:app &lt;span class="nt"&gt;--port&lt;/span&gt; 8001
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One detail that trips people up: my app runs on the WSL host, not inside Docker, so the telemetry endpoint is &lt;code&gt;localhost:4318&lt;/code&gt;, not the container name &lt;code&gt;signoz-ingester-1&lt;/code&gt; you'd use from inside the Docker network. Getting that wrong is a silent failure: data just never shows up, with no error.&lt;/p&gt;

&lt;p&gt;That alone got the incoming FastAPI request and the OpenAI calls into SigNoz. But auto-instrumentation gives you generic spans, "chat gpt-4o-mini" five times. It can't tell you &lt;em&gt;which&lt;/em&gt; step of my pipeline each call belongs to. So I added manual spans to label the stages and attach the numbers I actually cared about:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;ask_llm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;step_name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;tracer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start_as_current_span&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;step_name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;resp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;MODEL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;usage&lt;/span&gt;
        &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_attribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;llm.total_tokens&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;total_tokens&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_attribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;llm.cost_usd&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;prompt_tokens&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;PRICE_IN&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completion_tokens&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;PRICE_OUT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now every LLM span carries its real token count and dollar cost, and the pipeline stages (&lt;code&gt;plan_questions&lt;/code&gt;, &lt;code&gt;answer_questions&lt;/code&gt;, &lt;code&gt;combine_summary&lt;/code&gt;) show up as named spans in the trace instead of anonymous HTTP calls. (In my runs, a single research request cost about $[FILL IN from your llm.cost_usd spans] in tokens.)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftoxykewbkbcsyhl7iwcz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftoxykewbkbcsyhl7iwcz.png" alt=" " width="800" height="503"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqsz6vuaxpukcdag9w1iu.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqsz6vuaxpukcdag9w1iu.jpeg" alt=" " width="798" height="397"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Looking inside: the staircase
&lt;/h2&gt;

&lt;p&gt;Once the custom spans were flowing, I opened one &lt;code&gt;/research&lt;/code&gt; trace in SigNoz and finally saw where those ten seconds went. The flame graph made it obvious in a way no log ever could.&lt;/p&gt;

&lt;p&gt;The five LLM calls weren't overlapping. They were running one after another, in a perfect staircase. &lt;code&gt;plan_questions&lt;/code&gt; finished, &lt;em&gt;then&lt;/em&gt; the first answer call started, &lt;em&gt;then&lt;/em&gt; the second, &lt;em&gt;then&lt;/em&gt; the third, &lt;em&gt;then&lt;/em&gt; the combine step. Each step waited for the one before it.&lt;/p&gt;

&lt;p&gt;The numbers told the story:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Total request: &lt;strong&gt;10.48s&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;answer_questions&lt;/code&gt; alone: &lt;strong&gt;6.54s&lt;/strong&gt;, more than half the entire request&lt;/li&gt;
&lt;li&gt;Inside it, three separate answer calls running back to back (roughly 2.76s, 1.33s, and 2.45s)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And here's the thing that made it click: those three answer calls are completely independent. Answering one sub-question doesn't depend on the answer to another. They were only running one at a time because I'd written a plain &lt;code&gt;for&lt;/code&gt; loop. That's the most natural way to write it, and the most wasteful. My agent was making the LLM wait in line for no reason.&lt;/p&gt;

&lt;p&gt;I hadn't planned this bug. I didn't even know it was there until the trace drew it for me. That's the part that sold me on tracing: the inefficiency wasn't in my code review or my logs. It was sitting in the shape of the waterfall, plain as day.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8ihqs9g0ueqzddgu0tnt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8ihqs9g0ueqzddgu0tnt.png" alt=" " width="800" height="399"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The fix: stop waiting in line
&lt;/h2&gt;

&lt;p&gt;The fix followed directly from what the trace showed. If the three answer calls are independent, they shouldn't run one at a time. They should run at once. I swapped the sequential &lt;code&gt;for&lt;/code&gt; loop for a thread pool so all three fire in parallel:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nc"&gt;ThreadPoolExecutor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max_workers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;pool&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;futures&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="n"&gt;pool&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;submit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ask_llm_ctx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;llm.answer_&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Answer in 2 sentences: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;question&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;question&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;enumerate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;questions&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;answers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;result&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;futures&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But this is where I hit a real gotcha, and it's one worth knowing if you trace anything threaded: OpenTelemetry's trace context doesn't automatically cross into new threads. The first time I ran the parallel version, the three answer spans detached and floated off as their own separate traces instead of nesting under the request, and the waterfall fell apart.&lt;/p&gt;

&lt;p&gt;The fix was to capture the current context before spawning the threads and re-attach it inside each worker:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;ask_llm_ctx&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;step_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;attach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;ask_llm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;step_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;finally&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;detach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With that in place, I re-ran the same request and opened the new trace. The staircase was gone. The three answer calls now started together and overlapped. &lt;code&gt;answer_questions&lt;/code&gt; collapsed from 6.54s down to about 1.65s, roughly the length of its single slowest call instead of the sum of all three.&lt;/p&gt;

&lt;p&gt;The whole request dropped from &lt;strong&gt;10.48s to 5.62s&lt;/strong&gt;, about a 46% cut, from a change that only worked because a trace showed me where to make it.&lt;/p&gt;

&lt;p&gt;Here's the full endpoint after the fix, so you can reproduce it (the only real change from the original is that step 2 runs in a thread pool instead of a plain &lt;code&gt;for&lt;/code&gt; loop):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;concurrent.futures&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ThreadPoolExecutor&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;opentelemetry&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;trace&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;opentelemetry.context&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;attach&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;detach&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;get_current&lt;/span&gt;

&lt;span class="n"&gt;tracer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;trace&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_tracer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ai-research-agent&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nd"&gt;@app.post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/research&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;research&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Query&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;tracer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start_as_current_span&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;research_pipeline&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_attribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;research.topic&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;topic&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="c1"&gt;# 1. plan: break the topic into 3 sub-questions
&lt;/span&gt;        &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;tracer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start_as_current_span&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;plan_questions&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
            &lt;span class="n"&gt;plan&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;ask_llm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;llm.plan&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Give 3 short sub-questions about: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;topic&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;. One per line, no numbering.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;questions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;plan&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;splitlines&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()][:&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

        &lt;span class="c1"&gt;# 2. answer: independent calls, run in parallel (the fix)
&lt;/span&gt;        &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;tracer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start_as_current_span&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;answer_questions&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
            &lt;span class="n"&gt;ctx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;get_current&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
            &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nc"&gt;ThreadPoolExecutor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max_workers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;pool&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="n"&gt;futures&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
                    &lt;span class="n"&gt;pool&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;submit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ask_llm_ctx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;llm.answer_&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                                &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Answer in 2 sentences: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;question&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;question&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;enumerate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;questions&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="p"&gt;]&lt;/span&gt;
                &lt;span class="n"&gt;answers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;result&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;futures&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

        &lt;span class="c1"&gt;# 3. combine into a summary
&lt;/span&gt;        &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;tracer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start_as_current_span&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;combine_summary&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
            &lt;span class="n"&gt;summary&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;ask_llm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;llm.combine&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Combine these into a short paragraph:&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;answers&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;topic&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;topic&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;questions&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;questions&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;summary&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;summary&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgyxebd3aww389gnxyxrc.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgyxebd3aww389gnxyxrc.jpeg" alt=" " width="800" height="396"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Beyond a single trace: a dashboard and an alert
&lt;/h2&gt;

&lt;p&gt;One trace showed me the problem, but a trace is a single request. To watch behavior over time, I built a dashboard panel plotting the p95 latency of &lt;code&gt;POST /research&lt;/code&gt; from my trace data (&lt;code&gt;p95(durationNano)&lt;/code&gt;, filtered to the service).&lt;/p&gt;

&lt;p&gt;Because I'd run the slow sequential version &lt;em&gt;and&lt;/em&gt; the fast parallel version, the panel captured the whole story in one line: latency sitting up around 10 seconds, then dropping and settling near 5 after the fix. The optimization I'd just made, visible as a trend instead of a one-off.&lt;/p&gt;

&lt;p&gt;Then I added a guardrail: a trace-based alert that fires if p95 latency goes above 8 seconds at least once in a 5-minute window. The idea is simple: if the sequential slowdown ever creeps back in (a bad refactor, a new blocking call), I want to know before a user does. I wired it to a test webhook and fired a test notification to confirm it actually delivers.&lt;/p&gt;

&lt;p&gt;One small thing worth flagging for anyone following along: SigNoz won't let you save an alert rule without attaching a notification channel, so create the channel first, then the rule.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2fp17r867sac8zo6hmhj.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2fp17r867sac8zo6hmhj.jpeg" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm4bdh4rpeu3cfdfbhsvc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm4bdh4rpeu3cfdfbhsvc.png" alt=" " width="800" height="223"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What I'd tell myself before starting
&lt;/h2&gt;

&lt;p&gt;A few things I actually took away from this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Auto-instrumentation shows you the shape; custom spans give you the answers.&lt;/strong&gt; The wrapper got data flowing in minutes, but it was generic: five anonymous LLM calls. The insight only appeared once I added my own named spans and attached token and cost numbers. The low-effort version is worth doing first, but it's not where the value is.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A trace can show you things a code review won't.&lt;/strong&gt; I'd read that &lt;code&gt;for&lt;/code&gt; loop plenty of times and never thought twice about it. It took seeing the staircase in the flame graph to realize those calls were independent and could run in parallel. The bug wasn't hidden in the code. It was hidden in the &lt;em&gt;timing&lt;/em&gt;, and timing is exactly what a trace makes visible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;On Windows, install Docker inside WSL, not around it.&lt;/strong&gt; Fighting Docker Desktop's WSL integration wasn't worth it. A native install inside Ubuntu was simpler and just worked.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prove your telemetry pipeline before you build on it.&lt;/strong&gt; Before instrumenting anything real, I sent a handful of test traces with &lt;code&gt;telemetrygen&lt;/code&gt; and confirmed they landed in SigNoz. That five-minute check meant that when my app's data didn't show up later, I &lt;em&gt;knew&lt;/em&gt; the pipeline was fine and the problem was my config, not the other way around.&lt;/p&gt;




&lt;h2&gt;
  
  
  Wrapping up
&lt;/h2&gt;

&lt;p&gt;I started the night unable to run &lt;code&gt;docker&lt;/code&gt; in my terminal and ended it watching a trace tell me exactly why my AI agent was twice as slow as it needed to be, then watching that same tool confirm the fix worked. The agent's output never changed; what changed is that I could finally &lt;em&gt;see&lt;/em&gt; what it was doing. That's the whole point: you can't fix what you can't see, and for a multi-step AI agent, a trace is how you see it.&lt;/p&gt;

&lt;p&gt;If you want to try the same thing, everything I used is open source and self-hostable: &lt;a href="https://signoz.io/docs/" rel="noopener noreferrer"&gt;SigNoz&lt;/a&gt;, &lt;a href="https://opentelemetry.io/docs/" rel="noopener noreferrer"&gt;OpenTelemetry&lt;/a&gt;, and the OpenAI Python SDK. Self-host SigNoz, instrument one real app you already have, and open a single trace. I'd bet you find something you didn't expect, too.&lt;/p&gt;




</description>
      <category>opentelemetry</category>
      <category>observability</category>
      <category>ai</category>
      <category>python</category>
    </item>
  </channel>
</rss>
