<?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[V12 Labs]]></title><description><![CDATA[Writing from V12 Labs, an AI transformation partner in Hyderabad, on Company Brain First, RAG, and human-in-the-loop agents.]]></description><link>https://v12labs.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Dec 2026 21:30:06 GMT</lastBuildDate><atom:link href="https://v12labs.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Your Company Needs a Brain Before It Needs AI Agents]]></title><description><![CDATA[Short answer AI transformation is a knowledge problem before it is an agent problem. Our 5-step path to AI-native starts with a Company Brain. Short…]]></description><link>https://v12labs.hashnode.dev/your-company-needs-a-brain-before-it-needs-ai-agents</link><guid isPermaLink="true">https://v12labs.hashnode.dev/your-company-needs-a-brain-before-it-needs-ai-agents</guid><category><![CDATA[ai agents]]></category><category><![CDATA[AI]]></category><category><![CDATA[Software Engineering]]></category><dc:creator><![CDATA[V12 Labs]]></dc:creator><pubDate>Thu, 03 Dec 2026 17:30:21 GMT</pubDate><content:encoded><![CDATA[<p>Short answer</p>
<p>AI transformation is a knowledge problem before it is an agent problem. Our 5-step path to AI-native starts with a Company Brain.</p>
<p>Short answer: AI transformation is an organizational knowledge and execution problem before it is an agent problem. Most pilots stall because the AI does not know how your business actually works: who owns what, how decisions get made, and where the real answers live. The fix is to build a permission-scoped Company Brain first. It is one shared, governed source of company knowledge that every later assistant and agent draws from. That is Step 1 of becoming an AI-native business, and it pays for itself before you automate anything.</p>
<p>If you would rather have V12 Labs build it, get a free build plan. We will put the scope, timeline, and price range in writing. You keep the plan, and if we build it, you own the code, data, and IP from day one.</p>
<p>Why most AI agent pilots stall before production
If you have run an AI pilot in the last two years, the arc probably looked familiar. A team picks a promising use case, such as support triage, proposal drafting, or internal Q&amp;A. A demo works well in week two. By week eight it is quietly shelved, or it limps along with a person double-checking every answer.</p>
<p>The model is rarely the reason. Three structural problems show up repeatedly.</p>
<p>The agent is missing context. A new hire gets weeks of context: how pricing exceptions work, which customers are sensitive, who to ask when a document is out of date. A pilot agent usually gets a prompt and a handful of files. It writes fluent sentences but cannot tell which answer is current and which was superseded last quarter.</p>
<p>Every pilot builds its own knowledge silo. The support pilot ingests the help center and a few tickets. The sales pilot ingests decks and call notes. The HR pilot ingests the handbook. Each team wires up its own retrieval, its own permissions, and its own sync job. Now you have three partial copies of company knowledge, each drifting at its own pace.</p>
<p>AI gets treated like a magic tool instead of a new hire. Nobody expects a new employee to perform well on day one without onboarding, access to the right systems, and a clear picture of what they are allowed to decide. Yet we expect an AI system to do exactly that. Onboarding AI is the same job as onboarding a person: organize the knowledge, define the boundaries, start supervised, and widen trust as it earns it.</p>
<p>The work that gets skipped is not AI work. It is the unglamorous organizational work of making company knowledge findable, current, and governed.</p>
<p>Want this built for you?</p>
<p>We build custom AI agents for businesses, shipped in weeks and owned by you.</p>
<p>Free build plan
Four principles of the Company Brain First approach
We use four principles to decide what to build and in what order.</p>
<ol>
<li><p>Knowledge precedes delegation. You cannot responsibly delegate work to a system that does not know how your business operates. Before an agent drafts a customer reply or approves a refund, it needs access to the policy, the precedent, and the exceptions. If a new employee would need that context, an agent needs it too.</p>
</li>
<li><p>Organizational knowledge is a reusable asset. Knowledge captured once should serve Sales, Support, HR, and Ops. When the pricing rules live in one governed place, the sales assistant, the support agent, and the finance workflow all read from the same source. Fixing an error once fixes it everywhere.</p>
</li>
<li><p>Intelligence before autonomy. Capability should climb in order: knowledge, then understanding, then recommendation, then execution, then autonomy. Start read-only. Let the system answer questions and cite its sources. Then let it recommend actions while a person decides. Only after it has a track record do you let it execute, and only the narrow things you have verified. Skipping rungs is how companies end up with an agent that confidently does the wrong thing at scale.</p>
</li>
<li><p>Step 1 must deliver standalone ROI. A transformation program that only pays off after you reach full autonomy is a bet, not a plan. The first step should be worth doing even if you never build another agent: faster retrieval of answers, faster onboarding of new people, and knowledge that stays when someone leaves. If Step 1 cannot justify itself, the program is too speculative to fund.</p>
</li>
</ol>
<p>The 5-step path from fragmented to AI-native
Here is the path we use with operators. Each step builds on the one before it, and each step should be useful on its own. We call it the Company Brain First model, and it is how we work as an AI transformation partner.</p>
<p>Step	What ships	What breaks if you skip Step 1	Business outcome</p>
<ol>
<li>Build Your Company Brain	A permission-scoped, searchable layer over your documents, processes, decisions, and owners	Not applicable: this is the foundation	Faster answers, faster onboarding, retained knowledge</li>
<li>Empower Your Employees	Internal assistants for Sales, Support, HR, and Ops that answer from the Brain with citations	Assistants hallucinate or give outdated answers, and people stop trusting them	Less time hunting for information, more consistent answers</li>
<li>Automate Repetitive Work	Workflows for intake, routing, drafting, and data entry, grounded in the Brain	Automations encode stale rules and break on exceptions	Lower operating cost, fewer manual handoffs</li>
<li>Put AI Agents to Work	Agents that take bounded actions with human oversight and audit trails	Agents act without context or boundaries, and errors compound	Capacity gains on judgment-heavy tasks, with control</li>
<li>Become an AI-Native Business	Ongoing improvement loops where the Brain, assistants, and agents evolve with the business	Every new initiative restarts from zero	Compounding operational advantage
In practice, Step 1 connects the systems where knowledge already lives (Drive, wikis, ticketing, CRM, chat), maps who is allowed to see what, and captures process knowledge that is not in any document. Step 2 turns that into read-only assistants that always cite sources, so people build confidence while humans stay in control. Step 3 automates dull, high-volume work such as classifying requests and drafting first responses, and because those workflows read from the Brain, a policy change is made once instead of in five automations. Step 4 lets agents take bounded actions, with approvals for anything sensitive and a full audit trail. Step 5 is where AI is simply how the business operates, and new use cases take days instead of quarters.</li>
</ol>
<p>The most common failure we see is jumping to Step 4 because it is the exciting one. Without Step 1, the agent has no reliable source of truth, so every new agent re-solves the same context problem and inherits the same blind spots.</p>
<p>Why a chatbot wired to Google Drive is not a Company Brain
The fastest way to get a demo is to point a chatbot at a shared drive. It is a fair starting experiment, and it will answer some questions well. A real Company Brain differs in three ways.</p>
<p>It represents how the business works, not just what the documents say. Files are only part of company knowledge. The rest lives in processes (how an order moves from request to fulfillment), decisions (why we stopped offering a certain plan), and ownership (who approves what, who to escalate to). A Drive chatbot sees a pile of text. A Company Brain also models the relationships: this policy belongs to this team, this decision superseded that one, this person owns this process. That structure is what lets an assistant answer "who should handle this?" and not only "what does the handbook say?"</p>
<p>It enforces permissions before retrieval, not after. This is the point that separates a toy from something you can put in front of real employees. If access control is handled by a system prompt that says "do not share confidential documents," it will eventually fail, because a prompt is a request, not a control. The correct design inherits permissions from your identity system, whether that is Google Workspace or Microsoft Entra ID, and filters what can be retrieved before anything reaches the model. If a document is not visible to the person asking, it is never retrieved, never placed in context, and cannot be leaked. That is how you make sure an intern never retrieves a CEO-only file, no matter how cleverly the question is phrased.</p>
<p>It is one shared brain, exposed through a standard interface. If every assistant has its own private index, you rebuild the silo problem from earlier. Instead, the Brain should be a single governed layer that any assistant or agent can query. The Model Context Protocol (MCP) is a practical way to expose it: sales, support, and ops tools connect to the same Brain through one interface, with the same permission checks. Retrieval-augmented generation (RAG) is one retrieval layer inside that system, useful for searching documents, but it is not the whole thing. Structured lookups, process definitions, and ownership data matter just as much. The payoff is that every future assistant and agent shares the same source of truth, so you build the knowledge once and reuse it. Our Company Brain page lists what ships in Step 1.</p>
<p>The standalone math for Step 1
Step 1 should be justifiable without any speculation about autonomous agents. Here is the simplest version of that argument.</p>
<p>Illustrative example. Not a client result.</p>
<p>Assume a 50-person company. People lose time every day searching for information, asking colleagues, re-answering the same questions, and re-learning decisions that were already made. Suppose a working Company Brain saves each person 15 minutes per day. Take a loaded cost of $25 per hour and 220 working days per year.</p>
<p>Time saved in theory: 50 people x 0.25 hours x 220 days = 2,750 hours per year.
Not every saved minute turns into useful work, so assume only 50% is realized: about 1,375 hours per year.
Value at $25 per hour: 1,375 x $25 = $34,375 per year.
That number leaves out harder-to-measure benefits such as faster new-hire ramp-up and fewer errors from outdated answers. It assumes no agent ever runs unattended.</p>
<p>Your numbers will differ. A COO or founder can swap in their own headcount, loaded hourly cost, and a conservative capture rate to see whether Step 1 clears the bar. If it does, you have a defensible reason to start, and every later step inherits a foundation you have already paid for.</p>
<p>When not to start with a Company Brain
This approach is not right for everyone, and we would rather say so than sell you something that does not fit.</p>
<p>You already have clean, permissioned knowledge infrastructure. If your documentation is current, well organized, searchable, and access-controlled through your identity provider, you have effectively done Step 1. Enter at a later stage and spend the budget on assistants or workflows.
You have a single, narrow, self-contained automation. If the job is something like extracting fields from invoices with a consistent format into one system, structured inputs and a clear output do not need a company-wide knowledge layer. Build the automation and move on.
Your problem is pure numerical forecasting. Demand forecasting, pricing optimization, and similar statistical problems are about data pipelines and modeling, not organizational knowledge. A Company Brain will not help much there.
If none of those describe you, and your team still spends real time searching for answers or onboarding people by tapping shoulders, the Brain-first route is probably the right place to start.</p>
<p>FAQ
What is a Company Brain?</p>
<p>A Company Brain is a shared, permission-scoped knowledge layer for your business. It connects your documents, systems, processes, decisions, and ownership information, and makes them available to people and AI assistants with citations. It is one governed source of truth rather than a separate index for every tool.</p>
<p>How is a Company Brain different from RAG?</p>
<p>RAG is a retrieval technique: find relevant text and give it to a model. A Company Brain uses RAG as one layer, but also includes process and ownership knowledge, permission enforcement before retrieval, and a standard interface such as MCP so multiple assistants and agents can share it. RAG is a component, and the Brain is the system.</p>
<p>How do you keep confidential documents from leaking?</p>
<p>Permissions are enforced before retrieval, inherited from your identity system such as Google Workspace or Microsoft Entra ID. Content a person cannot access is never retrieved or placed in the model's context. We do not rely on system prompts for access control, because prompts are instructions the model can get wrong, not security controls.</p>
<p>Do we need to clean up all our documents first?</p>
<p>No. Waiting for perfect documentation is a common reason projects never start. A good first phase connects the highest-value sources, shows where content is stale or contradictory, and gives owners a clear list to fix.</p>
<p>How long before we see a return?</p>
<p>Step 1 is designed to pay off on its own: faster answers, faster onboarding, and retained knowledge. Estimate with your own headcount, hourly cost, and a conservative capture rate, then test with a small group before scaling.</p>
<p>Does this mean we should avoid AI agents?</p>
<p>No. Agents are Step 4 for a reason. They are safer and more useful when they draw on a trusted Brain and operate within clear limits. The approach is about sequencing, not avoidance.</p>
<p>Where to go from here
If you want to talk through where your company sits on this path, and whether Step 1 makes sense for you, you can map your AI workflow with us. We will look at where knowledge lives today, where your team loses time, and what a sensible first step would be.</p>
]]></content:encoded></item><item><title><![CDATA[Advanced RAG Architecture: A Practical Guide to Building Reliable AI Retrieval Systems]]></title><description><![CDATA[Most RAG systems fail for a boring reason: the model is asked to answer with the wrong context. The first version usually looks simple. Split documents…]]></description><link>https://v12labs.hashnode.dev/advanced-rag-architecture-a-practical-guide-to-building-reliable-ai-retrieval-systems</link><guid isPermaLink="true">https://v12labs.hashnode.dev/advanced-rag-architecture-a-practical-guide-to-building-reliable-ai-retrieval-systems</guid><category><![CDATA[RAG ]]></category><category><![CDATA[AI]]></category><category><![CDATA[architecture]]></category><category><![CDATA[agents]]></category><dc:creator><![CDATA[V12 Labs]]></dc:creator><pubDate>Wed, 02 Dec 2026 14:25:47 GMT</pubDate><content:encoded><![CDATA[<h1>Advanced RAG Architecture: A Practical Guide to Building Reliable AI Retrieval Systems</h1>
<p>Most RAG systems fail for a boring reason: the model is asked to answer with the wrong context.</p>
<p>The first version usually looks simple. Split documents into chunks, embed the chunks, store them in a vector database, retrieve the top matches, and pass them to the LLM. That is useful for demos, internal FAQs, and small knowledge bases. It is not enough for production systems where users ask ambiguous questions, documents change, tables matter, exact terms matter, and answers need to be audited.</p>
<p>Advanced RAG is not one technique. It is an architecture around retrieval quality.</p>
<p>The goal is to build a system that can:</p>
<ul>
<li>prepare source data without losing meaning</li>
<li>retrieve both semantic matches and exact matches</li>
<li>route different queries to different indexes or tools</li>
<li>decompose complex questions into answerable subquestions</li>
<li>rerank and compress context before generation</li>
<li>verify whether the answer is grounded in the retrieved evidence</li>
<li>measure regressions before users find them</li>
</ul>
<p>Microsoft's guide to <a href="https://learn.microsoft.com/en-us/azure/developer/ai/advanced-retrieval-augmented-generation">advanced retrieval-augmented generation systems</a> is a useful baseline because it frames RAG as three connected phases: ingestion, inference, and evaluation. That is the right mental model. A production RAG system is not just a vector search call. It is a data pipeline, a query pipeline, and a measurement system.</p>
<p>This guide expands that baseline into the architecture patterns we use when deciding how far a RAG system needs to go.</p>
<h2>The simple RAG pattern and why it breaks</h2>
<p>Naive RAG usually follows this flow:</p>
<ol>
<li>Load documents.</li>
<li>Split them into chunks.</li>
<li>Create embeddings.</li>
<li>Store embeddings in a vector index.</li>
<li>Embed the user query.</li>
<li>Retrieve top-K similar chunks.</li>
<li>Put the chunks into the prompt.</li>
<li>Generate an answer.</li>
</ol>
<p>That works when the user's language is close to the indexed text and the answer lives cleanly inside one or two chunks. It breaks when any of these are true:</p>
<ul>
<li>the user asks a vague or multi-part question</li>
<li>the answer depends on exact identifiers, product names, dates, SKUs, ticket IDs, or legal terms</li>
<li>the source document has tables, images, slides, code blocks, or nested sections</li>
<li>the relevant chunk lost context when it was separated from the parent document</li>
<li>the corpus has multiple domains that need different retrieval strategies</li>
<li>the top vector matches are semantically related but not actually useful</li>
<li>the model receives too much context and misses the important evidence</li>
<li>documents are updated but old chunks remain in the index</li>
</ul>
<p>In production, RAG quality is usually limited by retrieval and context construction, not by the final model alone.</p>
<h2>The production architecture</h2>
<p>A practical advanced RAG architecture has four layers:</p>
<table>
<thead>
<tr>
<th>Layer</th>
<th>Job</th>
<th>Typical techniques</th>
</tr>
</thead>
<tbody><tr>
<td>Ingestion</td>
<td>Turn raw source material into retrievable knowledge</td>
<td>parsing, normalization, metadata, chunking, contextual chunks, versioning</td>
</tr>
<tr>
<td>Retrieval</td>
<td>Find a broad candidate set</td>
<td>vector search, BM25, hybrid search, filters, graph retrieval, routers</td>
</tr>
<tr>
<td>Context assembly</td>
<td>Decide what the model should see</td>
<td>reranking, deduplication, parent-child expansion, compression, citation packing</td>
</tr>
<tr>
<td>Answer control</td>
<td>Generate, verify, observe, and improve</td>
<td>grounded generation, policy checks, answer validation, evals, feedback loops</td>
</tr>
</tbody></table>
<p>The important part is the separation of responsibilities.</p>
<p>The retriever should maximize recall. The reranker should improve precision. The context builder should fit the most useful evidence into the prompt. The generator should answer from that evidence. The evaluator should tell you which step failed.</p>
<p>When these responsibilities are blurred, teams debug RAG by changing prompts. That is usually the slowest way to fix a retrieval problem.</p>
<h2>1. Ingestion: retrieval quality starts before search</h2>
<p>Ingestion is where many RAG systems quietly lose accuracy.</p>
<p>Before chunking, the system should normalize and preserve the structure of the source material:</p>
<ul>
<li>document title</li>
<li>source URL or system of record</li>
<li>author, owner, team, product, customer, or account</li>
<li>version and last updated time</li>
<li>section hierarchy</li>
<li>table captions and headers</li>
<li>image captions or OCR output</li>
<li>permissions and visibility rules</li>
<li>document type</li>
<li>lifecycle state such as draft, approved, deprecated, or archived</li>
</ul>
<p>Microsoft's advanced RAG guidance calls out content preprocessing, metadata extraction, chunking strategy, organization, and update strategy as ingestion concerns. That matters because metadata is not decorative. It becomes a retrieval control surface.</p>
<p>For example, a customer support RAG system might need filters for product, region, plan, support tier, document version, and customer entitlement. If those fields are not captured during ingestion, the query pipeline has to guess.</p>
<h3>Chunking strategy</h3>
<p>There is no universal chunk size.</p>
<p>Small chunks improve precision but often lose context. Large chunks preserve context but can dilute retrieval and waste prompt budget. A better approach is to choose chunking based on document shape:</p>
<table>
<thead>
<tr>
<th>Source type</th>
<th>Better chunking approach</th>
</tr>
</thead>
<tbody><tr>
<td>Product docs</td>
<td>heading-aware sections with parent references</td>
</tr>
<tr>
<td>API docs</td>
<td>endpoint or method-level chunks with code examples attached</td>
</tr>
<tr>
<td>Contracts</td>
<td>clause-aware chunks with document, party, and effective-date metadata</td>
</tr>
<tr>
<td>Support tickets</td>
<td>issue, environment, root cause, and resolution blocks</td>
</tr>
<tr>
<td>Tables</td>
<td>row groups plus table title, column headers, and surrounding explanation</td>
</tr>
<tr>
<td>Slide decks</td>
<td>slide-level chunks with speaker notes and nearby slide context</td>
</tr>
<tr>
<td>Codebases</td>
<td>symbol-aware chunks: file, class, function, dependency, and usage context</td>
</tr>
</tbody></table>
<p>In many systems, the winning pattern is not "small chunks" or "large chunks." It is parent-child retrieval.</p>
<p>The index stores smaller child chunks for precise matching, but the prompt receives a larger parent section when the child is selected. Microsoft describes this idea as Small2Big: find a small unit, then give the model nearby or parent context.</p>
<h3>Contextual chunks</h3>
<p>Chunking can destroy context. Anthropic's <a href="https://www.anthropic.com/engineering/contextual-retrieval">Contextual Retrieval</a> pattern addresses this by adding a short, chunk-specific explanation before embedding and keyword indexing each chunk. The added context tells the retriever what the chunk means inside the larger document.</p>
<p>That is especially useful when a chunk says something like "revenue grew 3%" or "this setting is disabled by default." Without document context, the retriever may not know which company, product, period, or feature the chunk refers to.</p>
<p>Contextual chunks are most useful when:</p>
<ul>
<li>documents are long and section-dependent</li>
<li>the same terms repeat across many products or customers</li>
<li>chunks contain pronouns or references like "this feature," "the previous quarter," or "the policy"</li>
<li>exact metadata is missing from the text itself</li>
<li>you need both semantic retrieval and BM25 keyword retrieval to benefit from the added context</li>
</ul>
<p>The tradeoff is indexing cost. You spend extra model calls during ingestion to create contextual descriptions. That is usually acceptable for high-value knowledge bases because it moves cost out of the user-facing path.</p>
<h2>2. Retrieval: do not rely on vector search alone</h2>
<p>Vector search is strong at semantic similarity. It is weak when exact terms matter.</p>
<p>Azure AI Search's <a href="https://learn.microsoft.com/en-us/azure/search/hybrid-search-overview">hybrid search</a> documentation explains the production reason for combining vector and full-text search: vector search helps with conceptual similarity, while keyword search helps with exact matches such as product codes, jargon, dates, and names.</p>
<p>Hybrid retrieval usually works like this:</p>
<ol>
<li>Run dense vector search for semantic matches.</li>
<li>Run sparse keyword search such as BM25 for exact matches.</li>
<li>Merge candidate lists with a fusion method such as reciprocal rank fusion.</li>
<li>Apply metadata filters where appropriate.</li>
<li>Send a larger candidate set to a reranker.</li>
</ol>
<p>This pattern is useful because the first retrieval stage should be generous. It should gather enough possible evidence so a later precision step can choose the best passages.</p>
<h3>When vector search wins</h3>
<p>Vector search is useful when users describe concepts differently from the source text:</p>
<ul>
<li>"How do I stop churn risk?" versus "customer health score deterioration"</li>
<li>"Can users bring their own SSO?" versus "SAML identity provider configuration"</li>
<li>"What happens if renewal is delayed?" versus "grace period and billing retry policy"</li>
</ul>
<h3>When keyword search wins</h3>
<p>Keyword search is useful when the exact term is the signal:</p>
<ul>
<li>error codes</li>
<li>legal clauses</li>
<li>SKUs</li>
<li>API names</li>
<li>customer names</li>
<li>ticket IDs</li>
<li>version numbers</li>
<li>compliance terms</li>
</ul>
<p>Production RAG usually needs both.</p>
<h2>3. Reranking: separate broad recall from final precision</h2>
<p>The retriever should not be forced to pick the final context in one step.</p>
<p>A better pipeline retrieves a wider set of candidates, then reranks them with a model that compares the query and document text more directly. Anthropic describes reranking as a filtering step after initial retrieval, where a larger candidate set is scored and reduced before passing context to the model.</p>
<p>The pattern is:</p>
<ol>
<li>Retrieve top 50 to 200 candidates with hybrid search.</li>
<li>Deduplicate near-identical chunks.</li>
<li>Rerank candidates against the user query.</li>
<li>Select the best evidence under a token budget.</li>
<li>Preserve source metadata for citations.</li>
</ol>
<p>Reranking adds latency and cost, but it often pays for itself because the generation model receives fewer irrelevant chunks. It also makes failures easier to debug: if the relevant chunk was retrieved but not reranked highly, you have a reranking problem; if it never appeared in the candidate set, you have a retrieval or ingestion problem.</p>
<h2>4. Query transformation: fix the question before retrieval</h2>
<p>Users do not write search-optimized questions.</p>
<p>They use acronyms, vague references, incomplete phrasing, and multi-part requests. Query transformation improves the retrieval query before searching.</p>
<p>Common transformations include:</p>
<table>
<thead>
<tr>
<th>Technique</th>
<th>What it does</th>
<th>When to use it</th>
</tr>
</thead>
<tbody><tr>
<td>Query rewriting</td>
<td>Rephrases the user's question for search</td>
<td>vague, conversational, or typo-heavy queries</td>
</tr>
<tr>
<td>Multi-query retrieval</td>
<td>Generates several search variants</td>
<td>when relevant docs use different terminology</td>
</tr>
<tr>
<td>Step-back prompting</td>
<td>Asks a broader conceptual question first</td>
<td>when the literal query is too narrow</td>
</tr>
<tr>
<td>HyDE</td>
<td>Generates a hypothetical answer/document, embeds that, then searches</td>
<td>when source language differs from user language</td>
</tr>
<tr>
<td>Metadata extraction</td>
<td>Converts the question into filters</td>
<td>when date, product, customer, region, or version matters</td>
</tr>
<tr>
<td>Query decomposition</td>
<td>Breaks a complex question into subqueries</td>
<td>multi-hop or multi-part questions</td>
</tr>
</tbody></table>
<p>LlamaIndex's <a href="https://developers.llamaindex.ai/python/examples/query_transformations/query_transform_cookbook/">query transform cookbook</a> includes HyDE as a query rewriting pattern where a generated hypothetical text is embedded alongside or instead of the raw query. NVIDIA's <a href="https://docs.nvidia.com/rag/latest/query_decomposition.html">RAG Blueprint query decomposition</a> describes decomposition as breaking complex questions into focused subqueries, processing them independently, and synthesizing a final answer.</p>
<p>The practical rule is simple: transform only when it helps. A simple factual query should stay simple. Decomposition and multi-query retrieval add latency, cost, and more places for the system to drift.</p>
<h2>5. Query routing: one index rarely fits every question</h2>
<p>As the corpus grows, the system needs to decide where to search.</p>
<p>A company knowledge assistant may have:</p>
<ul>
<li>product docs</li>
<li>CRM records</li>
<li>support tickets</li>
<li>Slack discussions</li>
<li>onboarding guides</li>
<li>API references</li>
<li>contracts</li>
<li>analytics tables</li>
<li>web search</li>
</ul>
<p>Putting all of that into one vector index creates noisy retrieval. A query router classifies the user's intent and sends the query to the right source or combination of sources.</p>
<p>Routing can be deterministic, model-based, or hybrid:</p>
<ul>
<li>Deterministic routing: if the query mentions an account ID, search CRM and support systems.</li>
<li>Model routing: an LLM classifies the query as technical, legal, sales, account, policy, or analytics.</li>
<li>Embedding routing: compare the query against descriptions of available indexes or tools.</li>
<li>Permission-aware routing: search only sources the user is allowed to access.</li>
</ul>
<p>The router should return not just sources, but a reason. That reason is useful for logging, debugging, and human review.</p>
<h2>6. GraphRAG: when relationships matter</h2>
<p>Some questions are not answered well by isolated chunks.</p>
<p>Examples:</p>
<ul>
<li>"Which customers are blocked by the same integration issue?"</li>
<li>"What themes are emerging across this quarter's support escalations?"</li>
<li>"Which vendors, controls, and policies are connected to this compliance risk?"</li>
<li>"What changed in the architecture after the migration?"</li>
</ul>
<p>GraphRAG adds a relationship layer. Microsoft Research describes <a href="https://www.microsoft.com/en-us/research/project/graphrag/">GraphRAG</a> as combining text extraction, network analysis, LLM prompting, and summarization. The Microsoft GraphRAG architecture shows an indexing pipeline that loads documents, chunks them, extracts a graph and claims, embeds chunks and entities, detects communities, and generates reports.</p>
<p>GraphRAG is not necessary for every RAG system. It is useful when:</p>
<ul>
<li>entities and relationships are the core of the question</li>
<li>the answer requires corpus-level synthesis, not just passage lookup</li>
<li>you need to explore clusters, themes, dependencies, or communities</li>
<li>the same entity appears across many documents with different local context</li>
</ul>
<p>The tradeoff is operational complexity. You now maintain graph extraction, entity resolution, community summaries, and graph-aware retrieval. Use it when the problem deserves that structure.</p>
<h2>7. Agentic RAG: when retrieval is part of reasoning</h2>
<p>Fixed RAG retrieves once before generation. Agentic RAG lets the model decide when and how to retrieve while it reasons.</p>
<p>LangChain's <a href="https://docs.langchain.com/oss/python/langchain/retrieval">retrieval documentation</a> distinguishes 2-step RAG, agentic RAG, and hybrid RAG. In a 2-step system, retrieval always happens before generation. In an agentic system, the agent can call retrieval tools during the interaction. In a hybrid system, you add validation and refinement steps while keeping more control than a fully agentic loop.</p>
<p>Agentic RAG is useful when:</p>
<ul>
<li>the user question is exploratory</li>
<li>the system has multiple tools or sources</li>
<li>the answer requires follow-up retrieval</li>
<li>the model needs to inspect one result before deciding what to retrieve next</li>
<li>the workflow includes validation, correction, or escalation</li>
</ul>
<p>It is risky when the system needs predictable latency, strict cost bounds, or deterministic compliance behavior. For high-risk domains, a hybrid architecture is often better: the model can request more evidence, but the workflow controls tool access, retry limits, approval gates, and final checks.</p>
<h2>8. Context assembly: the prompt is a scarce resource</h2>
<p>After retrieval and reranking, the system still has to build the final context.</p>
<p>This step decides:</p>
<ul>
<li>which chunks enter the prompt</li>
<li>how much parent context to include</li>
<li>whether to compress or summarize evidence</li>
<li>how to order the evidence</li>
<li>how to include citations</li>
<li>how to handle contradictory sources</li>
<li>how to stay within the model's context window</li>
</ul>
<p>Do not treat context assembly as string concatenation.</p>
<p>A good context builder should prefer:</p>
<ul>
<li>newer approved documents over older drafts</li>
<li>primary sources over summaries</li>
<li>source diversity when answering broad questions</li>
<li>exact matches for identifiers</li>
<li>parent context when the selected chunk is ambiguous</li>
<li>clear citation metadata for every evidence block</li>
</ul>
<p>It should also remove duplicate or near-duplicate evidence. More context is not always better. Irrelevant passages can distract the model and increase cost.</p>
<h2>9. Answer generation: force grounding without pretending it is guaranteed</h2>
<p>The generation prompt should make the contract clear:</p>
<ul>
<li>answer only from provided evidence when the question is knowledge-base grounded</li>
<li>cite the sources used</li>
<li>say when the evidence is missing or insufficient</li>
<li>separate facts from assumptions</li>
<li>preserve uncertainty</li>
<li>avoid using stale retrieved content when metadata says a newer version exists</li>
</ul>
<p>But prompts are not enough. The system should validate the answer after generation.</p>
<p>Post-generation checks can include:</p>
<ul>
<li>citation coverage: does every factual claim map to evidence?</li>
<li>contradiction checks: does the answer conflict with retrieved text?</li>
<li>policy checks: does the answer reveal restricted data or unsafe guidance?</li>
<li>completeness checks: did the answer address every part of the user question?</li>
<li>format checks: does the response match the required output shape?</li>
</ul>
<p>For internal tools, it can be better to show the user a transparent "not enough evidence" answer than to generate a polished guess.</p>
<h2>10. Evaluation: advanced RAG needs regression tests</h2>
<p>RAG systems degrade quietly.</p>
<p>New documents are added. Old documents stay indexed. Chunking changes. Embedding models change. Reranker thresholds change. User behavior changes. The only way to keep quality stable is to measure it.</p>
<p>Microsoft's guide recommends golden datasets, assessment pipelines, feedback capture, logging, and safeguards. In practice, a useful eval set includes:</p>
<ul>
<li>real user questions</li>
<li>approved answers</li>
<li>expected source documents</li>
<li>acceptable alternate phrasings</li>
<li>metadata such as topic, difficulty, source type, and risk level</li>
<li>negative examples where the system should refuse or say it does not know</li>
</ul>
<p>Measure more than final answer quality.</p>
<table>
<thead>
<tr>
<th>Metric</th>
<th>What it tells you</th>
</tr>
</thead>
<tbody><tr>
<td>Recall@K</td>
<td>Did retrieval find the right evidence at all?</td>
</tr>
<tr>
<td>MRR or NDCG</td>
<td>Did the right evidence rank near the top?</td>
</tr>
<tr>
<td>Reranker win rate</td>
<td>Did reranking improve the candidate order?</td>
</tr>
<tr>
<td>Groundedness</td>
<td>Are answer claims supported by retrieved evidence?</td>
</tr>
<tr>
<td>Citation accuracy</td>
<td>Do citations point to the right source passages?</td>
</tr>
<tr>
<td>Refusal accuracy</td>
<td>Does the system say "not enough evidence" when appropriate?</td>
</tr>
<tr>
<td>Latency</td>
<td>Is the pipeline fast enough for the workflow?</td>
</tr>
<tr>
<td>Cost per answered query</td>
<td>Is the architecture economically sustainable?</td>
</tr>
</tbody></table>
<p>Debugging becomes much easier when each eval case stores the full trace: rewritten query, selected route, filters, retrieved candidates, reranked candidates, final context, generated answer, citations, and validation results.</p>
<h2>Recommended architecture by maturity</h2>
<p>Not every team needs GraphRAG, agentic retrieval, and decomposition on day one.</p>
<h3>Stage 1: reliable baseline</h3>
<p>Use this when the corpus is small and mostly clean.</p>
<ul>
<li>structured ingestion</li>
<li>heading-aware chunking</li>
<li>embeddings</li>
<li>metadata filters</li>
<li>source citations</li>
<li>basic eval set</li>
</ul>
<h3>Stage 2: production retrieval</h3>
<p>Use this when users ask real questions and retrieval misses matter.</p>
<ul>
<li>contextual chunks</li>
<li>hybrid vector plus BM25 retrieval</li>
<li>broader candidate retrieval</li>
<li>reranking</li>
<li>parent-child expansion</li>
<li>query rewriting for ambiguous questions</li>
<li>answer validation</li>
<li>feedback capture</li>
</ul>
<h3>Stage 3: multi-source intelligence</h3>
<p>Use this when the system spans many domains or tools.</p>
<ul>
<li>query router</li>
<li>source-specific indexes</li>
<li>permissions-aware retrieval</li>
<li>query decomposition for multi-hop questions</li>
<li>graph retrieval for relationship-heavy domains</li>
<li>agentic retrieval for exploratory workflows</li>
<li>golden dataset regression suite</li>
<li>full observability across every retrieval step</li>
</ul>
<h2>A reference advanced RAG flow</h2>
<p>Here is a practical production flow:</p>
<ol>
<li>User asks a question.</li>
<li>Policy and permission checks run first.</li>
<li>Query classifier decides whether the question is simple, ambiguous, multi-hop, or tool-based.</li>
<li>Query transformer rewrites, expands, or decomposes the query only if needed.</li>
<li>Router selects one or more indexes or tools.</li>
<li>Hybrid retrieval gathers candidates from vector and keyword search.</li>
<li>Metadata filters remove irrelevant, stale, unauthorized, or wrong-version content.</li>
<li>Reranker scores the candidate set.</li>
<li>Context builder deduplicates, expands parent context, compresses if needed, and packs citations.</li>
<li>Generator answers from the provided evidence.</li>
<li>Validator checks grounding, citations, policy, and completeness.</li>
<li>Trace and feedback are stored for evaluation.</li>
</ol>
<p>This is more complex than a demo. It is also the difference between a chatbot that sounds confident and a system an operator can trust.</p>
<h2>Common architecture mistakes</h2>
<h3>Mistake 1: treating embeddings as the whole retrieval system</h3>
<p>Embeddings are one retrieval signal. They are not a complete architecture. Exact matching, metadata, graph relationships, and recency often matter as much as semantic similarity.</p>
<h3>Mistake 2: chunking without looking at the documents</h3>
<p>Blind token-based chunking destroys structure. Production ingestion should respect headings, tables, code blocks, clauses, and parent-child relationships.</p>
<h3>Mistake 3: adding agents before retrieval is measurable</h3>
<p>Agentic RAG can improve exploratory workflows, but it also makes behavior less predictable. Add it after you can measure baseline retrieval quality.</p>
<h3>Mistake 4: no versioning strategy</h3>
<p>If users can receive answers from outdated policies or deprecated docs, the system is not production-ready. Track source versions, timestamps, and lifecycle states.</p>
<h3>Mistake 5: no negative evals</h3>
<p>RAG evals should include questions the system cannot answer. Otherwise, teams only measure how well the system answers friendly questions.</p>
<h2>Bottom line</h2>
<p>Advanced RAG is a retrieval architecture, not a bigger prompt.</p>
<p>Start with clean ingestion and measurable retrieval. Add hybrid search when exact terms matter. Add reranking when top-K quality is noisy. Add query transformation when users ask messy questions. Add routing when one index becomes too broad. Add GraphRAG when relationships matter. Add agentic retrieval when the workflow benefits from iterative evidence gathering.</p>
<p>The winning architecture is the smallest one that retrieves the right evidence, shows its work, and fails honestly when the evidence is not there.</p>
<p>For teams building AI systems around private business knowledge, that is the bar: not a chatbot that answers everything, but a workflow that can find, prove, and safely use the right context.</p>
<h2>Sources</h2>
<ul>
<li>Microsoft Learn: <a href="https://learn.microsoft.com/en-us/azure/developer/ai/advanced-retrieval-augmented-generation">Build advanced retrieval-augmented generation systems</a></li>
<li>Azure AI Search: <a href="https://learn.microsoft.com/en-us/azure/search/hybrid-search-overview">Hybrid search using vectors and full text</a></li>
<li>Anthropic Engineering: <a href="https://www.anthropic.com/engineering/contextual-retrieval">Introducing Contextual Retrieval</a></li>
<li>Microsoft GraphRAG: <a href="https://microsoft.github.io/graphrag/index/architecture/">Architecture</a></li>
<li>Microsoft Research: <a href="https://www.microsoft.com/en-us/research/project/graphrag/">Project GraphRAG</a></li>
<li>LlamaIndex: <a href="https://developers.llamaindex.ai/python/examples/query_transformations/query_transform_cookbook/">Query Transform Cookbook</a></li>
<li>NVIDIA: <a href="https://docs.nvidia.com/rag/latest/query_decomposition.html">Query Decomposition for NVIDIA RAG Blueprint</a></li>
<li>LangChain: <a href="https://docs.langchain.com/oss/python/langchain/retrieval">Retrieval documentation</a></li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Before building an AI agent, try solving it without AI]]></title><description><![CDATA[Short answer: Before building an AI agent, try to solve the problem with ordinary software first. Map the workflow, separate decisions that follow clear…]]></description><link>https://v12labs.hashnode.dev/before-building-an-ai-agent-try-solving-it-without-ai</link><guid isPermaLink="true">https://v12labs.hashnode.dev/before-building-an-ai-agent-try-solving-it-without-ai</guid><category><![CDATA[AI]]></category><category><![CDATA[engineering]]></category><category><![CDATA[automation]]></category><category><![CDATA[Software Engineering]]></category><dc:creator><![CDATA[V12 Labs]]></dc:creator><pubDate>Wed, 02 Dec 2026 14:25:08 GMT</pubDate><content:encoded><![CDATA[<p><strong>Short answer:</strong> Before building an AI agent, try to solve the problem with ordinary software first. Map the workflow, separate decisions that follow clear rules from those that need interpretation, use deterministic code for the predictable parts, and bring in AI only where it is genuinely needed. Then measure both versions. You may end up with a system that uses AI for a small part of the workflow, and that is a perfectly good outcome.</p>
<h2>Why an AI company would say this</h2>
<p>It sounds counterintuitive coming from someone building an AI company. But every part of a system that does not need a model is a part that is cheaper, faster, easier to test, and easier to debug. Your customers do not care how many tokens your system consumes or how many agents are working behind the scenes. They care whether the problem is solved.</p>
<p>AI should be a component of the solution, not a requirement for every component.</p>
<h2>Step 1: Map the entire workflow</h2>
<p>Before choosing any technology, write the workflow down end to end:</p>
<ul>
<li><strong>Inputs:</strong> what arrives, from where, in what format</li>
<li><strong>Decisions:</strong> every point where someone chooses between options</li>
<li><strong>Actions:</strong> what gets created, updated, sent, or filed</li>
<li><strong>Outcomes:</strong> what "done correctly" looks like</li>
</ul>
<p>Do this with the people who run the process today. The goal is a list of steps detailed enough that a new employee could follow it. Steps that nobody can describe precisely are worth flagging, because they are often where interpretation, and sometimes AI, actually belongs.</p>
<h2>Step 2: Separate rules from reasoning</h2>
<p>Go through every decision on the map and ask: can this be made with a simple condition, a calculation, or a database query?</p>
<p>You do not need a language model to check whether an invoice is overdue. That is a date comparison. You do not need one to route a ticket from a known enterprise account to its assigned manager. That is a lookup.</p>
<table>
<thead>
<tr>
<th>Decision</th>
<th>Rule or reasoning?</th>
<th>Implementation</th>
</tr>
</thead>
<tbody><tr>
<td>Is the invoice past its due date?</td>
<td>Rule</td>
<td>Date comparison</td>
</tr>
<tr>
<td>Does the order total match the PO?</td>
<td>Rule</td>
<td>Calculation</td>
</tr>
<tr>
<td>Which manager owns this account?</td>
<td>Rule</td>
<td>Database lookup</td>
</tr>
<tr>
<td>What is this customer actually asking for?</td>
<td>Reasoning</td>
<td>Language model</td>
</tr>
<tr>
<td>Is this unusual document a valid contract amendment?</td>
<td>Reasoning</td>
<td>Language model plus human review</td>
</tr>
</tbody></table>
<p>Rules belong in code. They are deterministic, testable, and free to run.</p>
<h2>Step 3: Identify where intelligence is actually needed</h2>
<p>After the rules are pulled out, what remains is the work that genuinely requires interpretation:</p>
<ul>
<li>Reading an ambiguous or free-form email</li>
<li>Interpreting an unusual document layout</li>
<li>Classifying a request that does not fit existing categories</li>
<li>Handling exceptions that no rule anticipated</li>
<li>Drafting a response that needs context and tone</li>
</ul>
<p>These are good uses of AI. They are also the parts where you should expect occasional errors, so they deserve validation, logging, and in many cases a human check.</p>
<h2>Step 4: Combine both approaches</h2>
<p>Use deterministic code for predictable operations and AI for problems that require interpretation. In practice, the shape is usually code wrapped around a few model calls:</p>
<ol>
<li>Code receives the input and validates its structure.</li>
<li>A model call extracts or interprets the parts that need it, returning structured output.</li>
<li>Code validates that output against rules (required fields, allowed values, totals that add up).</li>
<li>Code performs the actions through integrations.</li>
<li>Anything that fails validation or falls outside known patterns goes to a person.</li>
</ol>
<p>This keeps the model focused on what it does well and keeps business logic where you can see it and test it.</p>
<h2>Step 5: Measure the difference</h2>
<p>Compare the hybrid design against an AI-first version where a model handles everything. Look at four dimensions:</p>
<table>
<thead>
<tr>
<th>Dimension</th>
<th>What to compare</th>
</tr>
</thead>
<tbody><tr>
<td>Cost</td>
<td>Model usage and infrastructure per task</td>
</tr>
<tr>
<td>Accuracy</td>
<td>Correct outcomes on a fixed set of real cases</td>
</tr>
<tr>
<td>Latency</td>
<td>Time from input to completed action</td>
</tr>
<tr>
<td>Maintenance</td>
<td>How hard it is to change a rule or debug a failure</td>
</tr>
</tbody></table>
<p>Use the same test set for both. In many workflows, the hybrid version is cheaper and easier to maintain, because rule changes become code changes instead of prompt changes, and failures point to a specific step.</p>
<h2>A worked example</h2>
<p>Illustrative example. Not a client result. Consider an accounts payable workflow for incoming supplier invoices.</p>
<ul>
<li>Receiving the email and saving the attachment: code.</li>
<li>Reading the invoice when suppliers use many different layouts: AI extraction into structured fields.</li>
<li>Checking the extracted total against the purchase order: code.</li>
<li>Checking whether the supplier exists and is approved: database lookup.</li>
<li>Flagging duplicate invoice numbers: database query.</li>
<li>Explaining a mismatch to the AP clerk in plain language: AI drafting.</li>
<li>Posting to the accounting system: code through an API.</li>
</ul>
<p>Only two of seven steps use a model. The system is still meaningfully "AI-powered" where it matters, and everything else is predictable.</p>
<h2>FAQ</h2>
<p><strong>Isn't an all-AI agent faster to build?</strong>
It can be faster to demo. It is often slower to make reliable, because every rule lives in a prompt and every failure requires reading model output to understand what went wrong.</p>
<p><strong>What if rules change often?</strong>
Keep them in configuration or a small rules table that operations staff can edit. That is still easier to audit than instructions buried in a prompt.</p>
<p><strong>How do I know if a step really needs AI?</strong>
If you can write the decision as a clear condition, calculation, or query that handles nearly all real cases, it does not. If people describe it with phrases like "it depends" or "you can just tell," it might.</p>
<p><strong>Will using less AI make the system less capable?</strong>
Usually it makes it more dependable. The model still handles the hard, interpretive parts; it just is not asked to do arithmetic and lookups as well.</p>
<p>If you want help mapping a workflow and finding where AI actually belongs in it, <a href="https://www.v12labs.io/build-your-ai-workflow">start with the workflow</a>.</p>
]]></content:encoded></item><item><title><![CDATA[Most businesses don't need another custom AI agent]]></title><description><![CDATA[Short answer: Most businesses do not need to build another custom AI agent from scratch. Capable general-purpose agents already exist. What is missing is…]]></description><link>https://v12labs.hashnode.dev/most-businesses-don-t-need-another-custom-ai-agent</link><guid isPermaLink="true">https://v12labs.hashnode.dev/most-businesses-don-t-need-another-custom-ai-agent</guid><category><![CDATA[AI]]></category><category><![CDATA[agents]]></category><category><![CDATA[mcp]]></category><category><![CDATA[automation]]></category><dc:creator><![CDATA[V12 Labs]]></dc:creator><pubDate>Wed, 02 Dec 2026 14:24:35 GMT</pubDate><content:encoded><![CDATA[<p><strong>Short answer:</strong> Most businesses do not need to build another custom AI agent from scratch. Capable general-purpose agents already exist. What is missing is the connection between those agents and your business: access to your data and actions through a few focused MCP servers, knowledge of how your business works written as Markdown skills, and one real workflow to apply them to. Give a capable agent the right context, knowledge, and tools, and it can do useful work without a complex multi-agent system.</p>
<h2>The missing piece is connection, not another agent</h2>
<p>Your company already has three things an AI system needs:</p>
<ul>
<li><strong>Data</strong> scattered across CRMs, spreadsheets, databases, and internal tools</li>
<li><strong>Processes</strong> your team follows every day</li>
<li><strong>Domain knowledge</strong> that only your people understand</li>
</ul>
<p>At the same time, general-purpose AI agents have become very capable at reasoning, reading documents, writing, and using tools. The gap is that they know nothing about your customers, your rules, or your systems.</p>
<p>Building a new custom agent for each use case often repeats work the general-purpose agents already do well: planning, tool use, conversation, drafting. The part only you can supply is the business context. That is where the effort belongs.</p>
<h2>The three layers</h2>
<table>
<thead>
<tr>
<th>Layer</th>
<th>Purpose</th>
<th>What you build</th>
</tr>
</thead>
<tbody><tr>
<td>MCP servers</td>
<td>Give AI access to your business</td>
<td>A few focused tools over existing systems</td>
</tr>
<tr>
<td>Markdown skills</td>
<td>Teach AI how your business works</td>
<td>Documented processes, rules, and criteria</td>
</tr>
<tr>
<td>General-purpose agent</td>
<td>Do the reasoning</td>
<td>Configuration, not a new agent</td>
</tr>
</tbody></table>
<h3>1. MCP servers: give AI access to your business</h3>
<p>The Model Context Protocol (MCP) is a standard way to expose tools and data to AI agents. An MCP server sits in front of an existing system and offers a small set of well-defined operations.</p>
<p>The key word is focused. Do not expose every endpoint of every system. Expose the data and actions a specific workflow needs:</p>
<ul>
<li>Search accounts and contacts in the CRM</li>
<li>Read recent activity and notes for one account</li>
<li>Look up orders or invoices by customer</li>
<li>Create a draft follow-up (not send it)</li>
<li>Add a note to a record</li>
</ul>
<p>Start with read-only tools. Add write actions later, behind approvals, once you trust how the agent uses them. Fewer, clearer tools are easier for the agent to use correctly and easier for you to secure and audit.</p>
<h3>2. Markdown skills: teach AI how your business works</h3>
<p>Access to data is not enough. The agent also needs to know how your team makes decisions with it. That knowledge is usually undocumented: what makes a lead qualified, when a discount needs approval, how to word a follow-up for a renewal versus a new deal.</p>
<p>Write it down as Markdown skills. Each skill is a short document covering one process:</p>
<ul>
<li>The goal of the task</li>
<li>The steps your team follows</li>
<li>Rules and decision criteria</li>
<li>Edge cases and exceptions</li>
<li>One or two good examples</li>
</ul>
<p>Skills are readable by the people who own the process, so they can review and correct them. They are reusable across tasks and loaded only when relevant, instead of being packed into one oversized prompt. When a rule changes, you edit one file.</p>
<h3>3. General-purpose agents: let AI do the reasoning</h3>
<p>With tools and skills in place, connect them to a capable general-purpose agent. The agent decides which skill applies, which tools to call, and how to combine the results. You are not writing orchestration logic for each case; you are giving a strong reasoner the right context.</p>
<h2>What this makes possible</h2>
<p>With the same three layers, one agent can support several kinds of work:</p>
<table>
<thead>
<tr>
<th>Task</th>
<th>Tools it uses</th>
<th>Skill it follows</th>
</tr>
</thead>
<tbody><tr>
<td>Research and qualify potential customers</td>
<td>CRM search, web research</td>
<td>Lead qualification criteria</td>
</tr>
<tr>
<td>Answer operational questions</td>
<td>Document search, database lookups</td>
<td>Internal policies and definitions</td>
</tr>
<tr>
<td>Prepare personalized follow-ups</td>
<td>CRM activity, account notes</td>
<td>Follow-up guidelines by deal stage</td>
</tr>
<tr>
<td>Run repetitive workflows</td>
<td>Record updates, task creation</td>
<td>Process steps with approval rules</td>
</tr>
</tbody></table>
<p>Repetitive workflows should run with appropriate approvals. The agent can prepare the work; a person confirms anything consequential until the track record justifies more autonomy.</p>
<h2>When you do need something custom</h2>
<p>This approach does not rule out custom engineering. You may still need:</p>
<ul>
<li>Custom MCP servers for internal systems without a ready-made integration</li>
<li>Data cleanup or matching when the same customer exists under different IDs</li>
<li>Deterministic code for calculations and rules that should not depend on a model</li>
<li>Dedicated pipelines for high-volume, latency-sensitive processing</li>
</ul>
<p>The point is to build the custom parts where your business is unique (access, knowledge, rules) and reuse general-purpose capability everywhere else. If you want to check whether a task needs an agent at all or just deterministic code, run it through our free <a href="https://www.v12labs.io/tools/workflow-vs-agent">workflow vs. AI agent decision calculator</a>.</p>
<h2>How to start: one real workflow</h2>
<p>Small scope. Real use case. Working implementation.</p>
<ol>
<li><strong>Pick one workflow</strong> that your team does often and that depends on information from your systems.</li>
<li><strong>List the data and actions</strong> it requires, and build or configure focused MCP tools for just those.</li>
<li><strong>Write the skills</strong> with the people who do the work today.</li>
<li><strong>Connect a capable agent</strong> and test it on real cases next to your team.</li>
<li><strong>Add approvals</strong> for any action that changes data or reaches a customer.</li>
</ol>
<p>Illustrative example. Not a client result. A sales team wants better follow-ups after discovery calls. The MCP layer exposes read access to CRM deals and call notes, plus a "create draft email" action. A skill describes how the team writes follow-ups at each deal stage, what to reference, and what never to promise. The agent drafts follow-ups from real CRM context, and a salesperson reviews each one before it is sent. No new agent was built; the existing one was given access and instructions.</p>
<h2>FAQ</h2>
<p><strong>What is an MCP server in plain terms?</strong>
It is a small service that lets an AI agent use specific tools or data from one of your systems, in a standard way that many agents understand.</p>
<p><strong>Is this safe for sensitive business data?</strong>
It can be, if tools are narrowly scoped, start read-only, use proper authentication, and log every call. Write actions should sit behind approvals.</p>
<p><strong>Why not build a multi-agent system?</strong>
For many use cases it adds complexity without adding value. Start with one capable agent with good tools and skills, and add more structure only when a real limitation appears.</p>
<p><strong>Who should write the skills?</strong>
The people who run the process, with help structuring them. They know the rules and exceptions; the format just makes that knowledge usable by an agent.</p>
<p>We take one real workflow, connect the necessary systems, turn your processes into AI skills, and set up an agent your team can actually use. If that sounds like what you need, <a href="https://www.v12labs.io/build-your-ai-workflow">tell us about your workflow</a>.</p>
]]></content:encoded></item><item><title><![CDATA[What it takes to build an AI agent that never sleeps]]></title><description><![CDATA[Short answer: An AI agent that runs continuously is mostly a distributed systems problem, not a prompting problem. It needs durable state with checkpoints…]]></description><link>https://v12labs.hashnode.dev/what-it-takes-to-build-an-ai-agent-that-never-sleeps</link><guid isPermaLink="true">https://v12labs.hashnode.dev/what-it-takes-to-build-an-ai-agent-that-never-sleeps</guid><category><![CDATA[AI]]></category><category><![CDATA[agents]]></category><category><![CDATA[engineering]]></category><category><![CDATA[architecture]]></category><dc:creator><![CDATA[V12 Labs]]></dc:creator><pubDate>Wed, 02 Dec 2026 14:24:02 GMT</pubDate><content:encoded><![CDATA[<p><strong>Short answer:</strong> An AI agent that runs continuously is mostly a distributed systems problem, not a prompting problem. It needs durable state with checkpoints so it can resume after a crash, idempotent tool calls so retries do not double-act, heartbeats so you know it is alive, backoff for rate limits, context compaction for long runs, a dead-letter queue for work it cannot finish, and clear gates where a human takes over. The model is one component inside that loop.</p>
<h2>Why "never sleeps" is hard</h2>
<p>A demo agent runs for a few minutes in a single process. An always-on agent runs for days or weeks, across deploys, restarts, network failures, API outages, and model provider rate limits. Every one of those events will happen. The question is whether the agent loses work, repeats work, or quietly stops.</p>
<p>Treat the agent as a long-running worker that happens to call a model. The same engineering habits that keep job queues and payment systems reliable apply here.</p>
<h2>The architecture at a glance</h2>
<table>
<thead>
<tr>
<th>Layer</th>
<th>Responsibility</th>
<th>Failure it handles</th>
</tr>
</thead>
<tbody><tr>
<td>Durable state store</td>
<td>Persist task state and checkpoints</td>
<td>Crashes, deploys, restarts</td>
</tr>
<tr>
<td>Task queue</td>
<td>Hand out work, track attempts</td>
<td>Lost or duplicated work</td>
</tr>
<tr>
<td>Tool layer</td>
<td>Idempotent, logged actions</td>
<td>Retries causing double effects</td>
</tr>
<tr>
<td>Supervisor</td>
<td>Heartbeats and liveness checks</td>
<td>Silent hangs</td>
</tr>
<tr>
<td>Retry policy</td>
<td>Backoff with jitter, retry budgets</td>
<td>Rate limits, transient errors</td>
</tr>
<tr>
<td>Context manager</td>
<td>Compaction and summaries</td>
<td>Context window limits</td>
</tr>
<tr>
<td>Dead-letter queue</td>
<td>Park unrecoverable tasks</td>
<td>Poison messages, endless loops</td>
</tr>
<tr>
<td>Escalation gate</td>
<td>Route to a human</td>
<td>Risky or ambiguous decisions</td>
</tr>
</tbody></table>
<h2>Durable state and checkpointing</h2>
<p>The agent's memory of what it is doing cannot live only in process memory. If the process dies, that state is gone.</p>
<p>Store each task as a record with an explicit status (queued, running, waiting on tool, waiting on human, done, failed) and write a checkpoint after every meaningful step: the step number, the tool calls made and their results, and a compact summary of the reasoning so far.</p>
<p>On restart, the agent loads the last checkpoint and continues from the next step rather than starting over. A practical rule is to checkpoint before any external side effect and immediately after it returns, so you always know whether an action was attempted.</p>
<p>Workflow engines such as Temporal or a well-designed Postgres table with status transitions can both serve this role. The important part is that state transitions are written durably and in order.</p>
<h2>Idempotent tool calls</h2>
<p>Retries are unavoidable, which means any tool call might run twice. If "send invoice" or "create ticket" runs twice, you have a real problem.</p>
<p>Make every side-effecting tool idempotent:</p>
<ol>
<li>Generate an idempotency key per intended action, derived from the task ID and step number.</li>
<li>Pass it to the downstream API when it supports one, or record it in your own table before acting.</li>
<li>On retry, check the key first. If the action already succeeded, return the stored result instead of acting again.</li>
</ol>
<p>Read-only tools are naturally safe to retry. Write tools need this discipline from day one.</p>
<h2>Heartbeats and liveness checks</h2>
<p>A crashed process is easy to detect. A hung one is not. An agent waiting forever on a stuck HTTP call or a model response looks alive from the outside.</p>
<p>Have each worker write a heartbeat (task ID, step, timestamp) at a regular interval while it runs. A supervisor scans for tasks whose heartbeat is older than a threshold and marks them for recovery: release the lease, increment the attempt count, and let another worker resume from the last checkpoint. Put explicit timeouts on every model and tool call so a single slow dependency cannot hold a task indefinitely.</p>
<h2>Rate limits, backoff, and retry budgets</h2>
<p>Model providers and SaaS APIs enforce rate limits. A naive retry loop turns a short throttle into a storm.</p>
<ul>
<li>Use exponential backoff with jitter, and respect any retry-after header.</li>
<li>Separate transient errors (timeouts, throttling, 5xx responses) from permanent ones (validation errors, missing permissions). Only retry the first kind.</li>
<li>Give each task a retry budget. When it is spent, the task goes to the dead-letter queue instead of looping.</li>
<li>Apply concurrency limits per provider so many workers do not hit the same limit at once.</li>
</ul>
<h2>Context compaction across long runs</h2>
<p>A long-running task accumulates tool results, messages, and intermediate reasoning until it no longer fits in the model's context window, and performance often degrades before that point.</p>
<p>Compact on purpose. At defined points, replace older turns with a structured summary: the goal, decisions made, facts established, open questions, and pending actions. Keep raw tool outputs in the state store and reference them by ID instead of keeping them in context. Store the summary in the checkpoint, so a resumed task starts from the compact version rather than replaying everything.</p>
<h2>Dead-letter queues</h2>
<p>Some tasks will never succeed automatically: malformed input, a record that was deleted, a permission the agent lacks. Retrying them forever wastes money and hides the problem.</p>
<p>Move these tasks to a dead-letter queue with the error, the last checkpoint, and the attempt history. Review the queue regularly. Patterns in it are your engineering backlog, the same way shadow-run disagreements are for a new agent.</p>
<h2>Human escalation gates</h2>
<p>Reliability is not only about crashes. It is also about knowing when not to act. Define explicit gates where the agent stops and hands off:</p>
<table>
<thead>
<tr>
<th>Trigger</th>
<th>What happens</th>
</tr>
</thead>
<tbody><tr>
<td>High-impact action (payment, deletion, contract change)</td>
<td>Pause for approval</td>
</tr>
<tr>
<td>Low model confidence or conflicting data</td>
<td>Ask a person, with context attached</td>
</tr>
<tr>
<td>Retry budget exhausted</td>
<td>Dead-letter plus notification</td>
</tr>
<tr>
<td>Policy or permission boundary</td>
<td>Stop and explain what is needed</td>
</tr>
</tbody></table>
<p>The task should wait in a "waiting on human" state, survive restarts while waiting, and resume cleanly once someone answers.</p>
<h2>Putting it together</h2>
<p>Illustrative example. Not a client result. Consider an agent that processes supplier invoices from a shared inbox around the clock. A worker leases a task, checkpoints after extracting fields, calls the accounting API with an idempotency key, and writes a heartbeat every few seconds. If a deploy kills the worker mid-task, the supervisor notices the stale heartbeat, and another worker resumes from the checkpoint without creating a duplicate bill. When the accounting API throttles, the task backs off. When a vendor sends an unreadable PDF three times, the task lands in the dead-letter queue. When an invoice exceeds an approval threshold, the agent waits for a finance lead.</p>
<p>None of those behaviors come from the model. They come from the system around it.</p>
<h2>FAQ</h2>
<p><strong>Do I need a workflow engine to build this?</strong>
Not necessarily. A database with clear status transitions, leases, and a scheduler can work for modest volumes. A dedicated workflow engine helps as the number of steps, retries, and long waits grows. If you are still deciding whether your process needs an always-on agent or a deterministic workflow, score it first with our <a href="https://www.v12labs.io/tools/workflow-vs-agent">Workflow vs. AI Agent Decision Calculator</a>.</p>
<p><strong>How often should the agent checkpoint?</strong>
At least before and after every side-effecting tool call, and after any step that would be expensive to repeat, such as a long model call or document extraction.</p>
<p><strong>What is the most common failure in always-on agents?</strong>
Silent stalls and duplicate actions are common. Heartbeats with timeouts address the first; idempotency keys address the second.</p>
<p><strong>Should an always-on agent ever act without a human?</strong>
Yes, for low-risk, reversible actions with a strong track record. Keep escalation gates for anything consequential and expand autonomy gradually.</p>
<p>If you are designing an agent that needs to run continuously inside your operations, <a href="https://www.v12labs.io/build-your-ai-workflow">plan the workflow with us</a> and we can work through the state, recovery, and escalation design together.</p>
]]></content:encoded></item><item><title><![CDATA[OpenAI Agents SDK vs LangGraph: Which Should You Use for Production AI Workflows?]]></title><description><![CDATA[Short answer: choose OpenAI Agents SDK when you want a lightweight, OpenAI-native way to build agents with tools, handoffs, guardrails, sessions, and…]]></description><link>https://v12labs.hashnode.dev/openai-agents-sdk-vs-langgraph-which-should-you-use-for-production-ai-workflows</link><guid isPermaLink="true">https://v12labs.hashnode.dev/openai-agents-sdk-vs-langgraph-which-should-you-use-for-production-ai-workflows</guid><category><![CDATA[AI]]></category><category><![CDATA[agents]]></category><category><![CDATA[openai]]></category><category><![CDATA[langgraph]]></category><dc:creator><![CDATA[V12 Labs]]></dc:creator><pubDate>Wed, 02 Dec 2026 14:23:23 GMT</pubDate><content:encoded><![CDATA[<h1>OpenAI Agents SDK vs LangGraph: Which Should You Use for Production AI Workflows?</h1>
<p><strong>Short answer:</strong> choose <strong>OpenAI Agents SDK</strong> when you want a lightweight, OpenAI-native way to build agents with tools, handoffs, guardrails, sessions, and tracing. Choose <strong>LangGraph</strong> when your workflow needs durable state, explicit control flow, branching, retries, human review, and complex multi-step orchestration.</p>
<p>For many production systems, the best answer is not one or the other. A team can use <strong>LangGraph as the orchestration layer</strong> and use <strong>OpenAI Agents SDK inside specific nodes or tasks</strong> where OpenAI-native agent execution is the right fit.</p>
<p>At V12 Labs, we think about this less as a framework debate and more as a workflow architecture decision: what needs to be automated, where state must live, where humans need control, and what happens when the model is wrong.</p>
<h2>Quick comparison</h2>
<table>
<thead>
<tr>
<th>Question</th>
<th>OpenAI Agents SDK</th>
<th>LangGraph</th>
</tr>
</thead>
<tbody><tr>
<td>Best fit</td>
<td>OpenAI-native agent workflows</td>
<td>Stateful, durable, multi-step agent workflows</td>
</tr>
<tr>
<td>Primary strength</td>
<td>Fast agent construction around OpenAI models, tools, handoffs, guardrails, sessions, and tracing</td>
<td>Explicit graph orchestration, state management, branching, persistence, and human-in-the-loop patterns</td>
</tr>
<tr>
<td>Control flow</td>
<td>Good for agent/tool/handoff patterns</td>
<td>Stronger for complex workflow control and state transitions</td>
</tr>
<tr>
<td>Production durability</td>
<td>Useful built-in primitives, especially tracing and guardrails</td>
<td>Often stronger when the workflow needs resumability, checkpoints, retries, or long-running state</td>
</tr>
<tr>
<td>Human review</td>
<td>Can be implemented around agent actions and guardrails</td>
<td>Natural fit for approval gates and interrupt/resume workflows</td>
</tr>
<tr>
<td>Browser automation</td>
<td>Calls browser tools; does not replace browser automation</td>
<td>Orchestrates browser steps; does not replace browser automation</td>
</tr>
<tr>
<td>Vendor coupling</td>
<td>More OpenAI-native</td>
<td>More model/provider-flexible</td>
</tr>
<tr>
<td>Use both?</td>
<td>Yes</td>
<td>Yes</td>
</tr>
</tbody></table>
<h2>What OpenAI Agents SDK is good at</h2>
<p>OpenAI describes the Agents SDK as a framework for building agentic applications with primitives such as agents, tools, handoffs, guardrails, sessions, and tracing.</p>
<p>That makes it useful when the workflow is centered on OpenAI models and you want to move quickly from a prompt-and-tool prototype into a more structured agent implementation.</p>
<p>OpenAI Agents SDK is a strong fit when you need:</p>
<ul>
<li>An agent that can call defined tools</li>
<li>Clear handoffs between specialized agents</li>
<li>Guardrails around inputs or outputs</li>
<li>Session support for conversational or multi-turn workflows</li>
<li>Tracing to inspect what the agent did</li>
<li>A straightforward OpenAI-native development path</li>
</ul>
<p>For example, a revenue operations team might use an OpenAI agent to classify inbound requests, call a CRM lookup tool, draft a response, and hand the task to another agent or human reviewer when confidence is low.</p>
<p>The main tradeoff is that OpenAI Agents SDK is most compelling when you are already comfortable building inside the OpenAI ecosystem. If you need provider flexibility, long-running workflow state, or highly explicit orchestration, you may want a separate orchestration layer.</p>
<h2>What LangGraph is good at</h2>
<p>LangGraph is designed for stateful, graph-based agent and workflow applications. Instead of treating an agent as one continuous loop, LangGraph lets teams define nodes, edges, state, conditional transitions, and persistence patterns.</p>
<p>That makes it especially useful when the workflow has multiple steps that must be controlled, resumed, audited, or approved.</p>
<p>LangGraph is a strong fit when you need:</p>
<ul>
<li>Explicit workflow state</li>
<li>Branching logic</li>
<li>Multi-agent coordination</li>
<li>Human approval steps</li>
<li>Checkpointing or resumability</li>
<li>Long-running workflows</li>
<li>Model/provider flexibility</li>
<li>More control over what happens after each step</li>
</ul>
<p>For example, a customer operations workflow may need to classify an issue, retrieve account context, decide whether to open a ticket, draft a reply, pause for human approval, update a system of record, and notify the customer. That is less of a single-agent problem and more of an orchestrated workflow problem.</p>
<p>LangGraph tends to be the safer production foundation when the agent cannot simply â€œtry againâ€ from scratch. If the workflow modifies customer data, moves money, changes CRM fields, sends external messages, or triggers operational work, explicit state and approval gates matter.</p>
<h2>OpenAI Agents SDK vs LangGraph for production workflows</h2>
<p>The practical difference is this:</p>
<ul>
<li><strong>OpenAI Agents SDK helps you build the agent.</strong></li>
<li><strong>LangGraph helps you control the workflow around the agent.</strong></li>
</ul>
<p>That distinction matters in production.</p>
<p>A demo agent can often be a single loop: receive task, reason, call tools, respond. A production workflow usually needs more structure:</p>
<ol>
<li>What state does the system need before the model runs?</li>
<li>Which tools can the model call?</li>
<li>What happens if a tool call fails?</li>
<li>Which actions require human approval?</li>
<li>Can the workflow resume later?</li>
<li>How is the run traced and audited?</li>
<li>What system of record is updated?</li>
<li>What happens when the model output is incomplete or unsafe?</li>
</ol>
<p>OpenAI Agents SDK gives teams useful agent-building primitives. LangGraph gives teams a strong way to model the workflow as a state machine or graph. In many real deployments, those are complementary needs.</p>
<h2>Where browser automation fits</h2>
<p>Browser automation is often misunderstood in agent discussions.</p>
<p>Neither OpenAI Agents SDK nor LangGraph replaces browser automation tools such as Playwright, Selenium, browser APIs, or purpose-built RPA/browser-control systems. Instead, they can coordinate when and how those tools are used.</p>
<p>A production browser-agent workflow usually has three layers:</p>
<ol>
<li><strong>Browser execution layer:</strong> the system that clicks, types, extracts page data, uploads files, or navigates web apps.</li>
<li><strong>Agent reasoning layer:</strong> the model-driven component that interprets instructions, selects tools, or drafts next actions.</li>
<li><strong>Workflow orchestration layer:</strong> the control system that tracks state, retries failures, pauses for review, and records outcomes.</li>
</ol>
<p>OpenAI Agents SDK can work well in the reasoning layer. LangGraph can work well in the orchestration layer. Browser tools handle the actual browser interaction.</p>
<p>For sensitive workflows, human review should appear before irreversible actions such as submitting forms, sending messages, changing account settings, deleting records, or updating customer-facing data.</p>
<h2>When to choose OpenAI Agents SDK</h2>
<p>Choose OpenAI Agents SDK when:</p>
<ul>
<li>Your system is primarily OpenAI-based</li>
<li>You want a lightweight framework for agents and tools</li>
<li>You need handoffs between specialized agents</li>
<li>You want guardrails and tracing built into the agent development flow</li>
<li>Your workflow is relatively contained</li>
<li>You do not need a complex durable graph around every step</li>
</ul>
<p>Good examples include:</p>
<ul>
<li>Internal assistant workflows</li>
<li>Research and summarization agents</li>
<li>Tool-using support assistants</li>
<li>CRM enrichment helpers</li>
<li>Drafting and classification workflows</li>
<li>Agent prototypes that may later move into a larger orchestration system</li>
</ul>
<p>OpenAI Agents SDK is often the faster starting point when the main question is, â€œCan this agent perform the task with the right tools and guardrails?â€</p>
<h2>When to choose LangGraph</h2>
<p>Choose LangGraph when:</p>
<ul>
<li>The workflow has many steps or branches</li>
<li>State must persist across the run</li>
<li>You need human-in-the-loop approval</li>
<li>You need checkpointing, resuming, or retry behavior</li>
<li>Different agents or tools need to coordinate</li>
<li>You want more model/provider flexibility</li>
<li>The workflow touches production systems of record</li>
</ul>
<p>Good examples include:</p>
<ul>
<li>Customer support resolution workflows</li>
<li>Sales operations automations</li>
<li>Onboarding workflows</li>
<li>Multi-step research and reporting pipelines</li>
<li>Compliance-sensitive review systems</li>
<li>Browser workflows that need pause/resume and auditability</li>
</ul>
<p>LangGraph is often the better foundation when the main question is, â€œHow do we make this workflow reliable, observable, and controllable in production?â€</p>
<h2>When to use both</h2>
<p>Using both can make sense when each tool has a clear job.</p>
<p>One common pattern:</p>
<ul>
<li><strong>LangGraph</strong> manages the overall workflow state, routing, retries, and human approval.</li>
<li><strong>OpenAI Agents SDK</strong> powers a specific agent step inside the workflow.</li>
<li><strong>Browser automation or API tools</strong> execute actions against external systems.</li>
<li><strong>A product layer</strong> gives operators a way to review, approve, and correct outputs.</li>
</ul>
<p>For example:</p>
<ol>
<li>LangGraph starts a customer onboarding workflow.</li>
<li>A node gathers account data from internal systems.</li>
<li>An OpenAI agent drafts a personalized onboarding plan.</li>
<li>LangGraph routes low-confidence cases to human review.</li>
<li>A browser/API tool updates the CRM only after approval.</li>
<li>The workflow logs the decision and continues to the next step.</li>
</ol>
<p>This architecture avoids forcing one framework to solve every problem.</p>
<h2>Practical decision framework</h2>
<p>Use this checklist before choosing a framework:</p>
<h3>1. Is this an agent problem or a workflow problem?</h3>
<p>If the core challenge is tool use, reasoning, handoffs, and model behavior, start with OpenAI Agents SDK.</p>
<p>If the core challenge is state, branching, retries, approvals, and long-running execution, start with LangGraph.</p>
<h3>2. How much state does the workflow need?</h3>
<p>Simple state can live inside an agent session or application database. Complex state usually benefits from explicit workflow modeling.</p>
<h3>3. What can go wrong?</h3>
<p>If failure only produces a bad draft, the system can be simple. If failure updates a customer record, sends an email, submits a form, or triggers downstream work, you need stronger controls.</p>
<h3>4. Where do humans need to review?</h3>
<p>Human review should not be an afterthought. Design it into the workflow before irreversible actions.</p>
<h3>5. How important is provider flexibility?</h3>
<p>If you expect to use multiple model providers, LangGraph may be a better neutral orchestration layer. If you are standardizing on OpenAI, OpenAI Agents SDK may reduce complexity.</p>
<h2>Bottom line</h2>
<p>OpenAI Agents SDK and LangGraph solve overlapping but different problems.</p>
<ul>
<li>Use <strong>OpenAI Agents SDK</strong> when you want a focused, OpenAI-native agent framework.</li>
<li>Use <strong>LangGraph</strong> when you need durable, stateful orchestration for production workflows.</li>
<li>Use <strong>both</strong> when LangGraph should control the workflow and OpenAI Agents SDK should power specific agent steps.</li>
</ul>
<p>The best production agent systems are rarely just â€œan agent.â€ They are workflow systems with clear state, controlled tools, review points, observability, and a product surface for the humans who still need to make decisions.</p>
<p>If you are designing a production AI workflow, V12 Labs can help map the workflow before you build. See our work on <a href="/services/ai-solutions">AI workflow systems</a> and <a href="/services/custom-software">AI-native product engineering</a>.</p>
]]></content:encoded></item><item><title><![CDATA[Your first AI agent shouldn't be autonomous]]></title><description><![CDATA[Short answer: Your first AI agent should observe and recommend before it is allowed to act. Connect it to your systems through read-only tools, write down…]]></description><link>https://v12labs.hashnode.dev/your-first-ai-agent-shouldn-t-be-autonomous</link><guid isPermaLink="true">https://v12labs.hashnode.dev/your-first-ai-agent-shouldn-t-be-autonomous</guid><category><![CDATA[agents]]></category><category><![CDATA[automation]]></category><category><![CDATA[engineering]]></category><category><![CDATA[AI]]></category><dc:creator><![CDATA[V12 Labs]]></dc:creator><pubDate>Wed, 02 Dec 2026 14:22:39 GMT</pubDate><content:encoded><![CDATA[<p><strong>Short answer:</strong> Your first AI agent should observe and recommend before it is allowed to act. Connect it to your systems through read-only tools, write down how decisions are actually made, run it next to the people doing the work today, and only then hand it low-risk actions with approval on anything consequential. Autonomy is something the agent earns through measured reliability, not a setting you switch on during launch week.</p>
<h2>Why autonomy is the wrong starting point</h2>
<p>Most of the conversation around agents is about how much they can do on their own. That is an interesting research question. Inside a real business, it is the wrong first question. The useful first question is narrower: can this agent reliably do one useful thing, and how would we know?</p>
<p>An agent that can update records, send emails, and issue refunds on day one has also been given the ability to make every mistake at machine speed. You have not yet seen how it reasons about your edge cases, what information it is missing, or where your own instructions are ambiguous. Giving it write access before you know those things means you learn about them from your customers.</p>
<p>The approach below reverses the order. It treats autonomy as the last step of a deployment, not the first. Before you start, you can also check whether the task belongs in a deterministic workflow or an agent with our <a href="https://www.v12labs.io/tools/workflow-vs-agent">Workflow vs. AI Agent Decision Calculator</a>.</p>
<h2>Step 1: Give it eyes, not hands</h2>
<p>Start by connecting the relevant systems through read-only tools. With MCP (Model Context Protocol), that usually means exposing search and retrieval tools for your CRM, ticketing system, document store, and database, and deliberately leaving out any tool that creates, updates, or deletes.</p>
<p>At this stage the agent can:</p>
<ul>
<li>Search documents and policies</li>
<li>Retrieve customer, order, or account records</li>
<li>Summarize what is happening on a case</li>
<li>Draft a recommended next action</li>
</ul>
<p>It cannot change anything. That constraint is useful. It lets you evaluate the agent's understanding separately from its ability to act, and it removes most of the risk from early testing. If the agent misreads a record, the cost is a wrong suggestion that a person ignores, not a wrong update that a person has to find and undo.</p>
<h2>Step 2: Teach it how decisions are made</h2>
<p>Most of what makes a business decision correct is not in any database. It lives in people's heads: which customers get an exception, what "urgent" means for this team, when a refund needs a manager, which supplier is unreliable in December.</p>
<p>Write those rules, edge cases, and workflows down as Markdown skills. A skill is a focused document the agent loads when a task calls for it: how to handle a refund request, how to triage a support ticket, how to qualify an inbound lead.</p>
<p>Not everything belongs in a system prompt. A single giant prompt becomes hard to maintain, hard to review, and hard to test. Separate skills let you:</p>
<table>
<thead>
<tr>
<th>Approach</th>
<th>Maintenance</th>
<th>Review</th>
<th>Testing</th>
</tr>
</thead>
<tbody><tr>
<td>One large system prompt</td>
<td>Every change touches everything</td>
<td>Hard to see what changed</td>
<td>Failures are hard to attribute</td>
</tr>
<tr>
<td>Markdown skills per workflow</td>
<td>Change one file per rule change</td>
<td>Ops owners can read and edit</td>
<td>Failures map to a specific skill</td>
</tr>
</tbody></table>
<p>Skills also give non-engineers a place to contribute. The person who knows the refund policy best can review the refund skill directly.</p>
<h2>Step 3: Run it alongside a human</h2>
<p>Now run a shadow period. Give the agent around 20 real cases that your team is already handling. The agent produces its decision and reasoning; the people currently doing the work produce theirs. Then compare.</p>
<p>For every case, ask three questions:</p>
<ol>
<li><strong>Where does the agent disagree with the human?</strong> Sometimes the agent is wrong. Sometimes the human was inconsistent. Both are worth knowing.</li>
<li><strong>What information was missing?</strong> If the agent could not see the contract terms or the last support conversation, that is a tool or integration gap.</li>
<li><strong>Which instructions were ambiguous?</strong> If two reasonable readings of a skill lead to different outcomes, the skill needs rewriting.</li>
</ol>
<p>Those failures are your actual development backlog. They are far more valuable than a generic list of features, because each one is tied to a real case in your business.</p>
<p>Illustrative example. Not a client result. Imagine an agent that recommends how to handle incoming refund requests. In a shadow run of 20 cases, it matches the team on most routine requests but flags two customers for full refunds that the team would have handled with store credit. Looking closer, the agent never saw the internal note that those accounts were on a special agreement. The fix is not a smarter model. It is a read-only tool for account notes and one line in the refund skill.</p>
<h2>Step 4: Give it hands, gradually</h2>
<p>Once the shadow run shows the agent agreeing with your team on the cases that matter, start giving it actions. Do it in tiers.</p>
<table>
<thead>
<tr>
<th>Tier</th>
<th>Example actions</th>
<th>Control</th>
</tr>
</thead>
<tbody><tr>
<td>Low risk</td>
<td>Add an internal note, tag a ticket, draft a reply</td>
<td>Runs automatically, logged</td>
</tr>
<tr>
<td>Medium risk</td>
<td>Send a templated email, update a CRM field</td>
<td>Human approves before it runs</td>
</tr>
<tr>
<td>High risk</td>
<td>Issue a refund, change a contract, delete data</td>
<td>Human approves, with a second check</td>
</tr>
</tbody></table>
<p>Require approval for anything consequential. Track how often approvals are accepted as-is, edited, or rejected. When an action type has a steady record of being approved without edits, you have evidence for moving it to a lower tier. When it does not, you know exactly where to keep working.</p>
<p>Expand autonomy only after you have measured reliability, and expand it one action type at a time. That way, if something goes wrong, you know which change introduced it.</p>
<h2>What this looks like as a plan</h2>
<table>
<thead>
<tr>
<th>Phase</th>
<th>Agent capability</th>
<th>Output you review</th>
</tr>
</thead>
<tbody><tr>
<td>Eyes</td>
<td>Read-only search and retrieval</td>
<td>Summaries and recommendations</td>
</tr>
<tr>
<td>Rules</td>
<td>Markdown skills per workflow</td>
<td>Skills reviewed by process owners</td>
</tr>
<tr>
<td>Shadow</td>
<td>Decisions on real cases, no actions</td>
<td>Disagreement and gap log</td>
</tr>
<tr>
<td>Hands</td>
<td>Tiered actions with approvals</td>
<td>Approval rate per action type</td>
</tr>
</tbody></table>
<p>The goal is not an agent that can do everything. It is an agent that reliably does something useful, with a clear record of why you trust it.</p>
<h2>FAQ</h2>
<p><strong>Doesn't starting read-only slow the project down?</strong>
It shortens the part that usually takes longest: finding and fixing the failures you would otherwise discover in production. A read-only agent is already useful as a research and drafting assistant while you build trust.</p>
<p><strong>How many cases should a shadow run include?</strong>
Around 20 real cases is a practical starting point for one workflow. The aim is enough variety to surface missing information and ambiguous rules, not a statistically perfect benchmark.</p>
<p><strong>What belongs in a skill versus the system prompt?</strong>
Keep the system prompt for identity, tone, and global safety rules. Put workflow-specific rules, edge cases, and examples in skills that the agent loads only when the task needs them.</p>
<p><strong>When can an action run without approval?</strong>
When it is low risk, reversible, and has a consistent record of being approved without edits during the approval period. Promote one action type at a time and keep logging.</p>
<p>Autonomy should be earned, not assumed. If you want help planning a first agent that starts with eyes and earns its hands, <a href="https://www.v12labs.io/build-your-ai-workflow">map your workflow with us</a>.</p>
]]></content:encoded></item><item><title><![CDATA[Bland.ai + Twilio Integration: How We Built Production AI Phone Agents]]></title><description><![CDATA[There's a lot of marketing copy out there about "AI phone agents." Almost none of it is engineering. This post is the engineering version: what we actually…]]></description><link>https://v12labs.hashnode.dev/bland-ai-twilio-integration-how-we-built-production-ai-phone-agents</link><guid isPermaLink="true">https://v12labs.hashnode.dev/bland-ai-twilio-integration-how-we-built-production-ai-phone-agents</guid><category><![CDATA[AI]]></category><category><![CDATA[twilio]]></category><category><![CDATA[architecture]]></category><category><![CDATA[voice ai]]></category><dc:creator><![CDATA[V12 Labs]]></dc:creator><pubDate>Wed, 02 Dec 2026 13:26:24 GMT</pubDate><content:encoded><![CDATA[<p>There's a lot of marketing copy out there about "AI phone agents." Almost none of it is engineering. This post is the engineering version: what we actually built when we built VocalDesk, what stack we chose and why, what the third-party services actually do (and don't do), and the production layer you have to build yourself if you want something a real business will trust on its real phone numbers.</p>
<p>If you're evaluating Bland.ai, comparing it to Retell or Vapi, deciding whether to roll your own with Twilio + Deepgram + ElevenLabs, or just trying to understand what the inside of a real voice-agent product looks like, this is for you.</p>
<h2>The decision: build the voice stack ourselves, or buy it?</h2>
<p>When we started VocalDesk, the first real architectural choice was "do we own the voice infrastructure or do we rent it?"</p>
<p>Owning it looks like: Twilio Programmable Voice for telephony, Deepgram or AssemblyAI for streaming STT, an LLM (Claude, GPT-4) for the conversation logic, ElevenLabs or Cartesia for TTS, and a Node service stitching it all together with WebRTC or media streams. You write the turn-taking logic. You handle interruptions. You manage the streaming pipelines. You optimize for latency end-to-end.</p>
<p>Renting it looks like: pick a vertically integrated provider (Bland.ai, Retell, Vapi) that ships the entire pipeline and exposes a single API. You give up control of the voice stack to get a 30-day path to production.</p>
<p>We chose to rent. Specifically, <strong>Bland.ai for the voice runtime, Twilio for telephony (BYOT), and a custom application layer on top.</strong> Here's the math behind that choice and the reality behind the trade-offs.</p>
<h2>What Bland.ai actually does</h2>
<p>Bland is a vertically integrated voice stack. They run their own STT, their own LLM orchestration layer, and their own TTS, on dedicated GPU infrastructure they market as latency-optimized. Their developer surface is API-first:</p>
<ul>
<li>A REST API to dispatch outbound calls and configure inbound numbers</li>
<li><strong>Conversational Pathways.</strong> A visual node graph where you define the call flow (Default nodes for the LLM, Webhook nodes that hit your backend mid-call, Knowledge Base nodes, Transfer nodes, End Call nodes), with <code>{{variable}}</code> extraction and conditional transitions</li>
<li>Real-time webhooks (mid-call, your service responds and the response gets injected into the dialogue)</li>
<li>Post-call webhooks (transcript, recording URL, extracted variables fire to your endpoint when the call ends)</li>
</ul>
<p>Pathways is the core authoring abstraction. If you've built chatbots, think of it as a state machine where each state is an LLM-driven node and the edges are conditions on extracted variables. It works for structured calls (appointment booking, lead qualification, simple support) and falls down on open-ended conversations that need reasoning beyond a single node prompt.</p>
<p>What Bland gives you, all-in: voice in, voice out, a flow engine, telephony bundled or BYOC. What you avoid building: streaming STT, LLM orchestration with interruption handling, low-latency TTS, codec negotiation, dual-stream audio, voice activity detection, the entire mess.</p>
<h2>Why Twilio (BYOT) instead of Bland's own numbers</h2>
<p>Bland sells phone numbers natively. We didn't use them. We used Twilio numbers and connected them to Bland through their <strong>Bring Your Own Twilio (BYOT)</strong> flow:</p>
<ol>
<li>Generate Twilio Account SID + Auth Token in the Twilio Console</li>
<li>POST them to Bland to get an <code>encrypted_key</code> (shown once)</li>
<li>Import existing Twilio numbers into Bland via the Add-ons surface</li>
<li>For outbound calls, include <code>encrypted_key</code> and a Twilio-owned <code>from</code> number in the call request</li>
<li>For inbound, configure the imported number with the Authorization + <code>encrypted_key</code> headers</li>
</ol>
<p>The reason for the extra step: Twilio is the most universally trusted carrier substrate in the developer world. Customer compliance teams know Twilio. Number portability through Twilio is well-trodden. Twilio's deliverability, A2P 10DLC registration, STIR/SHAKEN attestation, and DNC list integrations are mature in a way that's hard to verify on a young provider. If a customer wants their phone numbers to live somewhere they can move, Twilio is the answer.</p>
<p>The cost is one extra hop in the request flow and a small bit of credential plumbing. Worth it.</p>
<h2>The latency reality</h2>
<p>Bland's marketing positions them as "lowest latency on the planet." They don't publish a specific milliseconds number. Third-party reviews (including from competitors and from neutral developers) consistently put real-world turn-taking around <strong>800ms average, with tail latency reaching ~2.5s</strong>.</p>
<p>This is fine for many use cases. It's not fine for all.</p>
<p>Conversational interruption handling, where the user starts talking over the agent, works but isn't crisp. Long-running webhook calls to your backend will be felt by the caller. If you push a real-time webhook node that hits a slow CRM, the silence on the line is real.</p>
<p>Practically, what we did:</p>
<ul>
<li>Aggressively cache anything we'd otherwise lookup in real time (customer profile, recent ticket history, account status). Cache on call start; let the in-call webhook nodes hit the cache, not the source of truth.</li>
<li>Anything that takes more than ~300ms moves to a post-call workflow. The agent says "I'm getting that for you," logs the request, and the lookup happens after the call with a follow-up SMS or email.</li>
<li>Use Bland's <code>wait_for_response</code> semantics with realistic timeouts. A 1.5s timeout sounds fine and feels broken; 3-4s feels like a real conversation.</li>
</ul>
<p>If your use case genuinely needs sub-300ms turn-taking (say you're building a real-time AI co-pilot on top of human calls), Bland is the wrong choice. Build it yourself.</p>
<h2>What Bland doesn't do (and what VocalDesk had to build)</h2>
<p>This is the part most evaluations skip. Pathways stops at the dial tone. Everything before and after a call is yours. Specifically:</p>
<p><strong>Post-call workflows.</strong> When a call ends, Bland POSTs a payload (transcript, recording URL, extracted variables, call ID) to your webhook. From there, you own everything: queueing the work, classifying the outcome, syncing to a CRM, sending follow-ups, escalating. We use a job queue (BullMQ on Redis) and Postgres for everything that lives beyond the call.</p>
<p><strong>Transcript and recording storage.</strong> Bland holds these transiently. For compliance (recording retention policies), search ("show me every call where the customer mentioned X"), and analytics, we mirror everything to S3 (recordings) and Postgres + pgvector (transcripts with embeddings).</p>
<p><strong>Real RAG over a knowledge base.</strong> Bland's KB node accepts pasted text. Functional, not great. For real document grounding (PDFs, web docs, evolving knowledge bases with citations), we built our own retrieval layer. Chunking, embeddings, reranking, citation extraction. The agent calls a webhook node, which hits our retrieval API, which returns the answer with sources, which the agent reads back.</p>
<p><strong>CRM and calendar integration.</strong> No native HubSpot, Salesforce, Google Calendar. The pattern: webhook node mid-call hits <code>/api/customer-lookup</code> or <code>/api/book-appointment</code>, which proxies to the actual integration and returns JSON we consume as variables. Building this generically (so customers can configure their own CRM without code) is most of the application work.</p>
<p><strong>Analytics and QA.</strong> Bland exposes raw call data. Call success classification, sentiment scoring, agent grading, leaderboards, drill-downs by reason: all yours. We built this on top of the post-call webhook payloads with a separate analytics LLM pass.</p>
<p><strong>Compliance.</strong> TCPA call windows, DNC scrubbing, consent logging, A2P registration if you do SMS follow-ups. All your responsibility. None of this is glamorous and all of it is the kind of thing that quietly kills a product if you don't get it right.</p>
<p><strong>Authentication / identity verification.</strong> DTMF capture is supported, but the lookup ("verify this is who they say they are by checking the SSN-last-4 against our system") is a webhook node calling your service.</p>
<p><strong>A/B testing.</strong> No native experimentation. We built a thin layer that routes calls to different pathway IDs based on a configurable split.</p>
<p>If you stack all of this up, the application layer ends up being roughly <strong>70% of the engineering effort</strong>. Bland is the fast 30% that would otherwise be six months of voice infra.</p>
<h2>What we'd do differently next time</h2>
<p>Two things.</p>
<p><strong>One: build a provider abstraction earlier.</strong> We started with Bland-specific webhook payloads flowing directly into our handlers. When we evaluated adding Retell as a fallback (different latency profile, different pricing model), we found Bland-shaped assumptions all over the application layer. We've since refactored to a <code>VoiceProvider</code> interface that normalizes call lifecycle events, transcript payloads, and webhook semantics across providers. Doing this on day one would have saved a chunk of work.</p>
<p><strong>Two: treat pricing volatility as a real risk.</strong> Bland raised the Start plan from $0.09/min to $0.14/min in Dec 2025 (~55%). They charge per-minute on transfers, voicemails, and even no-answer outbound calls. None of this is unique to Bland (voice AI providers are still sorting out their pricing), but it means your unit economics need a buffer. We model gross margin assuming ~$0.20/min all-in, not the headline number.</p>
<h2>The five-line summary</h2>
<ol>
<li><p><strong>Use a vertically integrated provider</strong> (Bland, Retell, Vapi) unless you have a specific reason to own the voice stack. The 30%/70% split between voice infra and application layer is real, and renting the 30% is almost always correct.</p>
</li>
<li><p><strong>Use Twilio for telephony</strong> even if your voice provider sells numbers. Customers trust Twilio. Number portability and compliance maturity matter.</p>
</li>
<li><p><strong>Build the application layer for portability.</strong> Provider abstraction on day one, not day 600.</p>
</li>
<li><p><strong>Treat the post-call layer as the product.</strong> That's where the business value lives: analytics, CRM sync, follow-ups, compliance, search. The call itself is a thin slice.</p>
</li>
<li><p><strong>Latency is lower than the marketing says.</strong> Plan for 800ms average. If you need lower, build it yourself or pick a different architecture.</p>
</li>
</ol>
<h2>We help startups ship voice agents that actually work</h2>
<p>If you're building an AI phone agent product, V12 Labs has done this. We built VocalDesk on the architecture above, and we build custom voice agent systems for clients on the same foundations: Bland or Retell for the voice runtime, Twilio for telephony, a custom application layer that handles the 70% nobody talks about.</p>
<p>If you're trying to figure out whether to build it yourself, hire an agency, or buy a SaaS, <a href="https://www.v12labs.io/#calendar">book a call</a> and we'll walk through the architecture before any code gets written. The right choice depends on your latency needs, your compliance constraints, your team's depth, and your willingness to own infrastructure.</p>
<p>The architecture above is the same regardless. Get it right and the implementation is just typing.</p>
<p>Originally published at <a href="https://www.v12labs.io/blog/how-we-built-vocaldesk">V12 Labs</a>.</p>
]]></content:encoded></item><item><title><![CDATA[How We Built StoryFlow: AI-Powered Narrative Tools for Content Creators]]></title><description><![CDATA[Content creators don't have a writing problem. They have a structure problem. Most people know what they want to say, they just can't figure out how to say…]]></description><link>https://v12labs.hashnode.dev/how-we-built-storyflow-ai-powered-narrative-tools-for-content-creators</link><guid isPermaLink="true">https://v12labs.hashnode.dev/how-we-built-storyflow-ai-powered-narrative-tools-for-content-creators</guid><category><![CDATA[AI]]></category><category><![CDATA[Next.js]]></category><category><![CDATA[Open Source]]></category><category><![CDATA[writing]]></category><dc:creator><![CDATA[V12 Labs]]></dc:creator><pubDate>Wed, 02 Dec 2026 13:25:33 GMT</pubDate><content:encoded><![CDATA[<p>Content creators don't have a writing problem. They have a structure problem. Most people know what they want to say, they just can't figure out how to say it in a way that holds attention from start to finish. StoryFlow was our answer to that. It's an open-source AI tool we built at V12 Labs that helps creators structure, draft, and refine narrative-driven content. Here's the full build story.</p>
<h2>Table of Contents</h2>
<ul>
<li><a href="#the-problem-we-kept-seeing">The Problem We Kept Seeing</a></li>
<li><a href="#what-storyflow-actually-does">What StoryFlow Actually Does</a></li>
<li><a href="#the-tech-stack-decision">The Tech Stack Decision</a></li>
<li><a href="#what-the-ai-actually-does-under-the-hood">What the AI Actually Does Under the Hood</a></li>
<li><a href="#what-was-unexpectedly-hard">What Was Unexpectedly Hard</a></li>
<li><a href="#what-we-shipped-vs-what-we-cut">What We Shipped vs. What We Cut</a></li>
<li><a href="#what-wed-do-differently">What We'd Do Differently</a></li>
<li><a href="#the-open-source-repo">The Open-Source Repo</a></li>
<li><a href="#ready-to-build">Ready to Build?</a></li>
</ul>
<h2>The Problem We Kept Seeing</h2>
<p>We work with a lot of early-stage founders at V12 Labs. Almost all of them have content goals, blog posts, LinkedIn articles, pitch narratives, onboarding docs. And almost all of them hit the same wall: they can write sentences but they can't structure an argument.</p>
<p>The typical workflow looked like this: open a blank document, write a few paragraphs, realize it's going nowhere, start over, give up. The problem wasn't a lack of ideas or writing ability. It was that narrative structure, how to open, how to build tension, how to land a point, is a skill most people were never taught explicitly.</p>
<p>Existing AI writing tools made this worse in a specific way. They generated text fluently but structurelessly. You'd get paragraphs that sounded good individually but didn't build toward anything. The creator still had to do the hard structural work themselves.</p>
<p>We wanted to flip the workflow. Instead of AI generating text that creators then had to structure, we wanted AI doing the structural scaffolding first so creators could fill in what only they know, the specific experiences, examples, and opinions that make content worth reading.</p>
<h2>What StoryFlow Actually Does</h2>
<p>StoryFlow is built around three core functions:</p>
<p><strong>1. Narrative arc generation</strong>. You give it a topic and a target audience. It returns 3â€“5 structural arc options (problem-agitation-solution, hero's journey, before/after/bridge, listicle-with-spine, etc.) with a brief explanation of when each works best.</p>
<p><strong>2. Section scaffolding</strong>. Once you pick an arc, it breaks the piece into sections with a purpose statement for each ("this section needs to establish the reader's pain before introducing your solution") and suggested transition logic between sections.</p>
<p><strong>3. Draft review</strong>. You paste in a draft section and it tells you what's working narratively, what's missing, and what to cut, without rewriting your words. It's advisory, not generative. The goal is to make your writing better, not replace it.</p>
<p>What it deliberately doesn't do: write your content for you. That was a product decision we made early and held to. If the AI writes it, it doesn't sound like you. Content that doesn't sound like you doesn't build trust with your audience. StoryFlow is a structural coach, not a ghostwriter.</p>
<h2>The Tech Stack Decision</h2>
<p>We built StoryFlow on:</p>
<ul>
<li><strong>Next.js + TypeScript</strong>, our default frontend stack across almost everything at V12 Labs</li>
<li><strong>Anthropic Claude (claude-3-5-haiku)</strong>, for the narrative intelligence layer</li>
<li><strong>Supabase</strong>, for user state, saved arcs, and draft history</li>
<li><strong>Vercel</strong>, deployment, edge functions for the AI calls</li>
</ul>
<p>Why Claude over GPT-4o for this specific product? Two reasons. First, Claude's instruction-following is tighter for constrained outputs, when we asked it to return structured arc options in a specific JSON format, it was more consistent than GPT-4o in our testing. Second, Claude tends to be more conservative about over-generating. For a tool where we explicitly didn't want the AI writing paragraphs of content, that mattered.</p>
<p>We considered building this on an open-source model (Llama 3, Mistral) to keep costs at zero, but the structural reasoning quality wasn't there at the time we built it. The gap in narrative coherence was significant enough that we stuck with Claude.</p>
<h2>What the AI Actually Does Under the Hood</h2>
<p>The core intelligence in StoryFlow isn't a single large prompt, it's a chain of smaller, constrained calls.</p>
<p><strong>Arc generation call:</strong> Takes topic + audience + content type (blog post, LinkedIn article, video script, pitch narrative) and returns a structured JSON array of arc options with names, descriptions, and ideal-use-case notes. We constrain the output format tightly, no freeform text, pure structured data. The UI renders it.</p>
<p><strong>Section scaffolding call:</strong> Takes the selected arc and the specific topic/angle and returns a section-by-section breakdown. Each section object has: name, word-count target, purpose (what this section must accomplish narratively), transition cue (the last sentence of this section should set up...), and common mistakes to avoid in this section type.</p>
<p><strong>Draft review call:</strong> This is the most complex. It takes a section, its stated purpose from the scaffolding, and the full arc context, then returns an assessment across four dimensions: narrative function (does it do what it's supposed to?), clarity (can a non-expert follow this?), momentum (does it move the reader forward?), and specificity (is it concrete or generic?). Each dimension gets a 1â€“3 score and a one-line note. No rewrites, no generated replacement text.</p>
<p>The entire system is built around keeping the human in control of the words. The AI handles the structural meta-layer only.</p>
<h2>What Was Unexpectedly Hard</h2>
<p><strong>Getting the arc generation to be genuinely useful, not just named differently.</strong> Our first version returned five arc options that were basically the same structure with different labels. The differentiation felt cosmetic. We had to spend a lot of time on the prompting and the arc taxonomy to make sure each option was actually a meaningfully different approach that would produce a structurally different piece of content.</p>
<p><strong>The draft review calibration.</strong> Getting the AI to be critical without being discouraging, and to be specific without being prescriptive, took a lot of prompt iteration. Early versions either gave vague positive feedback ("this section has good energy") or rewrote entire paragraphs against our explicit instructions. The final prompt is about 400 tokens of careful instruction on what advisory-without-rewriting means in practice.</p>
<p><strong>Supabase real-time state.</strong> We wanted users to see their arc and scaffolding update live as they edited their topic or changed their audience. The Supabase real-time subscriptions worked but added latency we didn't anticipate at the edge. We ended up with a hybrid approach, optimistic local state with Supabase sync on blur rather than on keypress.</p>
<h2>What We Shipped vs. What We Cut</h2>
<p><strong>Shipped:</strong></p>
<ul>
<li>Arc generation and selection</li>
<li>Full section scaffolding with purpose statements</li>
<li>Draft review for individual sections</li>
<li>Save/load functionality for arcs and drafts</li>
<li>Export to markdown and plain text</li>
</ul>
<p><strong>Cut:</strong></p>
<ul>
<li>Cross-section coherence review (checking if section 3 sets up section 4 properly), the prompt complexity was too high and output quality too variable</li>
<li>LinkedIn-specific post formatting mode, we built it, tested it, decided it was out of scope for v1</li>
<li>Team collaboration (multiple users on one piece). Supabase makes this possible, but we didn't have a real use case to validate against</li>
</ul>
<h2>What We'd Do Differently</h2>
<p>The decision to build draft review as advisory-only was right. But we underestimated how much explanation users need to understand why that constraint exists. A lot of early testers tried to use it as a rewriter and were frustrated when it didn't. We'd add more upfront framing around the product's philosophy, "we help you think, not think for you", before anyone touches the UI.</p>
<p>We'd also build the LinkedIn post mode from day one. Content creators on LinkedIn are the highest-intent audience for a tool like this, and we left that segment underserved in v1.</p>
<h2>The Open-Source Repo</h2>
<p>StoryFlow is fully open-source at <strong>github.com/v12labs-engineering/storyflow</strong>. The repo includes the full Next.js codebase, the prompt library with all three core calls documented, a setup guide for running locally with your own Claude API key, and notes on the arc taxonomy we developed.</p>
<p>If you're a developer building tools for content creators, the prompt architecture for constrained AI advisory feedback, scoring without rewriting, might be the most useful thing to borrow from the repo.</p>
<h2>Ready to Build?</h2>
<p>At V12 Labs, we build production-ready AI tools like StoryFlow for founders and early-stage companies. Full source code ownership from Day 1.</p>
<p>If you have an AI tool idea you want to ship, <a href="https://www.v12labs.io">book a discovery call at v12labs.io</a>. We'll scope it honestly and tell you what's possible in 15 days.</p>
<p>Originally published at <a href="https://www.v12labs.io/blog/how-we-built-storyflow">V12 Labs</a>.</p>
]]></content:encoded></item><item><title><![CDATA[Graph Engineering, Explained: Why AI Agent Systems Are Moving Beyond One Loop]]></title><description><![CDATA[Loop engineering lasted about six weeks before the AI industry started asking what came after it. On July 18, 2026, Peter Steinberger, whose earlier post…]]></description><link>https://v12labs.hashnode.dev/graph-engineering-explained-why-ai-agent-systems-are-moving-beyond-one-loop</link><guid isPermaLink="true">https://v12labs.hashnode.dev/graph-engineering-explained-why-ai-agent-systems-are-moving-beyond-one-loop</guid><category><![CDATA[AI]]></category><category><![CDATA[agents]]></category><category><![CDATA[architecture]]></category><category><![CDATA[programming]]></category><dc:creator><![CDATA[V12 Labs]]></dc:creator><pubDate>Wed, 02 Dec 2026 13:24:33 GMT</pubDate><content:encoded><![CDATA[<p>Loop engineering lasted about six weeks before the AI industry started asking what came after it.</p>
<p>On July 18, 2026, Peter Steinberger, whose earlier post helped ignite the loop-engineering conversation, <a href="https://x.com/steipete/status/2078277297791189132">asked a one-line question</a>: "Are we still talking loops or did we shift to graphs yet?" The timing was almost too perfect. Our <a href="https://www.v12labs.io/blog/2026-07-18-loop-engineering-explained">guide to loop engineering</a>, published the same day, ended by predicting that graphs would be the next term to absorb ideas that agent frameworks had already been implementing for years.</p>
<p>That prediction aged quickly. "Graph engineering" is now appearing in technical guides, open-source projects, and architecture discussions. But the phrase is moving faster than its definition. Depending on who is using it, a graph can mean an agent workflow, a multi-agent organization, a knowledge graph, a task-dependency graph, or simply a diagram with boxes and arrows.</p>
<p><strong>Short answer: graph engineering is the practice of explicitly designing how agents, tools, deterministic code, validators, data, and humans connect to complete a task. Nodes do work. Edges decide what can happen next. Shared state carries evidence between steps. Branches, parallel paths, retries, approvals, and stop conditions make the system more than one agent running in a loop. The architecture is real. The name is new, loose, and already overused.</strong></p>
<p>The important shift is not from loops to graphs. A useful agent graph contains loops. The shift is from engineering one autonomous worker to engineering the coordination system around many kinds of work.</p>
<h2>What graph engineering actually is</h2>
<p>A basic agent loop is intentionally simple:</p>
<pre><code>Ask model -&gt; call tool -&gt; inspect result -&gt; repeat until done
</code></pre>
<p>That works when one agent can own the task, keep the relevant context, and evaluate progress against one clear completion condition.</p>
<p>A graph is what the system becomes when the next step depends on more than "continue or stop":</p>
<pre><code>Intake
  -&gt; classify request
  -&gt; run research and policy checks in parallel
  -&gt; merge evidence
  -&gt; generate action
  -&gt; verify
       -&gt; pass: execute
       -&gt; fixable failure: revise and verify again
       -&gt; high risk: request human approval
       -&gt; exhausted budget: stop and escalate
</code></pre>
<p>The exact vocabulary varies by framework, but the core pieces are stable:</p>
<table>
<thead>
<tr>
<th>Part</th>
<th>What it means in an agent system</th>
</tr>
</thead>
<tbody><tr>
<td>Node</td>
<td>A unit of work: an agent, model call, tool, function, validator, or human decision</td>
</tr>
<tr>
<td>Edge</td>
<td>A permitted transition from one node to another</td>
</tr>
<tr>
<td>State</td>
<td>The durable facts and artifacts the workflow needs to carry forward</td>
</tr>
<tr>
<td>Router</td>
<td>Logic that selects the next path based on state or a structured decision</td>
</tr>
<tr>
<td>Fan-out / fan-in</td>
<td>Parallel work that splits into branches and later merges</td>
</tr>
<tr>
<td>Gate</td>
<td>A test, policy check, budget check, or approval that blocks unsafe progress</td>
</tr>
<tr>
<td>Cycle</td>
<td>A path that returns to an earlier node for revision or retry</td>
</tr>
<tr>
<td>Termination</td>
<td>The explicit conditions under which a run succeeds, fails, or escalates</td>
</tr>
</tbody></table>
<p><a href="https://docs.langchain.com/oss/python/langgraph/graph-api">LangGraph's Graph API</a> describes the model directly: state is the current application snapshot, nodes perform work, and edges determine what runs next. Its edges can branch conditionally or trigger multiple nodes in parallel. <a href="https://microsoft.github.io/autogen/dev/user-guide/agentchat-user-guide/graph-flow.html">Microsoft AutoGen's GraphFlow</a> exposes the same underlying ideas for multi-agent teams: sequential execution, parallel fan-out, conditional branching, and loops with exit conditions.</p>
<p>The term "graph engineering" does not belong to either framework. It is a broader label for making those coordination decisions deliberately.</p>
<h2>Why graphs are emerging now</h2>
<p>Graphs are not new to computer science, workflow engines, distributed systems, or AI. The question is why this framing caught attention in 2026.</p>
<h3>Single-agent loops became useful enough to expose the next bottleneck</h3>
<p>When an agent could not reliably use tools or persist through a multi-step task, orchestration was premature. The model itself was the limiting factor.</p>
<p>As agent loops improved, teams started assigning them larger jobs. One agent researched while another reviewed. A planner decomposed a task. Workers ran in parallel. A verifier decided whether work could ship. A human approved high-risk actions. The hard problem moved outward from the prompt and into the relationships between those parts.</p>
<p>Anthropic's production Research system is a concrete example. Its <a href="https://www.anthropic.com/engineering/multi-agent-research-system">multi-agent architecture</a> uses a lead agent to plan, create parallel research agents, combine their findings, decide whether more work is needed, and then pass the result to a citation agent. That is a graph whether or not the product calls it one.</p>
<h3>Frameworks made the topology visible</h3>
<p>LangGraph made state, nodes, and edges explicit. AutoGen added directed graph execution. <a href="https://adk.dev/graphs/">Google's Agent Development Kit 2.0</a> now exposes graph-based workflows that combine agents, tools, human input, and deterministic code with explicit routing and state. The <a href="https://openai.github.io/openai-agents-python/multi_agent/">OpenAI Agents SDK orchestration guide</a> distinguishes manager-controlled agents-as-tools from handoffs, and it recommends mixing model-directed decisions with code-directed flows when predictability, cost, and performance matter.</p>
<p>These tools did not invent branching or parallel execution. They made agent coordination a first-class object developers could inspect, test, persist, and deploy. Their maturity still varies: AutoGen labels GraphFlow experimental, while Google lists live streaming and some third-party integrations as current limitations of its graph workflows. That is evidence of an actively developing architecture layer, not a finished standard.</p>
<h3>Multi-agent systems made implicit wiring expensive</h3>
<p>With one agent, a bad transition often looks like a bad answer. With several agents, the final failure may begin much earlier: the router selected the wrong specialist, a worker withheld information, the merge lost provenance, the verifier checked the wrong condition, or no component had authority to stop the run.</p>
<p>A 2025 study, <a href="https://arxiv.org/abs/2503.13657">Why Do Multi-Agent LLM Systems Fail?</a>, analyzed more than 1,600 traces across seven multi-agent frameworks and organized 14 failure modes into three groups: specification and system design, inter-agent misalignment, and task verification and termination. Better prompts alone did not resolve the full set. The topology and communication protocol mattered.</p>
<p>That is the strongest case for graph engineering: not that graphs make agents intelligent, but that explicit structure makes coordination failures easier to locate and control.</p>
<h2>A graph does not replace a loop</h2>
<p>The "loops are dead" framing is technically wrong and operationally unhelpful.</p>
<p>A graph can contain many loops:</p>
<ul>
<li>a researcher searches until it has enough evidence</li>
<li>a builder edits until tests pass</li>
<li>a reviewer returns weak work to the builder</li>
<li>a recovery node retries a failed integration with backoff</li>
<li>an improvement loop uses production traces to update prompts or policies</li>
</ul>
<p>The graph answers a different question. A loop asks, "Should this worker continue?" A graph asks, "Which worker or control should run next, with what state, and under which conditions?"</p>
<p>Loops provide local iteration. Graphs provide system-level coordination.</p>
<p>This distinction also prevents a common category error: graph engineering is not the same thing as knowledge-graph engineering, GraphRAG, or graph neural networks. Those approaches use graphs to represent knowledge or data relationships. Agent graph engineering uses a graph primarily to represent execution and control flow. A system can use both, but they solve different problems.</p>
<h2>What graphs give you that one loop does not</h2>
<p>The practical value appears when the work has real branching structure.</p>
<h3>Conditional routing</h3>
<p>Different inputs need different paths. A support workflow might route billing questions to one specialist, security issues to a human escalation, and known product questions to a retrieval-backed responder. The router's output should be structured, recorded, and testable rather than buried in a free-form prompt.</p>
<h3>Parallel work with an explicit join</h3>
<p>Independent tasks can run simultaneously: research several markets, inspect separate services, or evaluate an answer against multiple criteria. But parallelism is only useful when the graph also defines how results rejoin, how duplicates are handled, what happens when one branch fails, and whether partial success is acceptable.</p>
<p>Anthropic reported that parallel subagents and parallel tool calls cut research time by as much as 90% for complex research tasks. The same engineering post warns that multi-agent systems consume tokens rapidly and are a poor fit when tasks have many dependencies or require every agent to share the same context. Parallelism is a topology choice, not a universal upgrade.</p>
<h3>Independent verification</h3>
<p>A graph can separate the component that produces work from the component that approves it. That makes the verifier a gate with explicit authority rather than another suggestion in the same conversation.</p>
<p>The gate still needs a reliable rubric. The multi-agent failure study found task verification and termination problems across model and framework choices. Drawing a verifier node does not make its judgment correct.</p>
<h3>Human approval as a normal path</h3>
<p>Human-in-the-loop should not mean an emergency Slack message after the agent has already acted. In a graph, approval can be a defined node that receives the proposed action, supporting evidence, risk flags, and the exact decision required. The workflow pauses durably and resumes from that state.</p>
<h3>Failure isolation and recovery</h3>
<p>A graph can assign different policies to different failures: retry a flaky API call, reroute a missing-data case, send a policy conflict to a human, or stop when the token budget is exhausted. This is where graph-shaped agent systems start looking less like prompt chains and more like durable workflow software.</p>
<h2>Where the current coverage has gaps</h2>
<p>The first wave of graph-engineering content is repeating several mistakes from the loop-engineering cycle.</p>
<p><strong>Gap 1: diagrams are being confused with architecture.</strong> Boxes and arrows are easy. The hard work is defining the state schema, input and output contract for every node, merge behavior, idempotency, timeouts, retry policy, ownership, and terminal states. If those are missing, the diagram documents aspiration rather than execution.</p>
<p><strong>Gap 2: more agents are being treated as more capability.</strong> Anthropic found multi-agent systems useful for high-value, heavily parallel tasks, but reported that they use about 15 times the tokens of ordinary chat interactions and are not a good fit for work with tightly shared context or many dependencies. A graph can spend more compute in more places without improving the outcome.</p>
<p><strong>Gap 3: shared state is discussed as memory, not as a data contract.</strong> State needs types, provenance, versioning, access rules, and a clear source of truth. If two branches overwrite the same field or a summary strips the evidence another node needs, the graph has created distributed ambiguity.</p>
<p>The recovery model matters too. A resumed node may run again from its start, so external side effects need idempotency keys or equivalent deduplication. Otherwise a successful retry can send the same email twice, create duplicate records, or repeat a deployment.</p>
<p><strong>Gap 4: handoffs are under-specified.</strong> Every edge is a contract. What artifact crosses it? Which context is intentionally excluded? Who owns the next decision? Can the receiving node reject incomplete input? Most multi-agent failures that look like weak reasoning can begin as lossy or ambiguous handoffs.</p>
<p><strong>Gap 5: termination remains the load-bearing problem.</strong> Cycles need hard limits. Parallel branches need completion rules. Human-review nodes need expiry and fallback behavior. The system needs to distinguish success, partial completion, safe failure, and abandonment. A graph without termination semantics is a more elaborate way to run forever.</p>
<p><strong>Gap 6: graph generation is being sold ahead of graph validation.</strong> Letting an agent dynamically invent its own workflow is appealing, but graph planning is harder than producing a sequence. The <a href="https://arxiv.org/abs/2410.07869">WorFBench research</a> found a measurable gap between models' sequence-planning and graph-planning abilities. If a model proposes a topology, deterministic validation should check reachable nodes, cycles, permissions, required gates, budgets, and valid terminal paths before execution.</p>
<h2>When a graph is actually worth building</h2>
<p>Use a graph when the task has structural complexity that a single loop is hiding:</p>
<ul>
<li>inputs genuinely route to different specialists or policies</li>
<li>independent subtasks can run in parallel and later merge</li>
<li>production actions require explicit approval or verification gates</li>
<li>failures need different recovery paths</li>
<li>work must pause and resume across long waits or process restarts</li>
<li>state and artifacts must be inspected at intermediate stages</li>
<li>ownership changes between agents, tools, deterministic services, and humans</li>
</ul>
<p>Stay with one loop or a simple function pipeline when:</p>
<ul>
<li>one agent can own the task end to end</li>
<li>the workflow is short, linear, and easy to replay</li>
<li>all steps require the same tightly coupled context</li>
<li>a test or deterministic checker can verify the final result</li>
<li>the graph would add more orchestration code than useful control</li>
</ul>
<p>The best graph is often smaller than the first diagram. Every node adds latency, cost, state, permissions, error modes, and an interface that can drift. If two nodes always run together and share all context, they may be one node. If an LLM is making a decision that ordinary code can make reliably, that node may not need an agent at all.</p>
<h2>What good graph engineering looks like</h2>
<p>A production graph should be reviewable as a set of contracts, not just visible as a picture.</p>
<p>For each node, define:</p>
<ul>
<li>its single responsibility</li>
<li>the minimum state it may read</li>
<li>the structured output it must write</li>
<li>the tools and permissions it can use</li>
<li>its timeout, retry, and cost budget</li>
<li>the evidence required to declare success</li>
</ul>
<p>For each edge, define:</p>
<ul>
<li>the condition that enables it</li>
<li>the artifact or state transition it carries</li>
<li>whether the transition is model-decided or code-decided</li>
<li>what happens when the destination rejects the input</li>
<li>how the transition is traced and evaluated</li>
</ul>
<p>For the graph as a whole, define:</p>
<ul>
<li>one source of truth for shared state</li>
<li>merge rules for concurrent updates</li>
<li>explicit success, failure, escalation, and cancellation states</li>
<li>maximum cycles and total budget</li>
<li>approval boundaries for consequential actions</li>
<li>replay, checkpoint, and recovery behavior</li>
<li>end-to-end evals plus node- and edge-level diagnostics</li>
</ul>
<p>This is why graph engineering is closer to workflow and distributed-systems engineering than to prompt writing. Prompts matter inside nodes. Reliability emerges from the contracts between them.</p>
<h2>Where graph engineering is going next</h2>
<p>The name may fade as quickly as loop engineering did. The underlying work is likely to deepen in four directions.</p>
<p><strong>Graphs become executable specifications.</strong> Architecture diagrams, runtime configuration, permissions, observability, and evals will increasingly describe the same graph rather than living in separate systems that drift apart.</p>
<p><strong>Topology gets evaluated, not just output.</strong> Teams will measure which routes fail, which nodes add value, where state becomes stale, and whether a cheaper or simpler path produces the same outcome. Research such as <a href="https://arxiv.org/abs/2605.18032">PROTEA</a>, which localizes failures to intermediate workflow nodes, points toward graph-level debugging rather than final-answer grading alone.</p>
<p><strong>Static graphs become partially adaptive.</strong> Some paths will remain code-defined for safety and predictability, while agents propose subtasks, workers, or routes within bounded regions. Research systems are already exploring dynamically instantiated workflows, including 2026's <a href="https://arxiv.org/abs/2605.22566">GraphFlow paper</a>. The credible version is constrained adaptation with validation, not an agent rewriting its own control plane without limits.</p>
<p><strong>Durability becomes non-negotiable.</strong> Long-running graphs need persisted state, idempotent actions, resumable approvals, timeouts, and recovery after infrastructure failure. Agent frameworks will keep borrowing ideas that mature workflow engines have spent years learning.</p>
<p>The durable idea is not that every agent should become a graph. It is that once an AI system has multiple workers, decisions, and recovery paths, the wiring is part of the product and deserves the same rigor as the models inside it.</p>
<p>Graph engineering is the emerging name for that rigor. Keep the architecture. Be skeptical of the obituary for loops.</p>
<h2>Sources</h2>
<ul>
<li><a href="https://x.com/steipete/status/2078277297791189132">â€œAre We Still Talking Loops or Did We Shift to Graphs Yet?â€, Peter Steinberger</a></li>
<li><a href="https://www.langchain.com/blog/3-years-of-graph-engineering-with-langgraph">3 Years of Graph Engineering With LangGraph, LangChain</a></li>
<li><a href="https://docs.langchain.com/oss/python/langgraph/graph-api">Graph API Overview, LangGraph</a></li>
<li><a href="https://docs.langchain.com/oss/python/langgraph/choosing-apis">Choosing Between Graph and Functional APIs, LangGraph</a></li>
<li><a href="https://docs.langchain.com/oss/python/langgraph/workflows-agents">Workflows and Agents, LangGraph</a></li>
<li><a href="https://microsoft.github.io/autogen/dev/user-guide/agentchat-user-guide/graph-flow.html">GraphFlow Workflows, Microsoft AutoGen</a></li>
<li><a href="https://adk.dev/graphs/">Graph-Based Agent Workflows, Google Agent Development Kit</a></li>
<li><a href="https://openai.github.io/openai-agents-python/multi_agent/">Agent Orchestration, OpenAI Agents SDK</a></li>
<li><a href="https://www.anthropic.com/engineering/multi-agent-research-system">How We Built Our Multi-Agent Research System, Anthropic</a></li>
<li><a href="https://www.anthropic.com/research/building-effective-agents">Building Effective Agents, Anthropic</a></li>
<li><a href="https://arxiv.org/abs/2503.13657">Why Do Multi-Agent LLM Systems Fail?, Cemri et al.</a></li>
<li><a href="https://arxiv.org/abs/2410.07869">Benchmarking Agentic Workflow Generation, Qiao et al.</a></li>
<li><a href="https://arxiv.org/abs/2605.18032">PROTEA: Offline Evaluation and Iterative Refinement for Multi-Agent LLM Workflows</a></li>
<li><a href="https://arxiv.org/abs/2605.22566">GraphFlow: A Graph-Based Workflow Management for Efficient LLM-Agent Serving</a></li>
</ul>
<p>Originally published at <a href="https://www.v12labs.io/blog/2026-08-17-graph-engineering-explained">V12 Labs</a>.</p>
]]></content:encoded></item><item><title><![CDATA[Loop Engineering, Explained: What It Is, What's Overhyped, and Where It's Going]]></title><description><![CDATA[On June 7, 2026, Peter Steinberger, creator of the open-source agent project OpenClaw, posted twelve words that broke the AI half of the internet for a…]]></description><link>https://v12labs.hashnode.dev/loop-engineering-explained-what-it-is-what-s-overhyped-and-where-it-s-going</link><guid isPermaLink="true">https://v12labs.hashnode.dev/loop-engineering-explained-what-it-is-what-s-overhyped-and-where-it-s-going</guid><category><![CDATA[agents]]></category><category><![CDATA[programming]]></category><category><![CDATA[Productivity]]></category><category><![CDATA[AI]]></category><dc:creator><![CDATA[V12 Labs]]></dc:creator><pubDate>Wed, 02 Dec 2026 13:23:34 GMT</pubDate><content:encoded><![CDATA[<p>On June 7, 2026, Peter Steinberger, creator of the open-source agent project OpenClaw, posted twelve words that broke the AI half of the internet for a week: "You shouldn't be prompting coding agents anymore. You should be designing loops that prompt your agents."</p>
<p>The post cleared 5 million views in a day. Addy Osmani, a Google engineer, published an essay days later giving the idea a name and an anatomy. Boris Cherny, who leads Claude Code at Anthropic, was quoted summing up his own job change in four words: "I don't prompt Claude anymore." By the end of June, "loop engineering" had a thousand explainer posts, a Hacker News thread with 1,800 comments arguing it was nothing new, and at least one team (Uber) capping employee token spend after blowing through a year's AI budget in four months.</p>
<p><strong>Short answer: loop engineering is designing the system that repeatedly prompts, checks, and re-runs an AI agent instead of you typing every next instruction by hand. It's a real and useful pattern for a narrow set of problems. It is not a new idea, it is not free, and most of what got published about it in June was repackaged automation theory with an urgent name.</strong></p>
<p>This post covers what the term actually means, what's missing from most of the coverage, and where the practice is credibly headed.</p>
<h2>What loop engineering actually is</h2>
<p>Strip the branding and the mechanism is old: a <code>while</code> loop with an LLM call inside it.</p>
<pre><code>While (task not solved):
  1. Send history + context to the model
  2. Get a response
  3. If it's a tool call: execute it, append the result, go to 1
  4. If it's a final answer: stop
</code></pre>
<p>That's the base agent loop, and it's not new. It's a direct descendant of the ReAct pattern (Reason + Act) from Princeton and Google research in 2022, and it's the same architecture Anthropic described in its 2024 "Building Effective Agents" post: an LLM, a set of tools, and a loop.</p>
<p>What changed in June 2026 wasn't the mechanism. It was who was doing the looping and how much infrastructure sat around it. Instead of a developer manually re-prompting an agent after each step, the loop itself became a piece of engineering: something you design once, with defined triggers, guardrails, and stop conditions, and then let run without you in it.</p>
<p>Addy Osmani's essay, the piece that gave the practice its name, broke a well-built loop into five parts:</p>
<ul>
<li><strong>Automations</strong>: scheduled or triggered tasks that run without a person kicking them off</li>
<li><strong>Worktrees</strong>: isolated environments so parallel agent runs don't collide on the same files</li>
<li><strong>Skills</strong>: codified project knowledge so the agent doesn't relearn context every run</li>
<li><strong>Connectors</strong>: tool and MCP integrations into existing systems</li>
<li><strong>Sub-agents</strong>: separating the agent that does the work from the agent that checks it</li>
</ul>
<p>LangChain's "Art of Loop Engineering" post added a second axis worth keeping: loops nest. There's the agent loop (calls tools until done), a verification loop (scores output against a rubric and kicks back failures), an event-driven loop (external triggers fire the whole thing inside a bigger system), and what they call a hill-climbing loop (production traces feed back into improving the agent's own configuration over time). Andrew Ng described something similar as three nested loops running at different speeds: the agent's own coding loop (seconds to minutes), the developer's feedback loop (hours), and the organization's feedback loop (weeks).</p>
<p>The clearest production implementation isn't conceptual, it's a shipped feature: Claude Code, Codex, and other coding agents added <code>/goal</code>-style commands in mid-2026 where you define a completion condition upfront and the agent iterates against it until the condition is met or the budget runs out. That commodified what people like Geoffrey Huntley had been hand-rolling for months with bash scripts (his "Ralph Wiggum" technique: a shell loop that just re-invokes the agent until a task is done).</p>
<h2>Where the coverage has real gaps</h2>
<p>Most of what got published in the two weeks after Steinberger's post falls into one of two buckets: content-mill explainers restating the same five bullet points, or hot takes that either evangelize the term or dunk on it as repackaged automation. Both miss the more useful middle ground.</p>
<p><strong>Gap 1: nobody quantifies when a loop is worth building.</strong> The strongest pushback came from a production operator, not a pundit. A practitioner who runs agent loops daily laid out four conditions that actually determine whether a loop pays for itself: the work has to recur at least weekly, the output has to be machine-verifiable (tests, linters, a build passing) rather than judgment-based, you need a budget that survives failed retries, and the agent needs real tooling (logs, a reproducible environment, execution access). Most people repeating the phrase "loop engineering" this summer aren't running a loop that clears that bar. That's a screening test almost none of the explainer content includes.</p>
<p><strong>Gap 2: the cost story is missing or hand-waved.</strong> Agent loops burn roughly 4x the tokens of a normal chat interaction, and multi-agent setups (a maker agent plus a checker agent, which is close to a best practice at this point) push that toward 15x. Uber capped employees at $1,500 a month in token spend after its 2026 AI budget ran out in four months. Almost none of the "what is loop engineering" content mentions a real number, which is a strange omission for a practice whose entire pitch is that it runs unattended and therefore can run a lot.</p>
<p><strong>Gap 3: verification gets a bullet point instead of an architecture.</strong> Nearly every writeup lists "verification" as one of five or six equally-weighted components. In practice it's the load-bearing one. Anthropic's own engineering research on long-running agent harnesses treats this as the central problem: an agent grading its own output has a confirmation-bias problem, so production setups need an independent checker agent, an explicit feature list marked failing until proven passing, and end-to-end testing prompts that block an agent from marking something done without actually exercising it. A loop without a verifier that isn't the same model marking its own homework isn't a loop, it's an unattended guess machine.</p>
<p><strong>Gap 4: the "reference-setter vs. regulator" distinction rarely comes up.</strong> One of the sharper technical takes on the topic (from a dev.to post cutting through the hype) borrows from control theory: loops are good regulators, they can maintain a target you've already defined, correcting drift and holding a known-good state. They're bad reference-setters, they can't decide what the target should be when a spec is ambiguous or the product decision isn't made yet. Most coverage treats loop engineering as a general substitute for interactive development. It isn't. If you don't know what "done" looks like yet, a loop just automates guessing faster.</p>
<p><strong>Gap 5: the vocabulary mockery is fair, but it's also not the whole story.</strong> A widely-shared post mapped the entire lexicon back to plain CS: a while loop became "loop engineering," unit tests became "evals," and so on. That's a legitimate point about hype cycles renaming old ideas. But it undersells the actual shift, which isn't the mechanism, it's that the ecosystem (worktrees, MCP connectors, sub-agent verification, <code>/goal</code> commands) matured enough to make running these loops in production practical for people who aren't building custom infrastructure from scratch. The name is inflated. The tooling underneath it is genuinely new.</p>
<h2>Where it's actually going next</h2>
<p>A few things look more like durable trajectory than hype, based on where the credible technical sources (not the content mills) are pointing:</p>
<p><strong>The vocabulary will fade; the primitives will stay.</strong> "Loop engineering" as a phrase has the shelf life of a conference buzzword, it's already drawing the "just a while loop" backlash that eventually kills a term's momentum. But the primitives underneath it (isolated worktrees, skill files, sub-agent verification, event-driven triggers, <code>/goal</code>-style completion conditions) are getting built directly into coding agent products, not just described in blog posts. Those will outlast the name.</p>
<p><strong>Verification becomes a first-class product feature, not a design choice.</strong> The maker/checker split (one agent does the work, an independent agent or process checks it) is moving from "best practice someone mentioned" to a built-in mode in agent tooling. Expect coding agents to ship this by default rather than as something a team has to hand-roll, the same way test runners became table stakes rather than optional tooling.</p>
<p><strong>Hill-climbing loops are the next layer up.</strong> LangChain's framing, that production traces feed back into automatically improving the agent's own configuration, prompts, or even fine-tuning, is where the more serious engineering orgs are already looking. This is closer to an MLOps feedback loop than a coding assistant feature, and it's the piece most current tooling doesn't do yet.</p>
<p><strong>Cost discipline becomes a forcing function.</strong> Uber's budget cap isn't an outlier, it's a preview. As more teams try unattended loops and hit the same token math (4x baseline, up to 15x for multi-agent), expect a wave of tooling aimed specifically at cost-aware loop design: budget-capped agent runs, cheaper models for the checker role, and loops that fail closed (stop and escalate to a human) rather than fail open (keep burning tokens on a stuck task).</p>
<p><strong>The screening question gets standardized.</strong> Expect something like the four-conditions checklist (recurring, verifiable, affordable, tooled) to show up as an actual pre-flight check in agent platforms, not just advice in a blog post, because the cost of building a loop for a one-off or ambiguous task is now well-documented enough that vendors have an incentive to warn you before you waste the budget.</p>
<p>The practice underneath the phrase is real. The honest version of it is narrower, more boring, and more expensive than the June hype cycle made it sound, and that's exactly why it'll outlast the name.</p>
<h2>The next buzzword is already here</h2>
<p>The turnover is already visible. On July 18, 2026, the same Peter Steinberger whose post kicked off the entire loop engineering cycle six weeks earlier asked his followers: "Are we still talking loops or did we shift to graphs yet?" The post cleared 644,800 views within hours.</p>
<p>It's a fair question and it previews the next phrase this whole cycle is likely to produce. A <code>while</code> loop is a flat, single-threaded control structure: one agent, one path, one condition to exit on. A graph is what you reach for once a "loop" actually needs branches, parallel sub-tasks that fan out and merge back, and state that has to be shared across steps that aren't strictly sequential, which is exactly what multi-agent setups with a maker and a checker, or an event-driven system with several triggers feeding one workflow, already are once you draw them honestly. Frameworks like LangGraph have been modeling agent control flow as a graph rather than a loop for a while; Steinberger's post is less a new idea than a signal that the vocabulary is about to catch up to what production systems already look like.</p>
<p>Expect the same cycle to repeat: a viral post renames an existing pattern, a wave of explainer content restates it without added rigor, and a smaller set of practitioners point out the graph framing was already sitting in orchestration libraries before it had a buzzworthy name. The lesson from loop engineering's own six-week arc holds here too: judge the pattern by whether it solves a real coordination problem you have, not by how fast the name is trending.</p>
<h2>Sources</h2>
<ul>
<li><a href="https://addyosmani.com/blog/loop-engineering/">Loop Engineering, Addy Osmani</a></li>
<li><a href="https://www.langchain.com/blog/the-art-of-loop-engineering">The Art of Loop Engineering, LangChain</a></li>
<li><a href="https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents">Effective Harnesses for Long-Running Agents, Anthropic</a></li>
<li><a href="https://www.anthropic.com/research/building-effective-agents">Building Effective AI Agents, Anthropic</a></li>
<li><a href="https://newsletter.pragmaticengineer.com/p/what-is-loop-engineering">What is "loop engineering?", Gergely Orosz, The Pragmatic Engineer</a></li>
<li><a href="https://dev.to/isaachagoel/loop-engineering-minus-the-hype-4ibn">Loop Engineering Minus the Hype, Isaac Hagoel, dev.to</a></li>
<li><a href="https://blackmatter.vc/lab/loop-engineering-an-honest-verdict-from-someone-who-actually-runs-agent-loops">Loop Engineering: An Honest Verdict From Someone Who Actually Runs Agent Loops, Black Matter VC</a></li>
</ul>
<p>Originally published at <a href="https://www.v12labs.io/blog/2026-07-18-loop-engineering-explained">V12 Labs</a>.</p>
]]></content:encoded></item></channel></rss>