<?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: The Web3 Wizard</title>
    <description>The latest articles on DEV Community by The Web3 Wizard (@theweb3wizard00).</description>
    <link>https://dev.to/theweb3wizard00</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%2F4191875%2Fab07f561-61ee-4aa8-adb5-68f0ad1cdfb7.png</url>
      <title>DEV Community: The Web3 Wizard</title>
      <link>https://dev.to/theweb3wizard00</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/theweb3wizard00"/>
    <language>en</language>
    <item>
      <title>Why Vector Search Guesses and Graphs Prove: What Building ClearPath Taught Me</title>
      <dc:creator>The Web3 Wizard</dc:creator>
      <pubDate>Sun, 18 Oct 2026 10:14:48 +0000</pubDate>
      <link>https://dev.to/theweb3wizard00/why-vector-search-guesses-and-graphs-prove-what-building-clearpath-taught-me-42lj</link>
      <guid>https://dev.to/theweb3wizard00/why-vector-search-guesses-and-graphs-prove-what-building-clearpath-taught-me-42lj</guid>
      <description>&lt;p&gt;Let’s talk about something I see over and over in Web3 and AI right now.&lt;/p&gt;

&lt;p&gt;Everyone wants to build AI agents.&lt;/p&gt;

&lt;p&gt;And when builders decide to give an AI agent access to data, many reach for the same default stack:&lt;/p&gt;

&lt;p&gt;Chunk documents, compute embeddings, store them in a vector database, and run cosine similarity search (RAG).&lt;/p&gt;

&lt;p&gt;For many tasks, like answering questions about documentation or searching blog posts, vector search works just fine.&lt;/p&gt;

&lt;p&gt;But the moment your problem depends on how things connect, vector search alone falls short.&lt;/p&gt;

&lt;p&gt;Let me show you why.&lt;/p&gt;

&lt;p&gt;The $15,000 OTC Dilemma&lt;/p&gt;

&lt;p&gt;Meet Dave.&lt;/p&gt;

&lt;p&gt;Dave runs an over-the-counter (OTC) crypto desk. He has Telegram open. A counterparty wants to buy $15,000 worth of stablecoins.&lt;/p&gt;

&lt;p&gt;The trade window has a timer: Dave has 2 minutes to accept or decline the quote.&lt;/p&gt;

&lt;p&gt;The counterparty drops a wallet address:&lt;/p&gt;

&lt;p&gt;0x7a250d5630b4cf539739df2c5dacb4c659f2488d&lt;/p&gt;

&lt;p&gt;Now Dave has a problem.&lt;/p&gt;

&lt;p&gt;If those funds are connected to an exploit, a money mule, or a sanctioned mixer such as Tornado Cash just a few hops away, the transaction could expose his business to serious compliance and financial risks.&lt;/p&gt;

&lt;p&gt;Enterprise tools like Chainalysis and TRM Labs can be expensive, putting advanced blockchain analytics out of reach for some independent operators.&lt;/p&gt;

&lt;p&gt;So a builder says:&lt;/p&gt;

&lt;p&gt;"Hey, let's build an AI agent with vector search to audit crypto wallets!"&lt;/p&gt;

&lt;p&gt;And here's the fundamental flaw.&lt;/p&gt;

&lt;p&gt;Vector Search Cannot Express a Graph Hop&lt;/p&gt;

&lt;p&gt;A vector database stores numerical representations of semantic meaning in a high-dimensional space.&lt;/p&gt;

&lt;p&gt;It can tell you that the phrase "illicit money laundering" is conceptually similar to "Tornado Cash mixer."&lt;/p&gt;

&lt;p&gt;But semantic similarity alone cannot establish:&lt;/p&gt;

&lt;p&gt;Did Address A send 5 ETH to Mule B?&lt;/p&gt;

&lt;p&gt;Did Mule B retain a 0.5% fee and forward the rest to Consolidator C?&lt;/p&gt;

&lt;p&gt;Did Consolidator C fund this exact counterparty 45 minutes later?&lt;/p&gt;

&lt;p&gt;Did the trail terminate at a Binance hot wallet?&lt;/p&gt;

&lt;p&gt;These are questions about relationships, direction, transaction history, and graph topology.&lt;/p&gt;

&lt;p&gt;When an LLM investigates a wallet using only vector search, it sees retrieved information without necessarily seeing the connections between the entities.&lt;/p&gt;

&lt;p&gt;That creates a dangerous gap between finding relevant information and establishing an evidence-backed transaction path.&lt;/p&gt;

&lt;p&gt;In financial forensics:&lt;/p&gt;

&lt;p&gt;Vector search finds semantic similarities. Graph queries trace relationships.&lt;/p&gt;

&lt;p&gt;They solve different problems, and knowing when to use each matters.&lt;/p&gt;

&lt;p&gt;The Removal Test: Making FalkorDB Load-Bearing&lt;/p&gt;

&lt;p&gt;When I entered the Graph Hacks Hackathon, rule #3 caught my attention immediately:&lt;/p&gt;

&lt;p&gt;"The graph has to do real work. If the product still works once FalkorDB is taken out, the graph is decoration."&lt;/p&gt;

&lt;p&gt;That rule separated serious graph-based solutions from projects that merely used a graph database as a technical accessory.&lt;/p&gt;

&lt;p&gt;I wanted to build ClearPath so that FalkorDB was the load-bearing engine of the entire product.&lt;/p&gt;

&lt;p&gt;Remove FalkorDB, and ClearPath loses the graph traversal and relationship analysis that power its core verdicts.&lt;/p&gt;

&lt;p&gt;Here's what happens under the hood when Dave clicks Evaluate.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Directional Multi-Hop Traversal with Exponential Decay&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Instead of asking an LLM to guess whether two wallets might be connected, ClearPath runs an OpenCypher query against FalkorDB Cloud.&lt;/p&gt;

&lt;p&gt;MATCH path = (source:Wallet)-[:TRANSFERRED*1..4]-&amp;gt;(target:Wallet {address: $targetAddress})&lt;br&gt;
WHERE source.entity_type IN ['mixer', 'sanctioned', 'mule']&lt;br&gt;
  AND ALL(rel IN relationships(path) WHERE rel.amount_usd &amp;gt;= 10.0)&lt;br&gt;
  AND NONE(node IN nodes(path)[1..-1] WHERE node.entity_type = 'exchange_hot_wallet')&lt;br&gt;
RETURN&lt;br&gt;
  source.address AS source_address,&lt;br&gt;
  source.entity_type AS source_type,&lt;br&gt;
  length(path) AS hop_count,&lt;br&gt;
  [r IN relationships(path) | {&lt;br&gt;
    from: startNode(r).address,&lt;br&gt;
    to: endNode(r).address,&lt;br&gt;
    amount: r.amount_usd,&lt;br&gt;
    tx: r.tx_hash&lt;br&gt;
  }] AS steps&lt;/p&gt;

&lt;p&gt;Notice what's happening here:&lt;/p&gt;

&lt;p&gt;Multi-hop traversal: The query searches paths of up to four transfer edges between a flagged source and the target wallet.&lt;/p&gt;

&lt;p&gt;Dust filtering: Transfers below $10 are excluded to help reduce noise and potential dust-attack false positives.&lt;/p&gt;

&lt;p&gt;Exchange boundaries: Paths containing an exchange hot wallet as an intermediate node are excluded because centralized exchanges complicate direct on-chain attribution.&lt;/p&gt;

&lt;p&gt;Distance-based scoring: ClearPath applies exponential decay using a factor of (0.6^{\text{hop}}), so the contribution of a flagged source decreases as the number of hops increases.&lt;/p&gt;

&lt;p&gt;The key idea is that the system doesn't merely retrieve text about suspicious wallets. It traces actual relationships represented in the graph.&lt;/p&gt;

&lt;p&gt;FalkorDB is built around graph-processing techniques that leverage sparse matrix operations, making it well suited to relationship-heavy workloads.&lt;/p&gt;

&lt;p&gt;In my ClearPath implementation, the traversal returned results in 4 milliseconds during testing.&lt;/p&gt;

&lt;p&gt;That result is specific to my test environment and query; performance will vary with graph size, query complexity, and infrastructure.&lt;/p&gt;

&lt;p&gt;Still, it's a compelling demonstration of why graph databases deserve a place in the AI agent stack.&lt;/p&gt;

&lt;p&gt;Track 2: Giving the Agent True Episodic Memory&lt;/p&gt;

&lt;p&gt;Many projects describe their agents as having "memory" when they're simply appending chat transcripts to a database table.&lt;/p&gt;

&lt;p&gt;A chat log is useful, but it isn't the same as structured memory about what an agent previously investigated and what has changed since.&lt;/p&gt;

&lt;p&gt;In ClearPath, I used FalkorDB's multigraph capabilities to maintain separate graph contexts within the same cloud instance:&lt;/p&gt;

&lt;p&gt;clearpath_trust: The authoritative financial network.&lt;/p&gt;

&lt;p&gt;clearpath_mem_dave: Dave's private episodic memory graph.&lt;/p&gt;

&lt;p&gt;clearpath_shared_cases: A shared compliance board for verified fraud cases.&lt;/p&gt;

&lt;p&gt;When Dave investigates an address today that he scanned two hours ago, the agent can check for new transactions instead of starting from scratch.&lt;/p&gt;

&lt;p&gt;For example, it can run a temporal delta query:&lt;/p&gt;

&lt;p&gt;MATCH (inflow:Wallet)-[r:TRANSFERRED]-&amp;gt;(target:Wallet {address: $targetAddress})&lt;br&gt;
WHERE r.timestamp &amp;gt; $lastSessionTimestamp&lt;br&gt;
RETURN&lt;br&gt;
  count(r) AS new_inflows,&lt;br&gt;
  coalesce(sum(r.amount_usd), 0.0) AS new_volume&lt;/p&gt;

&lt;p&gt;If a new transaction occurred while Dave was away, the agent can surface an alert:&lt;/p&gt;

&lt;p&gt;"Notice: 1 new transaction ($8,500) detected since your last screening."&lt;/p&gt;

&lt;p&gt;That's the idea behind ClearPath's cross-session episodic memory: retain relevant investigative context and use it to identify changes over time.&lt;/p&gt;

&lt;p&gt;Of course, the quality of those alerts depends on accurate timestamps, complete transaction data, and correctly implemented session tracking.&lt;/p&gt;

&lt;p&gt;The "Theater Test"&lt;/p&gt;

&lt;p&gt;During hackathon demos, judges have good reason to be skeptical. They've seen plenty of mockups with hardcoded states that look impressive but don't demonstrate a working backend.&lt;/p&gt;

&lt;p&gt;So we built what I call the Theater Test.&lt;/p&gt;

&lt;p&gt;Here's how it works:&lt;/p&gt;

&lt;p&gt;Evaluate Exhibit C (0xDEMO_CLEAN_TARGET_03). The verdict comes back as NO-KNOWN-RISK.&lt;/p&gt;

&lt;p&gt;Click "Inject Mule Transfer (Flip to Caution)."&lt;/p&gt;

&lt;p&gt;Behind the scenes, an actual Cypher query executes against FalkorDB Cloud, creating a transfer edge from a known demo money-mule entity into Exhibit C.&lt;/p&gt;

&lt;p&gt;Run the evaluation again. The screen changes to CAUTION, the visual transaction trail displays the new connection, and the temporal-delta banner appears.&lt;/p&gt;

&lt;p&gt;Click "Rollback Taint." The newly created edge is deleted, and the screen returns to its previous state after re-evaluation.&lt;/p&gt;

&lt;p&gt;The point isn't simply that the UI changes.&lt;/p&gt;

&lt;p&gt;It's that the change is driven by a mutation to the underlying graph, followed by a fresh evaluation.&lt;/p&gt;

&lt;p&gt;Hardcoded demos show a state. Live graph systems can demonstrate how that state changes when the underlying relationships change.&lt;/p&gt;

&lt;p&gt;That distinction matters when you're building products that claim to reason over real data.&lt;/p&gt;

&lt;p&gt;What I Took Away From This&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Problem first, technology last&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The goal was never to show off a graph database or an AI model for its own sake.&lt;/p&gt;

&lt;p&gt;The goal was to help Dave make a better-informed decision during a two-minute deal window.&lt;/p&gt;

&lt;p&gt;Every technical choice should serve that problem.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Deterministic computation beats generative guessing&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;One of the biggest mistakes in AI agent design is allowing an LLM to invent or independently calculate critical risk scores without a deterministic, auditable method.&lt;/p&gt;

&lt;p&gt;In ClearPath, FalkorDB handles relationship traversal, while the scoring logic applies explicit rules. Google Gemini 2.5 Flash is used to explain the evidence in human-readable language.&lt;/p&gt;

&lt;p&gt;The distinction is important:&lt;/p&gt;

&lt;p&gt;Let deterministic systems calculate the evidence-based result. Let the LLM explain it.&lt;/p&gt;

&lt;p&gt;Neither a graph connection nor an automated risk score, however, should automatically be treated as proof of wrongdoing. Real financial investigations require reliable data, context, and appropriate human review.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Graph databases are more than a visualization layer&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;FalkorDB isn't there just to draw pretty lines between wallets.&lt;/p&gt;

&lt;p&gt;It's part of the computation that makes ClearPath work: traversing transaction paths, identifying relationships, and detecting changes in the network.&lt;/p&gt;

&lt;p&gt;That makes the graph load-bearing rather than decorative.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Make demos prove the architecture&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A convincing demo shouldn't just show what a product looks like when everything works.&lt;/p&gt;

&lt;p&gt;It should demonstrate what happens when the underlying data changes, how the system responds, and whether the result can be reproduced.&lt;/p&gt;

&lt;p&gt;That's why the Theater Test mattered to me.&lt;/p&gt;

&lt;p&gt;Final Thoughts&lt;/p&gt;

&lt;p&gt;If you're building AI agents and your problem involves relationships, hierarchies, dependencies, or networks, don't force vector search to do a graph database's job.&lt;/p&gt;

&lt;p&gt;Vector search is useful for semantic retrieval. Graph databases are useful for traversing and analyzing relationships. In many real-world systems, combining them is more powerful than treating either as a universal solution.&lt;/p&gt;

&lt;p&gt;Give your agent the right tools for the problem.&lt;/p&gt;

&lt;p&gt;For ClearPath, that meant making the graph do real work.&lt;/p&gt;

&lt;p&gt;Built by Khalid for Graph Hacks 2026.&lt;/p&gt;

&lt;p&gt;🔗 Explore my work: &lt;a href="https://github.com/theweb3wizard" rel="noopener noreferrer"&gt;https://github.com/theweb3wizard&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
