<?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: Nikita Dmitriev</title>
    <description>The latest articles on DEV Community by Nikita Dmitriev (@nikd).</description>
    <link>https://dev.to/nikd</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1563839%2F3746173a-0fab-45f5-b1c4-229ee793947f.jpg</url>
      <title>DEV Community: Nikita Dmitriev</title>
      <link>https://dev.to/nikd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nikd"/>
    <language>en</language>
    <item>
      <title>OpenAgent for Obsidian: Local-Only Grounded Research with Gemma 4</title>
      <dc:creator>Nikita Dmitriev</dc:creator>
      <pubDate>Sun, 17 May 2026 13:00:35 +0000</pubDate>
      <link>https://dev.to/nikd/openagent-for-obsidian-local-only-grounded-research-with-gemma-4-28i</link>
      <guid>https://dev.to/nikd/openagent-for-obsidian-local-only-grounded-research-with-gemma-4-28i</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/google-gemma-2026-05-06"&gt;Gemma 4 Challenge: Build with Gemma 4&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

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

&lt;p&gt;Obsidian is a local-first notes app where your notes live as Markdown files on your machine.&lt;/p&gt;

&lt;p&gt;I built a grounded-research mode for an Obsidian AI plugin called OpenAgent. The users I care about most are the ones who can't paste their notes into a cloud LLM: a lawyer with client material, a doctor reviewing patient records, a researcher with a proprietary corpus, a founder with confidential strategy notes. These users already live in vaults like Obsidian, and today they have nowhere good to run AI over their actual work.&lt;/p&gt;

&lt;p&gt;OpenAgent's grounded research mode runs entirely against a local OpenAI-compatible endpoint — MLX on Apple silicon by default — and adds something single-shot note chat doesn't: every claim it surfaces has been verified against the cited note text. Instead of returning one ungrounded answer, it retrieves candidate notes, drafts structured claims from them, and verifies each claim against the cited note text before presenting it as fact. In the UI, users can inspect the step-by-step run, review which claims were verified or flagged, and jump directly to the cited source notes. Nothing leaves the machine.&lt;/p&gt;

&lt;p&gt;The Gemma 4 angle is what makes this practical on a personal laptop. Different stages of the pipeline want different model shapes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Gemma 4 E4B&lt;/strong&gt; for retrieval, where speed matters more than reasoning depth&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gemma 4 31B Dense&lt;/strong&gt; for synthesis, where multi-note grounded reasoning benefits from the strongest model in the stack&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gemma 4 26B A4B&lt;/strong&gt; for verification, where repeated structured support checks need to be cheap to run&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Same vault, same local endpoint, three Gemma 4 sizes coordinated through a single OpenAI-compatible API. That orchestration is the core design decision — it turns a private vault into a real multi-step agentic workflow without ever uploading the data.&lt;/p&gt;

&lt;p&gt;To measure whether verification actually helps, I built a live end-to-end evaluation against a labeled Nobel Physics corpus — 24 queries with expected claims and source quotes. The grounded path reduced hallucination rate from 54.2% to 46.3%, a 7.8-point improvement. That delta is a conservative lower bound: the benchmark scores quote wording strictly, so some factually correct claims still get penalized. The verifier also handles hard failure cases well: the false-premise Rutherford query is corrected to Chemistry instead of validating the wrong Physics premise. It also grounds queries such as Bardeen winning twice, Lawrence Bragg as the youngest physics laureate, Chadwick's neutron discovery, and Rontgen as the first Physics Nobel recipient on the expected notes.&lt;/p&gt;

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

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/weVXtam7nec"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

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

&lt;p&gt;Repository: &lt;a href="https://github.com/nikitaclicks/obsidian-openagent" rel="noopener noreferrer"&gt;https://github.com/nikitaclicks/obsidian-openagent&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Helpful links:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hackathon overview: &lt;code&gt;hackathon/README.md&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Final results: &lt;code&gt;hackathon/RESULTS.md&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How I Used Gemma 4
&lt;/h2&gt;

&lt;p&gt;I used Gemma 4 as a staged local system rather than a single model doing everything.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Gemma 4 E4B&lt;/strong&gt; handles retrieval because it is fast enough to scan candidate notes and summarize likely evidence without making the workflow feel heavy.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gemma 4 31B Dense&lt;/strong&gt; handles synthesis because multi-note grounded answering and structured claim generation benefit from stronger reasoning.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gemma 4 26B A4B&lt;/strong&gt; handles verification because the verifier needs to do repeated structured support checks cheaply and locally.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This orchestration is the main design choice in the project. Different Gemma 4 model sizes do different jobs over the same local user data, which makes local-only grounded research and agentic note workflows practical on a personal machine.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>gemmachallenge</category>
      <category>gemma</category>
      <category>obsidian</category>
    </item>
  </channel>
</rss>
