<?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: XT</title>
    <description>The latest articles on DEV Community by XT (@xtsoftwarelabs).</description>
    <link>https://dev.to/xtsoftwarelabs</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%2F4044255%2Fd12ce6dc-3727-4568-8620-c587506fd9a2.png</url>
      <title>DEV Community: XT</title>
      <link>https://dev.to/xtsoftwarelabs</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/xtsoftwarelabs"/>
    <language>en</language>
    <item>
      <title>How to Build Efficient Context for Your AI Client to handle incidents</title>
      <dc:creator>XT</dc:creator>
      <pubDate>Thu, 23 Jul 2026 17:32:48 +0000</pubDate>
      <link>https://dev.to/xtsoftwarelabs/how-to-build-efficient-context-for-your-ai-client-4fnd</link>
      <guid>https://dev.to/xtsoftwarelabs/how-to-build-efficient-context-for-your-ai-client-4fnd</guid>
      <description>&lt;p&gt;Most teams that adopt an AI coding or operations assistant eventually reach the same conclusion:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The model is rarely the bottleneck. The bottleneck is context.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A capable model with the wrong context produces a confident, generic answer. The same model with the right context can produce something an engineer can actually use.&lt;/p&gt;

&lt;p&gt;So the practical question is not only:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Which model should we use?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It is also:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What should the context contain, and how should we build it?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A useful context needs more than a large prompt or a folder full of documents. It needs three distinct components:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Rules&lt;/li&gt;
&lt;li&gt;Knowledge&lt;/li&gt;
&lt;li&gt;Retrieval&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Each component solves a different problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Rules: What the AI is expected to do
&lt;/h2&gt;

&lt;p&gt;Rules contain your team’s specific expectations about how work must be performed.&lt;/p&gt;

&lt;p&gt;Examples include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Follow these coding and review standards.&lt;/li&gt;
&lt;li&gt;Never fail over a saturated but healthy primary.&lt;/li&gt;
&lt;li&gt;Escalate this class of error to the infrastructure team.&lt;/li&gt;
&lt;li&gt;Never include customer data in generated output.&lt;/li&gt;
&lt;li&gt;Prefer this internal library over the public alternative.&lt;/li&gt;
&lt;li&gt;Require human approval before performing a production change.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Rules operate differently from general reference material.&lt;/p&gt;

&lt;p&gt;Knowledge tells the AI what is true. Rules tell it what it is allowed and expected to do.&lt;/p&gt;

&lt;p&gt;A general-purpose model cannot automatically know your team’s boundaries, escalation paths, safety requirements, or architectural conventions. Those constraints have to be provided explicitly.&lt;/p&gt;

&lt;p&gt;Because rules change the model’s behavior—not merely the information available to it—a few well-written rules can improve an answer more than several pages of background material.&lt;/p&gt;

&lt;p&gt;This is often the highest-leverage part of a context, and it is also the part most likely to be missing.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Knowledge: How your systems actually work
&lt;/h2&gt;

&lt;p&gt;Knowledge is the standing material that explains your systems and operational practices.&lt;/p&gt;

&lt;p&gt;It commonly includes the following categories.&lt;/p&gt;

&lt;h3&gt;
  
  
  Troubleshooting guides
&lt;/h3&gt;

&lt;p&gt;Troubleshooting guides capture service-specific diagnostic knowledge that experienced engineers often carry in their heads:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which signals matter together&lt;/li&gt;
&lt;li&gt;Which alerts are usually noisy&lt;/li&gt;
&lt;li&gt;How a failure mode presents itself in your environment&lt;/li&gt;
&lt;li&gt;Which apparent symptoms are unrelated&lt;/li&gt;
&lt;li&gt;What should be checked before escalating&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Runbooks and procedures
&lt;/h3&gt;

&lt;p&gt;Runbooks describe the actions needed to operate a system:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How to roll back a service&lt;/li&gt;
&lt;li&gt;How to drain a queue&lt;/li&gt;
&lt;li&gt;How to rotate credentials&lt;/li&gt;
&lt;li&gt;What the deployment pipeline expects&lt;/li&gt;
&lt;li&gt;Which steps must happen in a specific order&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Architecture and domain notes
&lt;/h3&gt;

&lt;p&gt;These documents explain information that may be obvious to your team but invisible to a general model:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Service boundaries&lt;/li&gt;
&lt;li&gt;Ownership&lt;/li&gt;
&lt;li&gt;Data flows&lt;/li&gt;
&lt;li&gt;Dependencies&lt;/li&gt;
&lt;li&gt;Naming conventions&lt;/li&gt;
&lt;li&gt;Business constraints&lt;/li&gt;
&lt;li&gt;Important historical decisions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This knowledge is specific to your organization, and it changes over time.&lt;/p&gt;

&lt;p&gt;A runbook may be rewritten after a postmortem. A troubleshooting guide may become incorrect after a migration. An architecture document may stop reflecting the current service topology.&lt;/p&gt;

&lt;p&gt;Good context therefore treats knowledge as a &lt;strong&gt;living, versioned source&lt;/strong&gt;, not as something permanently embedded into a model and forgotten.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Retrieval: What is true right now
&lt;/h2&gt;

&lt;p&gt;Rules and standing knowledge are not sufficient for many real engineering tasks.&lt;/p&gt;

&lt;p&gt;During an investigation, the AI may also need to answer questions such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What changed in the most recent deployment?&lt;/li&gt;
&lt;li&gt;What is the current error rate?&lt;/li&gt;
&lt;li&gt;When did the incident begin?&lt;/li&gt;
&lt;li&gt;What does the work item actually request?&lt;/li&gt;
&lt;li&gt;Which services are currently unhealthy?&lt;/li&gt;
&lt;li&gt;What appears in the relevant log file?&lt;/li&gt;
&lt;li&gt;Was a similar incident resolved before?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This information already lives in the tools your team uses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Git repositories&lt;/li&gt;
&lt;li&gt;Logging systems&lt;/li&gt;
&lt;li&gt;Monitoring dashboards&lt;/li&gt;
&lt;li&gt;Incident-management platforms&lt;/li&gt;
&lt;li&gt;Work-item systems&lt;/li&gt;
&lt;li&gt;Internal documentation&lt;/li&gt;
&lt;li&gt;Custom APIs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A good context should not attempt to copy all of this information into one giant document.&lt;/p&gt;

&lt;p&gt;Instead, it should provide the AI with a &lt;strong&gt;scoped, preferably read-only way to retrieve the specific information required for the current task&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The three parts of context therefore answer three different questions:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Context component&lt;/th&gt;
&lt;th&gt;Question it answers&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Rules&lt;/td&gt;
&lt;td&gt;What am I allowed and expected to do?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Knowledge&lt;/td&gt;
&lt;td&gt;How does this system work?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Retrieval&lt;/td&gt;
&lt;td&gt;What is true right now?&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;An assistant without retrieval reasons from stale assumptions.&lt;/p&gt;

&lt;p&gt;An assistant without rules may perform the wrong action very efficiently.&lt;/p&gt;

&lt;p&gt;An assistant without domain knowledge may produce advice that sounds reasonable but does not apply to your systems.&lt;/p&gt;

&lt;p&gt;For dependable results, you need all three—and they should be scoped to the task at hand.&lt;/p&gt;

&lt;h2&gt;
  
  
  You can build this manually—at first
&lt;/h2&gt;

&lt;p&gt;A single engineer can assemble a useful context without adopting a new platform.&lt;/p&gt;

&lt;p&gt;For example, you can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Write a Markdown file containing the team’s rules and conventions.&lt;/li&gt;
&lt;li&gt;Attach the relevant runbook and troubleshooting guide.&lt;/li&gt;
&lt;li&gt;Give the assistant access to the directories related to the task.&lt;/li&gt;
&lt;li&gt;Paste in the relevant log excerpt.&lt;/li&gt;
&lt;li&gt;Include the incident or work-item description.&lt;/li&gt;
&lt;li&gt;Explain which systems and actions are out of scope.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This approach works well.&lt;/p&gt;

&lt;p&gt;It is often the correct first step because it forces you to decide what the AI actually needs. That decision is where much of the value comes from.&lt;/p&gt;

&lt;p&gt;Anyone who has used an AI coding assistant seriously has probably already done some version of this.&lt;/p&gt;

&lt;p&gt;The problem is not that manually assembled context is wrong.&lt;/p&gt;

&lt;p&gt;The problem is that it does not scale beyond one person and one moment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why manually assembled context breaks down
&lt;/h2&gt;

&lt;p&gt;Several failure modes appear as soon as context becomes a team practice.&lt;/p&gt;

&lt;h3&gt;
  
  
  It becomes stale
&lt;/h3&gt;

&lt;p&gt;The runbook copied into a prompt last month may have since been updated.&lt;/p&gt;

&lt;p&gt;Nobody remembers to replace the old copy, so the AI continues reasoning from instructions that no longer reflect reality.&lt;/p&gt;

&lt;p&gt;This creates the same danger as outdated documentation, except the outdated material is now being used to generate confident recommendations.&lt;/p&gt;

&lt;h3&gt;
  
  
  It does not transfer between engineers
&lt;/h3&gt;

&lt;p&gt;A carefully assembled context may exist only in one engineer’s:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Local files&lt;/li&gt;
&lt;li&gt;Chat history&lt;/li&gt;
&lt;li&gt;Prompt templates&lt;/li&gt;
&lt;li&gt;Personal notes&lt;/li&gt;
&lt;li&gt;Memory&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When the next engineer goes on call, they have to rebuild it.&lt;/p&gt;

&lt;h3&gt;
  
  
  It drifts between people
&lt;/h3&gt;

&lt;p&gt;Two engineers may assemble slightly different versions of “the payments context.”&lt;/p&gt;

&lt;p&gt;As a result, they can ask the same question and receive different answers—not because the model changed, but because the inputs did.&lt;/p&gt;

&lt;h3&gt;
  
  
  Retrieval becomes manual and lossy
&lt;/h3&gt;

&lt;p&gt;Pasting a log excerpt is easy once.&lt;/p&gt;

&lt;p&gt;Repeating that process for every question creates ongoing overhead. Engineers have to remember:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which system contains the relevant information&lt;/li&gt;
&lt;li&gt;Which time range to select&lt;/li&gt;
&lt;li&gt;Which credentials to use&lt;/li&gt;
&lt;li&gt;How much data to include&lt;/li&gt;
&lt;li&gt;Which sensitive fields must be removed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is also easy to paste either too little information or far more than the AI should receive.&lt;/p&gt;

&lt;h3&gt;
  
  
  There is no reliable record
&lt;/h3&gt;

&lt;p&gt;When an answer turns out to be wrong, it may be difficult to determine what the model was actually given.&lt;/p&gt;

&lt;p&gt;Was it using the current runbook?&lt;/p&gt;

&lt;p&gt;Did it see the deployment history?&lt;/p&gt;

&lt;p&gt;Which directories were available?&lt;/p&gt;

&lt;p&gt;Which rules were active?&lt;/p&gt;

&lt;p&gt;Without a record of the context, debugging an AI answer becomes guesswork.&lt;/p&gt;

&lt;p&gt;These are not primarily model problems. They are organizational problems.&lt;/p&gt;

&lt;p&gt;Ad hoc context works for one engineer working on one task. It does not hold up as a durable team practice.&lt;/p&gt;

&lt;p&gt;Over time, teams need a way to define, version, scope, and share context without migrating all of their knowledge into another heavyweight platform.&lt;/p&gt;

&lt;h2&gt;
  
  
  Turning good context habits into a repeatable system
&lt;/h2&gt;

&lt;p&gt;This is the problem we are working on with &lt;a href="https://www.neatcontext.com/" rel="noopener noreferrer"&gt;NeatContext&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;NeatContext provides a structured way to assemble the three parts of context—rules, knowledge, and retrieval—while keeping the source material close to the teams that own it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rules live in domain profiles
&lt;/h3&gt;

&lt;p&gt;A domain profile is a Markdown-based definition of a team’s:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Guardrails&lt;/li&gt;
&lt;li&gt;Conventions&lt;/li&gt;
&lt;li&gt;Escalation logic&lt;/li&gt;
&lt;li&gt;Operational expectations&lt;/li&gt;
&lt;li&gt;Important constraints&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The relevant profile is connected for a specific task so that the AI works within the boundary defined by that team.&lt;/p&gt;

&lt;h3&gt;
  
  
  Knowledge remains versioned source material
&lt;/h3&gt;

&lt;p&gt;Runbooks, troubleshooting guides, architecture notes, and other documents stay as local or version-controlled source files.&lt;/p&gt;

&lt;p&gt;They are not permanently baked into a model.&lt;/p&gt;

&lt;p&gt;When a runbook changes, the source changes. There is no retraining step and no hidden copy inside model weights that can silently become stale.&lt;/p&gt;

&lt;h3&gt;
  
  
  Current information comes from read-only extensions
&lt;/h3&gt;

&lt;p&gt;Instead of copying every external system into a context document, teams can connect scoped, read-only extensions for tools such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Git repositories&lt;/li&gt;
&lt;li&gt;Internal documentation&lt;/li&gt;
&lt;li&gt;Incident systems&lt;/li&gt;
&lt;li&gt;Monitoring platforms&lt;/li&gt;
&lt;li&gt;Custom APIs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The context defines which extensions are available for a particular task.&lt;/p&gt;

&lt;p&gt;Credentials remain in the operating system’s credential storage rather than being placed directly into prompts.&lt;/p&gt;

&lt;h3&gt;
  
  
  Context is scoped per task
&lt;/h3&gt;

&lt;p&gt;A production incident does not need access to every document, repository, and tool in the company.&lt;/p&gt;

&lt;p&gt;For each task, you can choose the relevant:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Domain profiles&lt;/li&gt;
&lt;li&gt;Knowledge directories&lt;/li&gt;
&lt;li&gt;External tools&lt;/li&gt;
&lt;li&gt;Data sources&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This reduces background noise, unrelated information, and signal dilution.&lt;/p&gt;

&lt;h3&gt;
  
  
  The same context can be reused by a team
&lt;/h3&gt;

&lt;p&gt;A team can define its context once and reuse it across investigations.&lt;/p&gt;

&lt;p&gt;The next engineer on call receives the same rules, knowledge, and retrieval boundaries instead of rebuilding them from memory.&lt;/p&gt;

&lt;p&gt;NeatContext’s &lt;a href="https://docs.neatcontext.com/features/library#the-team-library-optional-read-only" rel="noopener noreferrer"&gt;team library&lt;/a&gt; also allows domain profiles, knowledge, and extensions to be shared read-only across team members.&lt;/p&gt;

&lt;h3&gt;
  
  
  There is a record of what was provided
&lt;/h3&gt;

&lt;p&gt;NeatContext keeps a local activity log showing what context was handed to the AI.&lt;/p&gt;

&lt;p&gt;When an answer needs to be reviewed, engineers can trace it back to its inputs instead of trying to reconstruct the context afterward.&lt;/p&gt;

&lt;h2&gt;
  
  
  NeatContext is not another AI model
&lt;/h2&gt;

&lt;p&gt;One design choice is important to clarify:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NeatContext does not contain an AI model.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It does not read your documents, rank them, or summarize them before your assistant receives them.&lt;/p&gt;

&lt;p&gt;Instead, it defines the context boundary and connects the selected profiles, folders, and read-only tools to the AI client you already use, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Claude Code&lt;/li&gt;
&lt;li&gt;Codex CLI&lt;/li&gt;
&lt;li&gt;Claude Desktop&lt;/li&gt;
&lt;li&gt;ChatGPT Desktop&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The approved AI client performs the actual reading and reasoning.&lt;/p&gt;

&lt;p&gt;The context is explicitly defined by a person rather than inferred by a second model.&lt;/p&gt;

&lt;p&gt;In other words, NeatContext turns the useful habits behind manually assembled prompts into something durable:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Defined&lt;/li&gt;
&lt;li&gt;Versioned&lt;/li&gt;
&lt;li&gt;Scoped&lt;/li&gt;
&lt;li&gt;Shareable&lt;/li&gt;
&lt;li&gt;Connected to current systems&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  See it in action
&lt;/h2&gt;

&lt;p&gt;The following demonstration shows how the same incident can require different actions from different teams when each team provides its own domain context.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  The takeaway
&lt;/h2&gt;

&lt;p&gt;Efficient context is not simply a bigger prompt.&lt;/p&gt;

&lt;p&gt;It is a deliberate combination of:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Rules&lt;/strong&gt; that define what the AI is expected and allowed to do&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Knowledge&lt;/strong&gt; that explains how your systems work&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Retrieval&lt;/strong&gt; that provides current information from the systems your team depends on&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;All three should be scoped tightly to the task.&lt;/p&gt;

&lt;p&gt;You can assemble this context manually today, and doing so is worthwhile. It helps identify which information actually changes the quality of an AI-generated answer.&lt;/p&gt;

&lt;p&gt;But if AI-assisted engineering is going to become a team practice rather than a personal trick, context needs to become:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Versioned&lt;/li&gt;
&lt;li&gt;Scoped&lt;/li&gt;
&lt;li&gt;Shareable&lt;/li&gt;
&lt;li&gt;Repeatable&lt;/li&gt;
&lt;li&gt;Connected to real systems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is the problem we are working on with &lt;a href="https://www.neatcontext.com/" rel="noopener noreferrer"&gt;NeatContext&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can also try the &lt;a href="https://github.com/XTSoftwareLabs/neatcontext-demo" rel="noopener noreferrer"&gt;hands-on NeatContext demo on GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;How are you currently providing domain-specific context to your AI tools? I would be interested to hear what works—and where the process starts to break down.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>devops</category>
      <category>productivity</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
