<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Vishal's Tech Journal]]></title><description><![CDATA[Vishal's Tech Journal]]></description><link>https://vishalj.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6a3908192c9323d953c1455c/433b1f3b-88bd-4a0e-a682-6409eaefa55b.jpg</url><title>Vishal&apos;s Tech Journal</title><link>https://vishalj.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Mon, 19 Oct 2026 17:13:11 GMT</lastBuildDate><atom:link href="https://vishalj.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Building a Wiki LLM: A Knowledge Layer for AI Coding Agents]]></title><description><![CDATA[Building a Wiki LLM: A Knowledge Layer for AI Coding Agents
AI coding agents can explore repositories, understand code, generate implementations, and help developers move faster. But as projects grow,]]></description><link>https://vishalj.hashnode.dev/wiki-llm-knowledge-layer-ai-coding-agents</link><guid isPermaLink="true">https://vishalj.hashnode.dev/wiki-llm-knowledge-layer-ai-coding-agents</guid><category><![CDATA[AI]]></category><category><![CDATA[llm]]></category><category><![CDATA[ai agents]]></category><category><![CDATA[software development]]></category><category><![CDATA[Developer Tools]]></category><dc:creator><![CDATA[Vishal]]></dc:creator><pubDate>Tue, 29 Sep 2026 05:18:08 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6a3908192c9323d953c1455c/0209fb36-03b3-4b2a-b897-0ec8bb7492f3.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1>Building a Wiki LLM: A Knowledge Layer for AI Coding Agents</h1>
<p>AI coding agents can explore repositories, understand code, generate implementations, and help developers move faster. But as projects grow, a recurring problem becomes difficult to ignore:</p>
<p><strong>Every new task can require the agent to rediscover knowledge that the team already has.</strong></p>
<p>Repository structure, architectural decisions, API contracts, database relationships, coding conventions, and implementation constraints are often scattered across source files, documentation, and previous conversations.</p>
<p>This creates an opportunity to improve how coding agents access engineering knowledge.</p>
<p>I have been experimenting with a <strong>Wiki LLM setup</strong> inspired by the idea of maintaining a structured, continuously evolving knowledge base for AI-assisted development.</p>
<p>The goal is simple: instead of making an agent reconstruct the entire system for every task, give it access to the relevant engineering context.</p>
<h2>1. The context problem in AI-assisted development</h2>
<p>Consider a task such as adding a new endpoint to an existing FastAPI service.</p>
<p>Before implementing it, an agent may need to understand:</p>
<ul>
<li><p>The repository and module structure</p>
</li>
<li><p>Existing API patterns and authentication</p>
</li>
<li><p>Database models and relationships</p>
</li>
<li><p>Service dependencies</p>
</li>
<li><p>Architectural decisions</p>
</li>
<li><p>Error-handling conventions</p>
</li>
<li><p>Constraints that must not be violated</p>
</li>
</ul>
<p>Some of this information is available directly in the code. Other information exists in documentation or is implicit in previous engineering decisions.</p>
<p>Without a reliable knowledge layer, the agent may repeatedly inspect files, infer relationships, and reconstruct context.</p>
<p>This can increase token consumption, latency, and the chance of inconsistent assumptions.</p>
<p>The issue is not simply that an agent has a limited context window. It is also that <strong>context needs to be selected, organized, and kept accurate.</strong></p>
<h2>2. What is a Wiki LLM?</h2>
<p>A Wiki LLM is a structured knowledge base designed to work alongside an LLM or AI agent.</p>
<p>Rather than treating every interaction as an isolated task, the system maintains reusable knowledge about the project.</p>
<p>My setup organizes engineering knowledge into areas such as:</p>
<ul>
<li><p><strong>Architecture:</strong> System components and their responsibilities</p>
</li>
<li><p><strong>Concepts:</strong> Core domain knowledge and technical explanations</p>
</li>
<li><p><strong>ADRs:</strong> Architectural decisions and their rationale</p>
</li>
<li><p><strong>Project knowledge:</strong> Project-specific implementation details</p>
</li>
<li><p><strong>Relationships:</strong> Dependencies between services, modules, and components</p>
</li>
<li><p><strong>Constraints:</strong> Rules and assumptions that implementations must respect</p>
</li>
<li><p><strong>Diagrams:</strong> Visual representations of system architecture and flows</p>
</li>
<li><p><strong>Audits:</strong> Broken links, inconsistencies, and documentation gaps</p>
</li>
</ul>
<p>The wiki is not intended to replace the source code. It provides a navigable knowledge layer that helps an agent understand the codebase more efficiently.</p>
<h2>3. Architecture: From repository exploration to knowledge retrieval</h2>
<p>A conventional agent workflow often looks like this:</p>
<pre><code class="language-text">Developer Task
      |
      v
   AI Agent
      |
      v
Explore Repository
      |
      v
Reconstruct Context
      |
      v
Implement and Test
</code></pre>
<p>A knowledge-assisted workflow introduces a retrieval step:</p>
<pre><code class="language-text">Developer Task
      |
      v
   AI Agent
      |
      v
Retrieve Relevant Knowledge
      |
      +---- Architecture
      +---- ADRs and Constraints
      +---- Related Components
      |
      v
Inspect Relevant Source Code
      |
      v
Implement and Test
      |
      v
Update Knowledge When Needed
</code></pre>
<p>The distinction is important: the agent still inspects source code when necessary. The wiki reduces unnecessary rediscovery; it does not eliminate the need to verify implementation details.</p>
<p>The ideal workflow combines documented knowledge with the current state of the repository.</p>
<h2>4. How can this reduce token usage?</h2>
<p>Token savings come from avoiding repeated context loading and retrieving only the information relevant to a task.</p>
<p>Consider an illustrative example:</p>
<table>
<thead>
<tr>
<th>Context source</th>
<th>Without structured retrieval</th>
<th>With structured retrieval</th>
</tr>
</thead>
<tbody><tr>
<td>Repository and documentation exploration</td>
<td>25,000 tokens</td>
<td>5,000 tokens</td>
</tr>
<tr>
<td>Relevant architecture and decisions</td>
<td>Included above</td>
<td>2,000 tokens</td>
</tr>
<tr>
<td>Total</td>
<td>25,000 tokens</td>
<td>7,000 tokens</td>
</tr>
</tbody></table>
<p>In this example, the context reduction is:</p>
<pre><code class="language-text">(25,000 - 7,000) / 25,000 × 100 = 72%
</code></pre>
<p>This is an <strong>illustrative calculation, not a benchmark of my setup</strong>.</p>
<p>Actual savings depend on the repository, task complexity, retrieval quality, model, caching, and how much source code must still be inspected.</p>
<p>There is also an important distinction between reducing the tokens needed to understand a task and reducing total API usage. A workflow may save input tokens while still using substantial tokens for implementation, reasoning, and testing.</p>
<p>For a meaningful evaluation, I would measure:</p>
<ul>
<li><p>Input tokens per task</p>
</li>
<li><p>Output tokens per task</p>
</li>
<li><p>Total API cost</p>
</li>
<li><p>Time to complete the task</p>
</li>
<li><p>Number of repository exploration steps</p>
</li>
<li><p>Implementation correctness</p>
</li>
<li><p>Rework required after review</p>
</li>
</ul>
<p>The objective is not to minimize tokens at any cost. It is to provide the right context with less unnecessary overhead.</p>
<h2>5. Why not just use RAG?</h2>
<p>Retrieval-Augmented Generation (RAG) is a natural option for retrieving relevant information from a large collection of documents.</p>
<p>However, a structured engineering wiki and RAG solve slightly different problems.</p>
<p><strong>RAG</strong> focuses on finding relevant information from a knowledge collection.</p>
<p><strong>A structured wiki</strong> also focuses on how knowledge is organized, connected, maintained, and validated.</p>
<p>For example, an architecture decision may link to a service, a database model, and a specific implementation constraint. Those relationships can help an agent understand not only what a component does, but also why it was designed that way.</p>
<p>These approaches are complementary. A wiki can be used with keyword search, graph traversal, embeddings, or a RAG pipeline.</p>
<p>For a smaller project, Markdown files and targeted retrieval may be sufficient. A vector database is not automatically necessary.</p>
<h2>6. Keeping the knowledge trustworthy</h2>
<p>A knowledge base becomes less useful when it is outdated or contradicts the code.</p>
<p>This is one of the most important engineering challenges in the setup.</p>
<p>A useful knowledge workflow needs safeguards:</p>
<p><strong>Source-of-truth boundaries</strong></p>
<p>The repository remains authoritative for the current implementation. The wiki explains architecture, intent, and relationships, but code must be checked before implementation decisions are made.</p>
<p><strong>Link integrity</strong></p>
<p>References between wiki pages should be validated so that navigation does not silently break.</p>
<p><strong>Consistency checks</strong></p>
<p>Audits should identify contradictory statements, stale documentation, and missing coverage.</p>
<p><strong>Controlled updates</strong></p>
<p>Agents should not freely rewrite shared engineering knowledge without appropriate validation. Proposed changes can be reviewed before becoming part of the trusted wiki.</p>
<p><strong>Knowledge freshness</strong></p>
<p>Changes to APIs, database schemas, or architecture should trigger a review of the related knowledge.</p>
<p>These controls help prevent the wiki from becoming another source of outdated assumptions.</p>
<h2>7. What I am exploring next</h2>
<p>My experiments focus on making the wiki useful as part of an actual agentic development workflow:</p>
<ul>
<li><p>Project-aware context retrieval</p>
</li>
<li><p>Better organization of architecture and domain knowledge</p>
</li>
<li><p>Automated broken-link and consistency audits</p>
</li>
<li><p>Architecture diagrams connected to written documentation</p>
</li>
<li><p>Context budgeting for individual tasks</p>
</li>
<li><p>Controlled knowledge updates</p>
</li>
<li><p>Evaluation of token usage and implementation quality</p>
</li>
</ul>
<p>The longer-term idea is to create a feedback loop in which developers and agents use the same engineering knowledge, while changes to the system are reflected in the knowledge base through a validated process.</p>
<h2>Conclusion</h2>
<p>AI coding agents are becoming increasingly capable of generating and modifying code. But reliable engineering requires more than code generation.</p>
<p>Agents need access to the architecture, decisions, relationships, and constraints that shape a system.</p>
<p>A Wiki LLM provides one way to organize that knowledge and make it reusable across tasks.</p>
<p>The potential benefits go beyond token savings: better consistency, easier onboarding, less repeated exploration, and a clearer connection between implementation and architectural intent.</p>
<p>I am still evaluating the right retrieval strategy and the measurable impact on real development tasks.</p>
<p><strong>Agents can write code. A well-maintained knowledge layer helps them understand why the code exists.</strong></p>
<p>#AI #LLM #AIAgents #SoftwareEngineering #DeveloperTools</p>
]]></content:encoded></item></channel></rss>