<?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>Forem: Boke0 / Taigen Takeshita</title>
    <description>The latest articles on Forem by Boke0 / Taigen Takeshita (@boke0).</description>
    <link>https://forem.com/boke0</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%2F3408358%2F05a84eb6-61d5-46d0-9604-65e3cfb24a9c.png</url>
      <title>Forem: Boke0 / Taigen Takeshita</title>
      <link>https://forem.com/boke0</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/boke0"/>
    <language>en</language>
    <item>
      <title>Repocks: Enable RAG from In-Repo Documentation</title>
      <dc:creator>Boke0 / Taigen Takeshita</dc:creator>
      <pubDate>Sat, 02 Aug 2025 18:28:22 +0000</pubDate>
      <link>https://forem.com/boke0/repocks-enable-rag-from-in-repo-documentation-4h6h</link>
      <guid>https://forem.com/boke0/repocks-enable-rag-from-in-repo-documentation-4h6h</guid>
      <description>&lt;h1&gt;
  
  
  Background: The Rise of “Context Engineering”
&lt;/h1&gt;

&lt;p&gt;Recently, &lt;em&gt;Vibe Coding&lt;/em&gt; has been gaining traction, popularizing a development experience centered around AI assistants. In this workflow, it's common to consolidate prompt instructions and development guidelines into a &lt;code&gt;CLAUDE.md&lt;/code&gt; or similar file, which is then read by the AI model.&lt;/p&gt;

&lt;p&gt;As a result, feeding information effectively to AI has become increasingly important. A new concept called &lt;strong&gt;Context Engineering&lt;/strong&gt; is emerging as a successor to Prompt Engineering:&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://simonwillison.net/2025/Jun/27/context-engineering/#atom-everything" rel="noopener noreferrer" class="c-link"&gt;
            Context engineering
          &lt;/a&gt;
        &lt;/h2&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
          simonwillison.net
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;However, this approach has its challenges. Bundling all critical project knowledge into a &lt;code&gt;CLAUDE.md&lt;/code&gt; file can quickly exceed the model's context window and lead to degraded output quality.&lt;/p&gt;

&lt;p&gt;To solve this, I wondered if it would be possible to build a lightweight, project-local RAG (Retrieval-Augmented Generation) system. However, most examples I found focused on searching across general documentation on a developer’s machine, rather than documents within a single project.&lt;/p&gt;

&lt;h1&gt;
  
  
  Introducing: &lt;strong&gt;Repocks&lt;/strong&gt;, a Local MCP Server for In-Repo RAG
&lt;/h1&gt;

&lt;p&gt;To address this, I built &lt;strong&gt;Repocks&lt;/strong&gt;, a Local MCP (Multi-Context Provider) Server that indexes and retrieves in-repo documentation to answer questions contextually.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/boke0" rel="noopener noreferrer"&gt;
        boke0
      &lt;/a&gt; / &lt;a href="https://github.com/boke0/repocks" rel="noopener noreferrer"&gt;
        repocks
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Turn your repository into local RAG / MCPServer.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Repocks&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/boke0/repocks/./logo.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fboke0%2Frepocks%2F.%2Flogo.png" alt="Repocks"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Transform your Markdown documentation into an intelligent knowledge base. Repocks indexes your documents and provides AI-powered search and Q&amp;amp;A capabilities through an MCP server.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;What is Repocks?&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;Repocks turns your collection of Markdown files into a searchable knowledge base that AI assistants can query. Whether you have technical documentation, meeting notes, or personal knowledge management files, Repocks makes them accessible through natural language queries.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Key Benefits&lt;/h3&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Smart Search&lt;/strong&gt;: Find relevant information using natural language, not just keywords&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI-Powered Q&amp;amp;A&lt;/strong&gt;: Get comprehensive answers based on your documentation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Easy to Update&lt;/strong&gt;: Run index command to sync changes in your documents&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Works with Any MCP Client&lt;/strong&gt;: Compatible with Claude Desktop, Cline, and other MCP-supporting AI tools&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local &amp;amp; Private&lt;/strong&gt;: Your data stays on your machine&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Quick Start&lt;/h2&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Prerequisites&lt;/h3&gt;

&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Node.js 20.9.0 or higher&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://ollama.ai/" rel="nofollow noopener noreferrer"&gt;Ollama&lt;/a&gt; running locally&lt;/li&gt;
&lt;li&gt;npm, yarn, pnpm, etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Installation&lt;/h3&gt;

&lt;/div&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; Install Repocks&lt;/span&gt;
npm install -g repocks
&lt;/pre&gt;…
&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/boke0/repocks" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  Tech Stack
&lt;/h2&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.amazonaws.com%2Fuploads%2Farticles%2Fbvonisdg5e9nibobjpg3.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%2Fbvonisdg5e9nibobjpg3.png" alt="Architecture"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Repocks is built using &lt;strong&gt;Mastra&lt;/strong&gt;, a modern AI agent framework. It separates concerns by using one model for text generation and another for embedding and retrieval. Both run locally to avoid any API costs.&lt;/p&gt;

&lt;p&gt;By default:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Text generation&lt;/strong&gt;: &lt;code&gt;qwen3:4b&lt;/code&gt; (via Ollama)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Embedding&lt;/strong&gt;: &lt;code&gt;mxbai-embed-large&lt;/code&gt; (via Ollama)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;p&gt;Repocks exposes two main operations: &lt;strong&gt;Indexing&lt;/strong&gt; and &lt;strong&gt;Agent Querying&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Indexing
&lt;/h3&gt;

&lt;p&gt;You can trigger indexing via the CLI or from an MCP client.&lt;/p&gt;

&lt;p&gt;Here's what happens under the hood:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Load Markdown documents (defaults: &lt;code&gt;docs/**/*.md&lt;/code&gt; and &lt;code&gt;~/.repocks/**/*.md&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Generate vector embeddings using the Ollama embedding model&lt;/li&gt;
&lt;li&gt;Store both the embeddings and raw text in &lt;strong&gt;DuckDB&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Each project maintains its own DuckDB file at &lt;code&gt;.repocks/store.duckdb&lt;/code&gt;, ensuring clean separation between projects.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Agent Querying
&lt;/h3&gt;

&lt;p&gt;This is done via the MCP Client. It performs semantic search on your indexed docs and generates answers based on retrieved context:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The AI agent uses the Ollama chat model to transform your query into an embedding and performs cosine similarity search in DuckDB&lt;/li&gt;
&lt;li&gt;Relevant documents are retrieved and used to generate a contextual answer&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can also use only search by &lt;code&gt;documentQueryTool&lt;/code&gt;, but it’s not recommended as a workaround for context window limitations.&lt;/p&gt;

&lt;h1&gt;
  
  
  Getting Started
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;Install with npm:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; repocks
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You’ll also need to install &lt;strong&gt;Ollama&lt;/strong&gt; and pull the necessary models:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ollama: &lt;a href="https://ollama.com/download" rel="noopener noreferrer"&gt;Download here&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ollama pull qwen3:4b
ollama pull mxbai-embed-large
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Indexing Documents
&lt;/h2&gt;

&lt;p&gt;Move to your project directory and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /path/to/project
repocks index
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will create a DuckDB file at &lt;code&gt;.repocks/store.duckdb&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ tree .repocks
.repocks
└── store.duckdb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Using Repocks with Claude Code
&lt;/h2&gt;

&lt;p&gt;You can register Repocks as an MCP server for Claude Code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude mcp add repocks &lt;span class="nt"&gt;--&lt;/span&gt; repocks start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then in Claude Code, run &lt;code&gt;/mcp&lt;/code&gt; and verify that &lt;code&gt;repocks&lt;/code&gt; is connected:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Manage MCP servers
  1. repocks     ✔ connected · Enter to view details
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;The old model of centralizing all project knowledge in a single &lt;code&gt;CLAUDE.md&lt;/code&gt; file no longer scales. As projects grow, this leads to bloated context and lower-quality model responses.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Repocks&lt;/strong&gt; changes that by delivering the right context at the right time—dynamically, not statically.&lt;/p&gt;

&lt;p&gt;In my projects, I now include an instruction like:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Ask Repocks about project-specific details when designing or implementing anything involving .”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you're a team looking to improve both productivity and model accuracy, Repocks might be just what you need.&lt;/p&gt;

&lt;p&gt;Check out the GitHub repo and try it out in your own workflow:&lt;br&gt;
👉 &lt;a href="https://github.com/boke0/repocks" rel="noopener noreferrer"&gt;https://github.com/boke0/repocks&lt;/a&gt;&lt;/p&gt;

</description>
      <category>vibecoding</category>
      <category>rag</category>
      <category>mcp</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
