<?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: Stefan Giovanni Imperato Lozano</title>
    <description>The latest articles on DEV Community by Stefan Giovanni Imperato Lozano (@stefanimp).</description>
    <link>https://dev.to/stefanimp</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%2F3969209%2F8bf096a9-4183-4be5-a500-9fc6f1a4c44e.png</url>
      <title>DEV Community: Stefan Giovanni Imperato Lozano</title>
      <link>https://dev.to/stefanimp</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/stefanimp"/>
    <language>en</language>
    <item>
      <title>Reducing AI Context Waste in Obsidian with Local Retrieval</title>
      <dc:creator>Stefan Giovanni Imperato Lozano</dc:creator>
      <pubDate>Fri, 05 Jun 2026 05:47:37 +0000</pubDate>
      <link>https://dev.to/stefanimp/reducing-ai-context-waste-in-obsidian-with-local-retrieval-598g</link>
      <guid>https://dev.to/stefanimp/reducing-ai-context-waste-in-obsidian-with-local-retrieval-598g</guid>
      <description>&lt;p&gt;When working with AI assistants and a large knowledge base, one recurring problem is context waste.&lt;/p&gt;

&lt;p&gt;You have a set of notes, some of them relevant, many of them only loosely related, and the easiest thing to do is often to paste too much context into the model.&lt;/p&gt;

&lt;p&gt;That creates a few problems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;token usage grows quickly&lt;/li&gt;
&lt;li&gt;prompts become harder to inspect&lt;/li&gt;
&lt;li&gt;the assistant receives irrelevant information&lt;/li&gt;
&lt;li&gt;important notes can still be missed&lt;/li&gt;
&lt;li&gt;the workflow depends too much on manual searching&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I wanted to explore a local-first approach to this problem inside Obsidian.&lt;/p&gt;

&lt;p&gt;The result is &lt;strong&gt;Context Prism&lt;/strong&gt;, an open-source Obsidian plugin that creates token-aware context packs from related notes.&lt;/p&gt;

&lt;p&gt;Community Directory: &lt;a href="https://community.obsidian.md/plugins/context-prism" rel="noopener noreferrer"&gt;https://community.obsidian.md/plugins/context-prism&lt;/a&gt;&lt;br&gt;&lt;br&gt;
GitHub: &lt;a href="https://github.com/stefanimp/context-prism" rel="noopener noreferrer"&gt;https://github.com/stefanimp/context-prism&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The idea
&lt;/h2&gt;

&lt;p&gt;Instead of asking an AI assistant to inspect a large vault, Context Prism does the first retrieval step locally.&lt;/p&gt;

&lt;p&gt;The active note becomes the query. The plugin ranks related notes in the vault and creates a compact Markdown context pack containing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;note paths&lt;/li&gt;
&lt;li&gt;focused snippets&lt;/li&gt;
&lt;li&gt;ranking reasons&lt;/li&gt;
&lt;li&gt;rough token estimates&lt;/li&gt;
&lt;li&gt;estimated avoided context&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That context pack can then be pasted into ChatGPT, Claude, Codex, Cursor, or any other assistant before asking for analysis, writing help, planning, or implementation work.&lt;/p&gt;

&lt;p&gt;The goal is not to replace the assistant. The goal is to give it a smaller and more relevant starting point.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why local-first matters
&lt;/h2&gt;

&lt;p&gt;For this kind of tool, privacy and predictability are important.&lt;/p&gt;

&lt;p&gt;Context Prism does not call external APIs, does not send note content anywhere, and does not require an embedding service. It reads Markdown files through the Obsidian plugin API and builds the ranking locally.&lt;/p&gt;

&lt;p&gt;That design has tradeoffs. Local lexical retrieval is not as semantically powerful as embedding-based search, but it is fast, explainable, cheap to run, and easier to trust.&lt;/p&gt;

&lt;p&gt;For a note-taking workflow, those properties matter.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ranking approach
&lt;/h2&gt;

&lt;p&gt;The current ranking system combines several lightweight signals:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;TF-IDF cosine similarity&lt;/li&gt;
&lt;li&gt;BM25-style lexical scoring&lt;/li&gt;
&lt;li&gt;title and alias matches&lt;/li&gt;
&lt;li&gt;heading matches&lt;/li&gt;
&lt;li&gt;configurable metadata weighting&lt;/li&gt;
&lt;li&gt;folder include/exclude filters&lt;/li&gt;
&lt;li&gt;multilingual stopword profiles&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each candidate includes a short explanation of why it was selected. This is important because retrieval tools should not behave like a black box. If a note appears in the pack, the user should be able to understand why.&lt;/p&gt;

&lt;h2&gt;
  
  
  Multilingual vaults
&lt;/h2&gt;

&lt;p&gt;Many real vaults are not purely English. Mine are not either.&lt;/p&gt;

&lt;p&gt;Context Prism supports multiple language profiles, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;English&lt;/li&gt;
&lt;li&gt;Spanish&lt;/li&gt;
&lt;li&gt;French&lt;/li&gt;
&lt;li&gt;German&lt;/li&gt;
&lt;li&gt;Italian&lt;/li&gt;
&lt;li&gt;Portuguese&lt;/li&gt;
&lt;li&gt;multilingual mode&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The multilingual layer is still lexical. It does not translate notes and it does not use semantic embeddings. The goal is to reduce obvious noise from common words and make mixed-language vaults more usable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Token-aware context packs
&lt;/h2&gt;

&lt;p&gt;The context pack includes rough token estimates.&lt;/p&gt;

&lt;p&gt;This is not meant to be a perfect tokenizer for every model. It is a practical approximation that helps answer a simple question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Am I about to paste a small focused pack, or a huge amount of unnecessary context?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In AI workflows, that distinction matters.&lt;/p&gt;

&lt;h2&gt;
  
  
  Manual linking is still useful
&lt;/h2&gt;

&lt;p&gt;Although the main use case is AI context routing, Context Prism also includes a manual link review workflow.&lt;/p&gt;

&lt;p&gt;You can review suggested related notes and insert selected wiki-links into the current note. This keeps the plugin useful even when you are not working with an AI assistant.&lt;/p&gt;

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

&lt;p&gt;Building this made me think more carefully about retrieval quality.&lt;/p&gt;

&lt;p&gt;The hard part is not just finding notes with shared words. The hard part is ranking notes that are actually useful for the user's next action.&lt;/p&gt;

&lt;p&gt;Some notes are short index notes. Some have generic templates. Some share metadata but not meaning. Some relevant notes mention the active topic without using the exact same wording.&lt;/p&gt;

&lt;p&gt;This makes retrieval a product problem as much as an algorithmic one.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I want feedback on
&lt;/h2&gt;

&lt;p&gt;I am especially interested in feedback from people who use Obsidian together with AI assistants.&lt;/p&gt;

&lt;p&gt;Useful feedback would be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Does it surface the notes you would have copied manually?&lt;/li&gt;
&lt;li&gt;Does it miss important context?&lt;/li&gt;
&lt;li&gt;Are irrelevant notes ranked too high?&lt;/li&gt;
&lt;li&gt;Are the snippets useful enough for the assistant?&lt;/li&gt;
&lt;li&gt;Are the token estimates understandable?&lt;/li&gt;
&lt;li&gt;What settings would make retrieval easier to tune?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Synthetic or redacted examples are ideal, especially for ranking problems.&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;p&gt;Community Directory: &lt;a href="https://community.obsidian.md/plugins/context-prism" rel="noopener noreferrer"&gt;https://community.obsidian.md/plugins/context-prism&lt;/a&gt;&lt;br&gt;&lt;br&gt;
GitHub: &lt;a href="https://github.com/stefanimp/context-prism" rel="noopener noreferrer"&gt;https://github.com/stefanimp/context-prism&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you try it, I would really appreciate feedback through GitHub Issues or comments.&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.amazonaws.com%2Fuploads%2Farticles%2Frrkehugqhrndwvryd54z.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.amazonaws.com%2Fuploads%2Farticles%2Frrkehugqhrndwvryd54z.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>typescript</category>
      <category>productivity</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
