<?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[I'm Khang Publication]]></title><description><![CDATA[Field notes on AI tools, coding agents, workflows, costs, failures, and lessons from real experiments by Khang Nguyen.]]></description><link>https://im-khang.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6a8db7403454e375f5e209db/65d4bb26-ce97-4427-bf81-88f155d5b3a3.png</url><title>I&apos;m Khang Publication</title><link>https://im-khang.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Tue, 27 Oct 2026 09:42:04 GMT</lastBuildDate><atom:link href="https://im-khang.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How I Evaluated an Ecommerce Analytics Agent: Answers, SQL, Tool Use, and Safety]]></title><description><![CDATA[Proof boundary. I built this as a capstone for the Google × Kaggle 5-Day AI Agents course. The public repository records 17/17 Google ADK evaluation cases…]]></description><link>https://im-khang.hashnode.dev/how-i-evaluated-an-ecommerce-analytics-agent-answers-sql-tool-use-and-safety</link><guid isPermaLink="true">https://im-khang.hashnode.dev/how-i-evaluated-an-ecommerce-analytics-agent-answers-sql-tool-use-and-safety</guid><dc:creator><![CDATA[Khang Nguyen]]></dc:creator><pubDate>Wed, 16 Sep 2026 15:46:19 GMT</pubDate><content:encoded><![CDATA[<blockquote>
<p><strong>Proof boundary.</strong> I built this as a capstone for the Google × Kaggle 5-Day AI Agents course. The public repository records 17/17 Google ADK evaluation cases and 12/12 agents-cli evaluation cases passing in a single recorded local run. This is a local evaluation result, not a production deployment, customer outcome, cost study, or latency benchmark.</p>
<p><strong>Metric coverage caveat.</strong> The four custom metrics are repository-defined and uneven. <code>intent_satisfaction</code> carries markers for 12 of the 17 ADK cases, so 5 cases pass it without a marker; <code>grounded_response</code> passes on a minimum-length check; <code>tool_use_quality</code> passes on a table-name match in prose. Read the counts as coverage of the recorded suites, not as independent proof of analytical quality. Repeatability across model runs is future work, not a measured result.</p>
</blockquote>
<h2>The decision I wanted to support</h2>
<p>Operational data questions often arrive in plain language: which state has the worst on-time delivery, where freight is highest, or which seller pattern needs review? The useful system behavior is not “sound confident.” It is to choose the right data path, run a bounded query, and return an answer that can be checked.</p>
<p>I built the <strong>Olist Ecommerce Analytics Agent</strong> around Brazilian ecommerce data in BigQuery. It is a Google ADK multi-agent system for read-only questions across fulfillment, seller operations, customer experience, payments, and geography.</p>
<h2>System boundary</h2>
<table>
<thead>
<tr>
<th>Stage</th>
<th>Component</th>
<th>Boundary</th>
</tr>
</thead>
<tbody><tr>
<td>Input</td>
<td>Operations question</td>
<td>Plain-language question about fulfillment, seller operations, customer experience, payments, or geography</td>
</tr>
<tr>
<td>Routing</td>
<td>ADK routing</td>
<td>Selects the single best agent via <code>transfer_to_agent</code></td>
</tr>
<tr>
<td>Agents</td>
<td>Fulfillment, seller operations, customer experience, data analyst</td>
<td>One agent per department, plus direct specialists</td>
</tr>
<tr>
<td>Read path</td>
<td>Custom <code>query_bigquery</code></td>
<td>SELECT only; 10 GB processing cap; 30-second timeout</td>
</tr>
<tr>
<td>Read path</td>
<td>First-party BigQueryToolset</td>
<td><code>WriteMode.PROTECTED</code> blocks permanent writes to user tables; forecast and anomaly tools may create temporary session artifacts such as models</td>
</tr>
<tr>
<td>Output</td>
<td>Cited analysis</td>
<td>Query-backed answer returned to the operator</td>
</tr>
</tbody></table>
<p>The custom <code>query_bigquery</code> path accepts SELECT statements and enforces a 10 GB processing cap plus a 30-second timeout. The first-party BigQueryToolset has a different boundary: <code>WriteMode.PROTECTED</code> blocks permanent writes to user tables, but forecast and anomaly tools may create temporary session artifacts such as models. The cap and timeout are not documented across every first-party tool path. These controls narrow risk; they do not make the capstone production-safe.</p>
<h2>What I evaluated</h2>
<p>I used two local suites recorded in the public repository.</p>
<table>
<thead>
<tr>
<th>Suite</th>
<th>Recorded result</th>
<th>What it checks</th>
</tr>
</thead>
<tbody><tr>
<td>Google ADK evaluation</td>
<td>17/17 cases passed</td>
<td>Fulfillment, seller operations, customer experience, payments, schema/BI, refusal, and cross-domain briefing cases</td>
</tr>
<tr>
<td>agents-cli evaluation</td>
<td>12/12 cases passed</td>
<td>Tool-use quality, grounded response, intent satisfaction, and SQL safety</td>
</tr>
</tbody></table>
<p>The cases include questions such as late delivery by state, seller review gaps, payment mix, freight by seller state, schema discovery, out-of-scope refusal, and an executive briefing pipeline. A passing count matters only with a boundary: it means these recorded cases passed under this evaluation design. It does not prove performance on new schemas, live operational data, adversarial prompts, changing business definitions, or high-volume traffic.</p>
<h2>Why answer quality alone is too weak</h2>
<p>For operational analytics, an answer can sound plausible while using the wrong tool, applying the wrong filter, or computing a number that does not reconcile to the source table. I kept four dimensions visible:</p>
<ol>
<li><strong>Grounded response:</strong> answer follows available data rather than invented values.</li>
<li><strong>Tool-use quality:</strong> agent selects a relevant data path and parameters.</li>
<li><strong>Intent satisfaction:</strong> answer addresses the decision question.</li>
<li><strong>SQL safety:</strong> no write query, excessive processing, or unsupported behavior.</li>
</ol>
<p>This is why I would evaluate an analytics agent as a system, not as a chat response. Future work should add repeatability across model runs, accepted SQL/result traces, semantic tests for ambiguous terms such as “on time,” “late,” “seller,” or “state,” and a human approval record for any proposed action.</p>
<h2>What this build does not prove</h2>
<ul>
<li>No production deployment or customer workflow outcome.</li>
<li>No measured business improvement, revenue, stockout reduction, or cost saving.</li>
<li>No current latency or inference-cost benchmark in this article.</li>
<li>No authorization model for a customer warehouse or ERP.</li>
<li>No evidence that an agent should autonomously write purchase orders, inventory transfers, or supplier actions.</li>
</ul>
<p>The appropriate next boundary is read-only decision support: retrieve the relevant facts, show query-backed reasoning, and let an operator decide whether to act.</p>
<h2>Reproduce or inspect it</h2>
<p>The public repository includes the ADK app, tool boundary, evaluation datasets/configuration, and commands for re-running the local suites. Start with the <a href="https://github.com/im-khang/kaggle-5days-vibe-coding">repository README</a>, then inspect its test and tool directories before adapting the pattern to another dataset.</p>
<p>If you are building a similar system, begin with a small decision set, define expected answers and allowed queries, add refusal cases, and keep the database access read-only until you can inspect failure traces and human-review requirements.</p>
<h2>Sources</h2>
<ul>
<li><a href="https://github.com/im-khang/kaggle-5days-vibe-coding">Olist Ecommerce Analytics Agent repository</a></li>
<li><a href="https://google.github.io/adk-docs/">Google ADK documentation</a></li>
<li><a href="https://github.com/google/agents-cli">Google agents-cli</a></li>
<li><a href="https://www.databricks.com/blog/transforming-supply-chain-management-ai-agents">Databricks: Transforming Supply Chain Management with AI Agents</a></li>
</ul>
]]></content:encoded></item><item><title><![CDATA[How Archify Turns Codebase Maps Into Reviewed Technical Artifacts]]></title><description><![CDATA[A research-based guide to Archify: typed JSON IR, deterministic HTML and SVG, validation, diagram types, and limits for AI-assisted codebases.]]></description><link>https://im-khang.hashnode.dev/archify-codebase-maps-reviewed-technical-artifacts</link><guid isPermaLink="true">https://im-khang.hashnode.dev/archify-codebase-maps-reviewed-technical-artifacts</guid><category><![CDATA[software architecture]]></category><category><![CDATA[Developer Tools]]></category><category><![CDATA[Artificial Intelligence]]></category><dc:creator><![CDATA[Khang Nguyen]]></dc:creator><pubDate>Tue, 01 Sep 2026 06:30:26 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1788251165444/dcb8f57b-bee3-4aaa-978f-4065deb2eae3.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote>
<p>Used for: assessing a tool for explaining AI-assisted codebases while preparing this publication workflow. Tested: source review of Archify <code>v2.16.0</code>, 2026-09-01.</p>
<p>Verdict: use when a team needs a reproducible technical map that an AI coding agent can refine and a human can inspect. Avoid it when the job is freehand sketching or a general-purpose diagram editor.</p>
</blockquote>
<h2>Quick verdict</h2>
<ul>
<li><strong>Best for:</strong> architecture reviews, onboarding maps, workflow explanations, and before/after diagram comparisons.</li>
<li><strong>Avoid if:</strong> the requirement is WYSIWYG drawing, automatic Mermaid parsing, or hosted collaborative diagram editing.</li>
<li><strong>Cost:</strong> Archify is MIT licensed. Running it still requires a compatible coding-agent environment and Node.js where its renderer runs.</li>
<li><strong>Main limitation:</strong> validation can check the supplied diagram structure and rendering rules; it cannot prove that an agent’s model of a real system is complete or operationally correct.</li>
</ul>
<p>AI-assisted coding makes it cheap to add routes, workers, integrations, and data stores. It does not make the resulting system easy to explain. The usual answer is a diagram, but screenshots drift, manual edits are difficult to review, and a polished drawing can still overstate what a codebase does.</p>
<p><a href="https://github.com/tt-a1i/archify">Archify</a> is built around a narrower job: turn a codebase analysis or system description into an inspectable technical artifact. An agent produces typed JSON intermediate representation (IR); Archify validates it and deterministically compiles it to self-contained HTML and SVG. The result can be opened locally, shared as one file, and exported in common formats.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1788251164321/7b36f7a0-54bb-485d-89bc-410fa6958c5e.png" alt="A code editor feeding a system map with browser, API, cache, and database nodes." /></p>
<h2>What I used it for</h2>
<p>This was a research-only evaluation, not a claim that Archify has been run against every system in this publication. The practical question was narrower: what should a developer use when a growing project needs a system map that is more durable than a whiteboard screenshot?</p>
<p>That question appears early in small products. A project may begin with a page and an API. Then it accumulates authentication, queues, caches, background work, analytics, and third-party services. The code can remain understandable file by file while the overall path becomes hard to describe. The same issue shows up in applied builds: a public project such as the <a href="/builds/">Olist Ecommerce Analytics Agent</a> is easier to evaluate when its roles, data boundary, and query constraints can be presented as a concrete system map rather than a long paragraph.</p>
<p>Archify supports five diagram types, each aimed at a different question:</p>
<ol>
<li><strong>Architecture</strong> diagrams for components, services, storage, boundaries, and a primary path.</li>
<li><strong>Workflow</strong> diagrams for ordered steps, approvals, branches, exceptions, and runbooks.</li>
<li><strong>Sequence</strong> diagrams for calls and returns over time, such as an authentication check or cache fallback.</li>
<li><strong>Data-flow</strong> diagrams for sources, transforms, stores, consumers, and sensitivity boundaries.</li>
<li><strong>Lifecycle</strong> diagrams for states, retries, waits, cancellation, and terminal outcomes.</li>
</ol>
<p>Choosing a type matters. An architecture map should not pretend to explain timing. A sequence should not attempt to carry every infrastructure detail. A lifecycle should make waits and terminal states legible instead of hiding them behind generic arrows.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1788251165095/830c33b8-ba3e-47d4-80ce-877f7087941b.png" alt="Five abstract technical diagram panels arranged as a grid, representing different ways to explain a system." /></p>
<h2>Setup or workflow</h2>
<p>The repository documents the skill installation command:</p>
<pre><code class="language-bash">npx skills add tt-a1i/archify -g
</code></pre>
<p>Archify documents workflows for Cursor, Claude Code, Codex CLI, and OpenCode. A useful first prompt is deliberately scoped: ask for the core components, one primary path, external dependencies, and trust boundaries. Resist the urge to ask for every class and service at once. A map with too many edges is not more truthful; it is only harder to read.</p>
<p>For an unfamiliar repository, a bounded request can look like this:</p>
<pre><code class="language-text">Analyze this repository, then use Archify to create a high-level runtime architecture diagram.
Show 8–12 core components, one primary path, external dependencies, and trust boundaries.
Put supporting detail in cards instead of adding more edges.
</code></pre>
<p>The agent then creates typed JSON IR. Archify’s documented process validates schema, layout, HTML/SVG rendering, routes, and label-to-route clearance before a showcase-quality artifact replaces a prior verified output. This is the useful boundary: an agent can propose the interpretation, while the renderer applies repeatable checks to the artifact it delivers.</p>
<p>After that, refinement should stay specific. Add one dependency. Move one component. Highlight one rollback path. A controlled change is easier to review than regenerating the entire diagram from a vague request.</p>
<h2>What worked in the documented design</h2>
<p>Archify’s strongest idea is not a visual preset. It is the separation between meaning and rendering. Typed IR provides a source that can be inspected and revised; deterministic compilation produces a consistent artifact from that source; validation keeps layout and route constraints inside the delivery loop.</p>
<p>The resulting HTML supports more than a static view. The documented viewer can search nodes, trace authored routes, inspect upstream or downstream reach, compare semantic roles, and play guided stories. Those interactions only reuse authored nodes and relationships. That constraint is important: a technical viewer should not invent topology while a reader is trying to understand a real system.</p>
<p>Architecture Delta is another useful example of restraint. Given validated Before, Delta, and After snapshots, it reports authored additions, removals, changes, moves, and reroutes. It does not claim performance impact, security improvement, merge safety, or runtime risk unless evidence outside the diagram supports those conclusions. For code review, that distinction is healthier than treating a changed diagram as proof that a change is safe.</p>
<p>The export surface is practical: Archify documents self-contained HTML plus PNG, SVG, WebM, and 1200×630 share cards. That suits an architecture review, a README, a release note, or a team handoff without requiring a separate hosted diagram product.</p>
<h2>What broke or costs more than expected</h2>
<p>A validated diagram is not a verified system. The renderer can reject malformed source, confusing routes, and visual collisions. It cannot know whether the agent missed a hidden queue, misunderstood a permissions boundary, or inferred behavior from an incomplete repository scan. Treat the diagram as a communication artifact that deserves code review, not as runtime monitoring or a substitute for tests.</p>
<p>There is also an intentional scope boundary. Archify is not a general drawing editor, a Mermaid theme, automatic Mermaid parsing, hosted sharing, or a WYSIWYG canvas. That is not a defect when the need is repeatable technical communication. It is a poor fit when a workshop needs people to sketch freely and negotiate the model live.</p>
<p>The same rule applies to source evidence. Archify can link evidence-backed nodes to revision-verified public source when that mode is requested. Ordinary diagrams may remain source-free. Readers should ask which kind of map they are viewing before treating it as a source-level audit.</p>
<h2>Alternatives and trade-offs</h2>
<p>Mermaid is the lower-friction option when plain-text diagrams inside documentation are enough. A design canvas is better when manual composition and collaborative sketching are the main jobs. A slide can be better when the audience needs a short, curated narrative rather than an explorable map.</p>
<p>Archify fits between those choices. It is for teams that already work through coding agents and want a diagram source, renderer, validator, and viewer in the same workflow. It brings more structure than a hand-drawn diagram and more visual interaction than a text-only diagram definition. That structure costs prompt discipline and a review step.</p>
<h2>Tips to reuse</h2>
<ol>
<li>Start with one question per map: system structure, one workflow, one request path, one data journey, or one lifecycle.</li>
<li>Keep the first architecture map to 8–12 core components. Put nuance in cards instead of crossing every possible edge.</li>
<li>Ask the agent to state unknowns. Missing information is better than invented topology.</li>
<li>Generate a Before snapshot before a structural change and an After snapshot afterward. Use Delta to explain the authored difference, not to claim operational impact.</li>
<li>Review the artifact alongside source and tests. A map helps people reason; it does not replace evidence.</li>
</ol>
<p>For broader context on using AI tools in real project work, see this publication’s <a href="/work/">project notes</a> and public <a href="/builds/">build records</a>.</p>
<h2>Sources and related reading</h2>
<ul>
<li><a href="https://github.com/tt-a1i/archify">Archify repository and README</a></li>
<li><a href="https://tt-a1i.github.io/archify/">Archify project page</a></li>
<li><a href="https://tt-a1i.github.io/archify/guide.html">Archify scenario guide</a></li>
<li><a href="https://tt-a1i.github.io/archify/gallery.html">Archify Proof Lab</a></li>
</ul>
]]></content:encoded></item></channel></rss>