<?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: shruti sharma</title>
    <description>The latest articles on DEV Community by shruti sharma (@shruti_sharma_d6b09600cc9).</description>
    <link>https://dev.to/shruti_sharma_d6b09600cc9</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%2F4191069%2F64d7173e-bd14-4630-8fec-309d47f5aa00.png</url>
      <title>DEV Community: shruti sharma</title>
      <link>https://dev.to/shruti_sharma_d6b09600cc9</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shruti_sharma_d6b09600cc9"/>
    <language>en</language>
    <item>
      <title>Following the Money with a Graph: Building LedgerLens on FalkorDB</title>
      <dc:creator>shruti sharma</dc:creator>
      <pubDate>Sat, 17 Oct 2026 19:30:04 +0000</pubDate>
      <link>https://dev.to/shruti_sharma_d6b09600cc9/following-the-money-with-a-graph-building-ledgerlens-on-falkordb-1n6i</link>
      <guid>https://dev.to/shruti_sharma_d6b09600cc9/following-the-money-with-a-graph-building-ledgerlens-on-falkordb-1n6i</guid>
      <description>&lt;p&gt;&lt;em&gt;Synthetic data. Risk signals, not accusations.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Imagine you've just become president of your housing society and you ask one simple question: &lt;strong&gt;where did our reserve fund go?&lt;/strong&gt;&lt;br&gt;
In a spreadsheet, the answer is a wall of rows. But the real story isn't in any single row. It's in the relationships between them: a relative who never pays, a repair vendor who is paid every year for jobs that keep reopening, a transfer that passes through two companies before landing at an outside trust. That's the kind of problem a graph is made for, so I built &lt;strong&gt;LedgerLens&lt;/strong&gt;, an agent that investigates a society's finances by following those hidden links in FalkorDB.&lt;/p&gt;

&lt;h2&gt;
  
  
  The story I built it around
&lt;/h2&gt;

&lt;p&gt;I wrote a fully synthetic dataset (no real people, no real money) with a planted story:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Relatives of the old president have 15 to 24 months of unpaid or waived dues, while everyone else pays an extra levy.&lt;/li&gt;
&lt;li&gt;A vendor, SH-Group, keeps getting paid, yet the same complaints reopen: 9 water leaks, 8 lift breakdowns, 6 corridor lighting issues.&lt;/li&gt;
&lt;li&gt;Eight transfers, 400,000,000 in total, were recorded only in a secret ledger and moved from the reserve fund to SH-Group, then to a shell company, then to an outside trust.&lt;/li&gt;
&lt;li&gt;Two sets of people and companies quietly share addresses.&lt;/li&gt;
&lt;li&gt;One contract was approved at a meeting with no quorum, and one waiver had no meeting at all.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I also planted &lt;strong&gt;decoys&lt;/strong&gt; the agent must &lt;em&gt;not&lt;/em&gt; flag: a properly approved medical waiver, a relative who pays on time, an ordinary defaulter with no links, and an honest vendor. A tool that flags everyone is useless, so the decoys were my accuracy test.&lt;/p&gt;

&lt;h2&gt;
  
  
  How FalkorDB does the real work
&lt;/h2&gt;

&lt;p&gt;The graph has about 1,200 nodes and 1,350 relationships: people, flats, bills, vendors, transfers, meetings, decisions and more. Every risk signal is a Cypher query, not Python logic:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Multi-hop traversal&lt;/strong&gt; from the old president through &lt;code&gt;RELATIVE_OF|FRIEND_OF&lt;/code&gt; to flat owners, combined with bill counts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;shortestPath&lt;/strong&gt; from the Reserve Fund to the Trust through &lt;code&gt;SENT&lt;/code&gt; and &lt;code&gt;RECEIVED_BY&lt;/code&gt; transfers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pattern matching&lt;/strong&gt; for transfers recorded in the secret ledger with no approving decision.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Aggregation over &lt;code&gt;REOPENS&lt;/code&gt; chains&lt;/strong&gt; to find repeated complaints per vendor.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shared-address matching&lt;/strong&gt; between people and companies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OPTIONAL MATCH&lt;/strong&gt; to find decisions with no meeting or no quorum.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;An LLM (Groq) then writes the summary, but it only sees the rows the queries return. The app shows every Cypher query and its result under a "How it got there" section, so a human can verify each claim. If you removed FalkorDB, there would be nothing left to say.&lt;/p&gt;

&lt;h2&gt;
  
  
  What went wrong (and what I learned)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. My first query flagged a decoy.&lt;/strong&gt; The "hidden beneficiaries" query listed the president's cousin, who pays on time, with 36 "unpaid" bills. I had filtered on the bill &lt;code&gt;status&lt;/code&gt; field, which didn't match my data. Switching to the paid amount fixed it. Lesson: the decoys caught a bug that a happy-path test would never have found.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. shortestPath has a rule.&lt;/strong&gt; I wrote &lt;code&gt;MATCH p = shortestPath(...)&lt;/code&gt;, as in many Cypher examples, and FalkorDB told me it only supports shortestPath inside &lt;code&gt;WITH&lt;/code&gt; or &lt;code&gt;RETURN&lt;/code&gt;. Moving it to &lt;code&gt;WITH shortestPath(...) AS p&lt;/code&gt; fixed it. A one-line note in the docs would help beginners.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Don't let the model decide what to look at.&lt;/strong&gt; My first agent let the LLM choose which tools to call, and the model I used often stopped after one query. I changed the design so all the queries run every time and the model only summarises. Less "agentic" flexibility, much more reliable evidence.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Wording matters.&lt;/strong&gt; I told the model to report "risk signals worth review" and never accuse anyone. Without that instruction it started using words like "kick-backs". For a tool about real-world trust, the tone is part of the product.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Graphs shine when the question is about &lt;em&gt;connections&lt;/em&gt;, not rows.&lt;/li&gt;
&lt;li&gt;Seeding decoys is the cheapest way to test whether an investigation tool is honest.&lt;/li&gt;
&lt;li&gt;Showing the query next to the answer builds more trust than a confident summary.&lt;/li&gt;
&lt;li&gt;FalkorDB was easy to start with: one Docker command and I was running Cypher in the browser.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I built this over about two days for the Graph Hacks hackathon, with Claude helping write much of the code. I made the design decisions, ran everything and checked the results against my own answer key.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code:&lt;/strong&gt; &lt;a href="https://github.com/shrutisharma-sh/LedgerLense" rel="noopener noreferrer"&gt;https://github.com/shrutisharma-sh/LedgerLense&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Demo video:&lt;/strong&gt; &lt;em&gt;&lt;a href="https://youtu.be/2GG1GAXGLPY?si=coA5-D-hdiBU9Jnv" rel="noopener noreferrer"&gt;https://youtu.be/2GG1GAXGLPY?si=coA5-D-hdiBU9Jnv&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Built for Graph Hacks: Context for AI Agents (FalkorDB), Track 01.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>falkordb</category>
    </item>
  </channel>
</rss>
