<?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: mohinimhetre</title>
    <description>The latest articles on DEV Community by mohinimhetre (@mohinimhetre).</description>
    <link>https://dev.to/mohinimhetre</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%2F4191060%2F0b38dd5d-ffb2-449b-9ce8-17f48d037cd6.png</url>
      <title>DEV Community: mohinimhetre</title>
      <link>https://dev.to/mohinimhetre</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mohinimhetre"/>
    <language>en</language>
    <item>
      <title>Building CaseGraph: An AI Investigation Agent Powered by a Knowledge Graph</title>
      <dc:creator>mohinimhetre</dc:creator>
      <pubDate>Sun, 18 Oct 2026 20:31:00 +0000</pubDate>
      <link>https://dev.to/mohinimhetre/building-casegraph-an-ai-investigation-agent-powered-by-a-knowledge-graph-2ac8</link>
      <guid>https://dev.to/mohinimhetre/building-casegraph-an-ai-investigation-agent-powered-by-a-knowledge-graph-2ac8</guid>
      <description>&lt;h1&gt;
  
  
  CaseGraph: AI-Powered Criminal Investigation Using Graph Databases and FalkorDB
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Criminal cases rarely exist in isolation. A person involved in one investigation might be connected to another case registered at a different police station. Discovering these hidden connections across people, evidence, and events can be challenging when data is stored as isolated records.&lt;/p&gt;

&lt;p&gt;During a hackathon hosted by wemakedevs, I built &lt;strong&gt;CaseGraph&lt;/strong&gt;, an AI-powered graph knowledge base and criminal investigation agent that explores how graph databases can help solve this problem.&lt;/p&gt;

&lt;p&gt;Built using &lt;strong&gt;FalkorDB, Angular, .NET, and an AI agent&lt;/strong&gt;, CaseGraph focuses on relationship discovery, case timeline reconstruction, and cross-station case correlation.&lt;/p&gt;

&lt;p&gt;The central idea is simple: instead of treating a criminal case as an isolated record, represent it as part of a connected network of people, cases, evidence, and events.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Graph Databases?
&lt;/h2&gt;

&lt;p&gt;Consider two cases registered at different police stations. They may appear unrelated until an investigator discovers that they share a person, witness, or another relevant connection.&lt;/p&gt;

&lt;p&gt;In a graph database, entities are represented as &lt;strong&gt;nodes&lt;/strong&gt;, and their connections are represented as &lt;strong&gt;relationships&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(Person A) ── INVOLVED_IN ──&amp;gt; (Case 101)
     |
    KNOWS
     |
(Person B) ── INVOLVED_IN ──&amp;gt; (Case 205)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This structure makes relationship traversal a natural operation. Instead of reconstructing connections through complex joins or application-level logic, we can query paths between entities directly.&lt;/p&gt;

&lt;p&gt;This is why graph databases are a strong fit for investigative systems: the relationships between records are often as important as the records themselves.&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture: Station Graphs and a Common Department Graph
&lt;/h2&gt;

&lt;p&gt;One of the key architectural decisions in CaseGraph was to maintain &lt;strong&gt;a separate graph for each police station and a shared Department graph&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Station graphs:&lt;/strong&gt; Store station-specific investigative information, including cases, people, evidence, and events.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Department graph:&lt;/strong&gt; Maintains the department hierarchy and a shared view of relevant case information and associated people across stations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The station graphs support local investigations, while the Department graph provides the shared context needed to discover connections across station boundaries.&lt;/p&gt;

&lt;p&gt;For example, if a person appears in cases registered at two different stations, querying the Department graph can reveal that connection even when the cases belong to separate station graphs.&lt;/p&gt;

&lt;p&gt;This separation provides a logical boundary for local investigation while enabling department-wide relationship analysis. The application must, of course, maintain consistency between the station-level data and the shared graph.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why FalkorDB?
&lt;/h2&gt;

&lt;p&gt;I chose &lt;strong&gt;FalkorDB&lt;/strong&gt; as the graph storage and query layer for CaseGraph because the core problem revolves around connected entities and multi-hop relationships.&lt;/p&gt;

&lt;p&gt;FalkorDB lets the application represent investigative data as a graph and query connections using Cypher-style graph queries.&lt;/p&gt;

&lt;p&gt;For example, a simplified relationship query could look like this:&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="n"&gt;path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="py"&gt;a:&lt;/span&gt;&lt;span class="n"&gt;Person&lt;/span&gt; &lt;span class="ss"&gt;{&lt;/span&gt;&lt;span class="py"&gt;id:&lt;/span&gt; &lt;span class="n"&gt;$personA&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="o"&gt;*&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="ss"&gt;]&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;
             &lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="py"&gt;b:&lt;/span&gt;&lt;span class="n"&gt;Person&lt;/span&gt; &lt;span class="ss"&gt;{&lt;/span&gt;&lt;span class="py"&gt;id:&lt;/span&gt; &lt;span class="n"&gt;$personB&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;path&lt;/span&gt;
&lt;span class="k"&gt;LIMIT&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This illustrates how the database can retrieve paths between two people without requiring the application to know every intermediate connection beforehand. Production queries would also need appropriate relationship filters, identity handling, and access controls.&lt;/p&gt;

&lt;p&gt;FalkorDB provides the graph traversal capabilities; CaseGraph's application architecture determines how the data is organized and how those capabilities are used for investigation.&lt;/p&gt;

&lt;p&gt;the image below is showing 2 cases stored in Shivaji Nagar police station.&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%2Fob50o5tk0rea7zx1tvgf.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%2Fob50o5tk0rea7zx1tvgf.png" alt=" " width="800" height="397"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The AI Investigation Agent
&lt;/h2&gt;

&lt;p&gt;To make graph-based investigation accessible through natural language, I built an AI agent with five specialized tools.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. FindRelationship&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Finds connections between two people by traversing the graph. It helps investigators understand how individuals are connected and retrieve the recorded interactions or cases linking them.&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%2Flc2jv9utqu3qy88jh65f.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%2Flc2jv9utqu3qy88jh65f.png" alt=" " width="786" height="358"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. CaseTimeLine&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Retrieves events associated with a case and organizes them chronologically, providing a structured view of how the investigation unfolded.&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%2Fef36bcwnq7l56degrk9h.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%2Fef36bcwnq7l56degrk9h.png" alt=" " width="760" height="613"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. FindByName&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Retrieves a person's available investigative context, including associated cases, relationships, events, and connected evidence.&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%2Flmirqnst9ffyfo2zqkb4.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%2Flmirqnst9ffyfo2zqkb4.png" alt=" " width="776" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. CreateEvidence&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Adds evidence to an ongoing case and links it to the relevant graph entities, making it discoverable through subsequent queries.&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%2Far5nsbqwdnj6bttu3gku.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%2Far5nsbqwdnj6bttu3gku.png" alt=" " width="748" height="512"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. GetCasePattern&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Identifies potential connections between cases registered at different police stations by querying the common Department graph. This enables cross-station link analysis beyond the scope of an individual station's data.&lt;/p&gt;

&lt;p&gt;Together, these tools turn the graph into an interactive investigation layer rather than simply a data store.&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%2Fzb0tw8sgaec5eczu2d55.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%2Fzb0tw8sgaec5eczu2d55.png" alt=" " width="745" height="298"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                Department
                /        \
               /          \
         Station_A      Station_B
             |               |
          Case_101         Case_205
             \              /
              \            /
                 Person_X
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  How the Components Work Together
&lt;/h2&gt;

&lt;p&gt;CaseGraph separates the user interface, application logic, AI orchestration, and graph persistence.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Investigator
     |
Angular Frontend
     |
.NET Backend
     |
AI Agent ─LLM─&amp;gt; Five Investigation Tools
                     |
                  FalkorDB
                 /        \
         Station Graphs   Department Graph
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Angular&lt;/strong&gt; provides the investigator-facing interface.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;.NET&lt;/strong&gt; handles backend workflows, validation, and integration.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The AI agent&lt;/strong&gt; interprets requests and selects the appropriate tool.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FalkorDB&lt;/strong&gt; stores connected entities and executes graph queries.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This separation keeps the AI layer focused on interpreting investigative intent while the backend controls database access and application operations.&lt;/p&gt;

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

&lt;p&gt;Building CaseGraph reinforced three important ideas:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Relationships should be first-class data.&lt;/strong&gt; Graphs make multi-hop connections and cross-case exploration more natural to express.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shared context enables broader discovery.&lt;/strong&gt; The Department graph provides a common view for identifying potential links across station boundaries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI and graph databases complement each other.&lt;/strong&gt; The graph models and retrieves connections, while the agent makes those capabilities accessible through natural-language workflows.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For real-world deployment, entity resolution, authorization, data provenance, auditability, and human verification would be essential—especially when handling sensitive investigative information. A discovered relationship should be treated as a lead to examine, not proof of wrongdoing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;CaseGraph was my exploration of how &lt;strong&gt;graph databases and AI agents can work together to support relationship-driven investigations&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Using FalkorDB, I built a graph-based architecture with station-specific data and a shared Department graph, then exposed its capabilities through five focused investigation tools.&lt;/p&gt;

&lt;p&gt;The most interesting part was moving beyond simple record retrieval toward discovering connections that might otherwise remain hidden across separate cases.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The graph provides the connected context. The AI agent makes that context easier to explore.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That is the idea behind CaseGraph.&lt;/p&gt;

&lt;p&gt;Repository: &lt;a href="https://github.com/mohinimhetre/CaseGraph" rel="noopener noreferrer"&gt;https://github.com/mohinimhetre/CaseGraph&lt;/a&gt;&lt;br&gt;
Falkor DB: &lt;a href="https://www.falkordb.com/" rel="noopener noreferrer"&gt;https://www.falkordb.com/&lt;/a&gt;&lt;br&gt;
Hackathon organizer: &lt;a href="https://www.wemakedevs.org/home" rel="noopener noreferrer"&gt;https://www.wemakedevs.org/home&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
