<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ZGI | AI Agent Platform</title>
    <description>The latest articles on DEV Community by ZGI | AI Agent Platform (@zgi_ai).</description>
    <link>https://dev.to/zgi_ai</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4052917%2Fd15d22f7-5684-484d-91a3-f131df0c75a9.jpg</url>
      <title>DEV Community: ZGI | AI Agent Platform</title>
      <link>https://dev.to/zgi_ai</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zgi_ai"/>
    <language>en</language>
    <item>
      <title>ZGI Iteration Nodes: Process Batch Inputs One Item at a Time</title>
      <dc:creator>ZGI | AI Agent Platform</dc:creator>
      <pubDate>Mon, 31 Aug 2026 04:19:23 +0000</pubDate>
      <link>https://dev.to/zgi_ai/zgi-iteration-nodes-process-batch-inputs-one-item-at-a-time-4eb4</link>
      <guid>https://dev.to/zgi_ai/zgi-iteration-nodes-process-batch-inputs-one-item-at-a-time-4eb4</guid>
      <description>&lt;p&gt;Summary: Processing a batch of documents or feedback often involves repeated uploads, duplicated workflows, and manual result merging. ZGI's iteration node applies the same subflow to each list item. Consistent fields, original record IDs, and explicit error-handling rules make the results easier to reconcile.&lt;/p&gt;

&lt;p&gt;Organizing customer feedback usually repeats a small set of actions: read the message, extract the request, assign a category, and record the result. Once that process works for one item, the next task is to apply it across a batch while keeping every result connected to its input.&lt;/p&gt;

&lt;p&gt;The iteration node in ZGI Workflow reads a list, runs a configured subflow for each item, and collects the outputs. Teams can maintain extraction rules and output formats in one place, reducing the work of submitting items individually, copying nodes, and merging responses.&lt;/p&gt;

&lt;p&gt;This pattern suits work that can be split into largely independent items: summarizing documents, categorizing support feedback, or enriching product descriptions. Comparisons and consolidation across records can happen after the per-item processing stage.&lt;/p&gt;

&lt;p&gt;Concept illustration: prepare a list, process each item through the same subflow, then collect results with their original identifiers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make one item work before processing the batch
&lt;/h2&gt;

&lt;p&gt;Suppose an operations team needs to extract an issue category, product, urgency level, and short summary from customer feedback. Start with a single message. Check whether those fields support the next step, such as assigning the issue to a team, before placing the processing steps inside the iteration node.&lt;/p&gt;

&lt;p&gt;If one run produces prose and another produces a table, a larger batch will create more cleanup work. Agree on field names, decide how missing information should be represented, and carry the original record ID into the output.&lt;/p&gt;

&lt;p&gt;In ZGI, the iteration configuration identifies both the input list and the subflow output to collect. The first determines which items enter the process. The second determines what the batch returns. Selecting an intermediate explanation instead of the intended result can leave downstream steps without the business fields they need.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep each result connected to its input
&lt;/h2&gt;

&lt;p&gt;Before processing, organize the inputs into a consistent structure: record ID, original content, source channel, and the small amount of context the task requires. Preserve the ID in the output so later steps can reconnect the result to the original record.&lt;/p&gt;

&lt;p&gt;A message saying “Export fails on mobile” provides enough detail for an issue category and a short description. A message saying only “It doesn't work” may need a flag for missing information. Leave that uncertainty visible rather than inventing a product version or a cause that the customer never supplied.&lt;/p&gt;

&lt;p&gt;Identifiers also help when results are missing or filtered. A batch can contain failed items, empty outputs, or discarded results, so the number of output rows may differ from the number of inputs. Matching by record ID makes those cases easier to reconcile than joining the lists by position alone.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choose what happens when an item fails
&lt;/h2&gt;

&lt;p&gt;ZGI's iteration node offers several error-handling modes. Depending on the workflow's completeness requirements, an error can stop processing or allow other items to continue, with an empty output retained or the failed output omitted.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Error-handling choice&lt;/th&gt;
&lt;th&gt;What the next step needs to account for&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Stop on error&lt;/td&gt;
&lt;td&gt;Resolve the failure before arranging further processing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Continue with an empty output&lt;/td&gt;
&lt;td&gt;Identify empty results and arrange follow-up processing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Continue and omit failed outputs&lt;/td&gt;
&lt;td&gt;Reconcile missing record IDs so omissions remain visible&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For feedback classification, the team may be able to use successful results while reviewing failed items separately. Workflows involving payments, approvals, or writes to business systems need validation and submission steps appropriate to those consequences. Choose the error policy around the business requirement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reconcile the batch before handing it off
&lt;/h2&gt;

&lt;p&gt;When processing ends, compare the original record IDs with the successful, incomplete, and failed results. Check identifiers as well as totals: a duplicate result can otherwise hide a missing one.&lt;/p&gt;

&lt;p&gt;If the next step writes to a database, design duplicate detection around the record identifier. Before processing failed items again, confirm which records were already committed. This belongs in the downstream workflow design; rerunning the batch without that check can create duplicate business records.&lt;/p&gt;

&lt;p&gt;Start with a small batch in ZGI and check the input structure, per-item rules, output fields, and error paths. When a category definition changes, update the shared subflow and validate representative examples. The same configured process can then handle the next batch of similar material.&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/zgiai/zgi" rel="noopener noreferrer"&gt;https://github.com/zgiai/zgi&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Gitee: &lt;a href="https://gitee.com/zgiai/zgi" rel="noopener noreferrer"&gt;https://gitee.com/zgiai/zgi&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  ZGI #AIWorkflows #BatchProcessing #WorkflowAutomation #DataProcessing #EnterpriseAI
&lt;/h1&gt;

</description>
      <category>zgi</category>
      <category>ai</category>
    </item>
    <item>
      <title>ZGI Knowledge Retrieval: Keep Answers Connected to Their Sources</title>
      <dc:creator>ZGI | AI Agent Platform</dc:creator>
      <pubDate>Mon, 31 Aug 2026 04:19:07 +0000</pubDate>
      <link>https://dev.to/zgi_ai/zgi-knowledge-retrieval-keep-answers-connected-to-their-sources-5efb</link>
      <guid>https://dev.to/zgi_ai/zgi-knowledge-retrieval-keep-answers-connected-to-their-sources-5efb</guid>
      <description>&lt;p&gt;Summary: An answer from a company knowledge base still needs to be checked against its sources, scope, and version. Carrying source details alongside retrieved passages gives reviewers a route back to the evidence and makes missing conditions or outdated references easier to spot.&lt;/p&gt;

&lt;p&gt;A knowledge-based answer is easier to use when it includes both a conclusion and the material supporting it. A response such as “This request is eligible” leaves someone with another search to do. The relevant document and passage give them a place to start checking.&lt;/p&gt;

&lt;p&gt;In retrieval-augmented generation (RAG), that connection can get lost between three stages: what the system retrieves, what the model uses, and what the user receives. A fluent answer can still be difficult to verify when the source details disappear along the way.&lt;/p&gt;

&lt;p&gt;ZGI's knowledge retrieval node can return retrieved text alongside source information, including document names and passage identifiers where available. Connecting both outputs to the rest of the workflow gives downstream steps the information needed to build a traceable answer.&lt;/p&gt;

&lt;p&gt;Concept illustration: source information travels with the content so a reviewer can return to the relevant material.&lt;/p&gt;

&lt;h2&gt;
  
  
  Find the passage that supports the claim
&lt;/h2&gt;

&lt;p&gt;Consider a procurement team checking a service term. A supplier may have a framework agreement, an amendment, and a project-specific confirmation. An answer saying “The term is one year” still needs context: which agreement, which project, and whether a later amendment changes the dates.&lt;/p&gt;

&lt;p&gt;The phrase “one year” might refer to a warranty, a renewal period, or an additional service. Keeping the surrounding conditions is often more useful than listing several document names at the bottom of an answer.&lt;/p&gt;

&lt;p&gt;A practical response format includes the conclusion, supporting passage, document name, and any unresolved points. For dates, amounts, or eligibility conditions, give the reader enough information to check the claim against the original. This also makes handoffs easier: the next person can follow the evidence without repeating the search.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pass source details through the workflow
&lt;/h2&gt;

&lt;p&gt;It is easy to send only the retrieved text to a model and ask for a summary. That produces a readable response, but the relationship between documents and passages may be lost.&lt;/p&gt;

&lt;p&gt;In ZGI, plan how the text result and source resources will be used downstream. The passages supply context; the source information supports references. Then specify which claims need supporting material and how the response should mark information that the retrieved content does not establish.&lt;/p&gt;

&lt;p&gt;Display the metadata that is actually available. If a source provides a document name but no page number, retain the name. Add page numbers, version identifiers, or clause locations only when they come from the source. Asking a model to fill in those gaps can create references that look precise but cannot be checked.&lt;/p&gt;

&lt;p&gt;Some conclusions depend on more than one passage. A main agreement may define the service period while an amendment changes the start date. Keep both pieces of evidence connected to the conclusion, and check that they apply to the same project before combining them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check whether the answer goes beyond the evidence
&lt;/h2&gt;

&lt;p&gt;A genuine citation can accompany an overly broad claim. A document may allow an extension “subject to approval,” while the answer leaves out that condition. A policy may apply to one region while the response extends it to every customer.&lt;/p&gt;

&lt;p&gt;Review the answer and its supporting passage together. A useful evaluation set covers direct lookups, questions requiring several documents, conflicting versions, and questions the available material cannot answer. For each example, record whether relevant content was found, whether the reference can be located, and whether the answer preserves the conditions.&lt;/p&gt;

&lt;p&gt;Those checks point to different fixes. If the passage was retrieved but the answer dropped a qualification, revise the generation instructions. If source fields disappeared, inspect the output mapping. If two versions conflict, resolve the document-management issue. Each failure then has a specific place to investigate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Include the review path in the final response
&lt;/h2&gt;

&lt;p&gt;Start with a business area whose source material has a clear scope, such as internal policy questions or a defined set of supplier agreements. Connect knowledge retrieval to the generation step in ZGI, include evidence fields in the response design, and check their alignment with real questions.&lt;/p&gt;

&lt;p&gt;Keep the final answer compact: a conclusion, the relevant passage, and a reference the reader can follow. Route missing information or conflicting conditions to the responsible person. Readers can use the short answer immediately and inspect its basis when the decision calls for a closer look.&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/zgiai/zgi" rel="noopener noreferrer"&gt;https://github.com/zgiai/zgi&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Gitee: &lt;a href="https://gitee.com/zgiai/zgi" rel="noopener noreferrer"&gt;https://gitee.com/zgiai/zgi&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  ZGI #RAG #KnowledgeRetrieval #SourceAttribution #EnterpriseAI #AIWorkflows
&lt;/h1&gt;

</description>
      <category>rag</category>
      <category>zgi</category>
    </item>
    <item>
      <title>ZGI File Artifacts: How to Deliver a Generated Report</title>
      <dc:creator>ZGI | AI Agent Platform</dc:creator>
      <pubDate>Sun, 30 Aug 2026 09:09:08 +0000</pubDate>
      <link>https://dev.to/zgi_ai/zgi-file-artifacts-how-to-deliver-a-generated-report-4988</link>
      <guid>https://dev.to/zgi_ai/zgi-file-artifacts-how-to-deliver-a-generated-report-4988</guid>
      <description>&lt;p&gt;Many teams discover the hardest part of an AI workflow at the last step. The report was generated, yet no one knows which task it belongs to. A link reaches the wrong person. The workflow ends and the file cannot be found. An external system receives a paragraph of text but no actual file. Generation has finished; delivery still needs a design.&lt;/p&gt;

&lt;p&gt;A reusable delivery path can be checked in four stages. Create a recognizable file object. Associate it with the task, user, and runtime. Choose the delivery outlet. Define the access scope and retention rule. Each stage should leave fields that a later node or an operator can inspect.&lt;/p&gt;

&lt;p&gt;Illustration: generation, ownership, delivery outlet, and retention form one delivery chain.&lt;/p&gt;

&lt;h2&gt;
  
  
  Treat the file as a business artifact
&lt;/h2&gt;

&lt;p&gt;A report, spreadsheet, image, or archive needs an identifiable file object. Name, extension, type, size, source node, and creation time provide the metadata required by later steps. When a file is treated as a message attachment only, permission checks, status updates, and re-downloads become difficult to manage.&lt;/p&gt;

&lt;p&gt;ZGI’s workflow file saver can accept binary content returned by a model or a remote URL and create a file object with file type, extension, size, and URL fields. When designing a workflow, agree on the output fields first: which field contains the artifact, which carries the explanation, and which records the producing node.&lt;/p&gt;

&lt;h2&gt;
  
  
  Connect the artifact to the task and identity
&lt;/h2&gt;

&lt;p&gt;The same report may be produced by different users, projects, and runtime instances. Delivery should retain a task identifier, user or tenant context, and the runtime record that created the file. This lets a user open the artifact associated with their own request and gives an administrator a route back to the execution that produced it.&lt;/p&gt;

&lt;p&gt;Association also controls what happens next. An approval step needs to know which file to review. A notification step needs to know which link belongs to which recipient. An archive step needs the business record that owns the artifact. Missing association fields can leave the message and file pointing to different tasks.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Stage&lt;/th&gt;
&lt;th&gt;Information to retain&lt;/th&gt;
&lt;th&gt;Typical risk&lt;/th&gt;
&lt;th&gt;Useful check&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Generation&lt;/td&gt;
&lt;td&gt;Type, name, size, source node&lt;/td&gt;
&lt;td&gt;Text exists but file field is empty&lt;/td&gt;
&lt;td&gt;Inspect node output and file object&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ownership&lt;/td&gt;
&lt;td&gt;Task, user, tenant, runtime ID&lt;/td&gt;
&lt;td&gt;File appears under another task&lt;/td&gt;
&lt;td&gt;Run samples with different identities&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Outlet&lt;/td&gt;
&lt;td&gt;Download, notification, system write-back&lt;/td&gt;
&lt;td&gt;Downstream receives text only&lt;/td&gt;
&lt;td&gt;Confirm the outlet reads the file field&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Retention&lt;/td&gt;
&lt;td&gt;Scope, expiry, cleanup rule&lt;/td&gt;
&lt;td&gt;Link expires or remains exposed&lt;/td&gt;
&lt;td&gt;Test lifecycle and access boundaries&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Select an outlet that matches the receiver
&lt;/h2&gt;

&lt;p&gt;Internal collaboration may use a download link. A business system may need a file identifier or structured fields. An archive process may write the artifact back to a specific record. The right outlet depends on how the receiver continues the work, not only on whether the current page can open the file.&lt;/p&gt;

&lt;p&gt;Signed URLs can fit temporary access because they avoid exposing the underlying storage details. For long-term retention, a workflow can store the file identifier in the business record and let the system create an access URL after checking permissions. The exact expiry period and access mode depend on the deployment configuration and should be confirmed before release.&lt;/p&gt;

&lt;h2&gt;
  
  
  Record delivery failures as workflow states
&lt;/h2&gt;

&lt;p&gt;Generation success, upload failure, notification failure, and permission denial describe different states. Later nodes need to know which state occurred, and people need to see where the failure happened. A delivery record can include whether generation completed, whether the outlet confirmed receipt, and whether human handling is required.&lt;/p&gt;

&lt;p&gt;ZGI runtime history can retain generated-file information. When a user reports that a link cannot be opened, check the file object first, then the link lifetime, and finally the access identity. This order keeps the investigation close to observable facts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cover the boundary with three test groups
&lt;/h2&gt;

&lt;p&gt;Before release, test a normal file, an empty file, and a file that exceeds the configured limit. Combine those cases with different users, tenants, and expiry times. Record the generation result, task association, outlet response, and access result in one acceptance sheet.&lt;/p&gt;

&lt;p&gt;These tests expose details that are easy to miss: whether the extension matches the content, whether a remote address can be read by the service, whether a signed link expires as expected, and whether a notification carries the correct artifact. Finding such issues near the generation step usually reduces the cost of correction.&lt;/p&gt;

&lt;p&gt;Once delivery is designed, a generated report can move into the business process with a clear trail. The generation node produces the artifact, task and identity establish ownership, the outlet sends it onward, and the retention rule governs later access. Putting those four stages into a Workflow gives the team a repeatable path to inspect.&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/zgiai/zgi" rel="noopener noreferrer"&gt;https://github.com/zgiai/zgi&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Gitee: &lt;a href="https://gitee.com/zgiai/zgi" rel="noopener noreferrer"&gt;https://gitee.com/zgiai/zgi&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  ZGI #FileArtifacts #Workflow #AgentDelivery #AccessControl #EnterpriseAI
&lt;/h1&gt;

</description>
      <category>automation</category>
      <category>opensource</category>
    </item>
    <item>
      <title>ZGI Workflow: Where to Look When a Branch Takes the Wrong Path</title>
      <dc:creator>ZGI | AI Agent Platform</dc:creator>
      <pubDate>Sun, 30 Aug 2026 09:07:33 +0000</pubDate>
      <link>https://dev.to/zgi_ai/zgi-workflow-where-to-look-when-a-branch-takes-the-wrong-path-36od</link>
      <guid>https://dev.to/zgi_ai/zgi-workflow-where-to-look-when-a-branch-takes-the-wrong-path-36od</guid>
      <description>&lt;p&gt;The most confusing workflow failures often look simple: an approval status says “approved,” yet the flow enters the missing-materials path; an amount is below the threshold, yet the next node is skipped. Looking only at the final node rarely reveals where the decision changed.&lt;/p&gt;

&lt;p&gt;A condition branch usually follows four connected steps. An upstream node writes data into the variable pool. The condition node reads a selected path and evaluates one or more comparisons. The scheduler activates the edge associated with the selected case. Downstream nodes consume the resulting values. A reliable investigation follows the same order.&lt;/p&gt;

&lt;p&gt;Illustration: four inspection layers from the input variable to the downstream output.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with the input variable
&lt;/h2&gt;

&lt;p&gt;A condition node can only read values that have reached the variable pool. A renamed output field, an incorrect nested path, or a skipped upstream node can leave the branch with an empty value or an older value. Record the variable selector, the value observed at runtime, and the node that produced it. These three pieces should point to the same source.&lt;/p&gt;

&lt;p&gt;In ZGI Workflow, node outputs are written back to the variable pool and later nodes read them through the node identifier and output field. That relationship is worth making explicit in a test sheet. Also keep types visible: the string 100 and the number 100 may take different paths when a comparison is evaluated.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check the comparison and logical operator
&lt;/h2&gt;

&lt;p&gt;Correct input data can still produce an unexpected branch when the comparison rule is wrong. Common causes include leading or trailing spaces, case differences, date formats, null handling, or using “equals” where the business rule requires “contains.” When several conditions are grouped together, verify whether the group uses AND or OR and whether the order of cases matches the intended rule.&lt;/p&gt;

&lt;p&gt;ZGI’s condition branch reads the selected variable, evaluates the comparison operator, and records the condition results. Capture the actual value, expected value, and operator for every condition. This turns “it should have matched” into a result that another person can review.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;What to inspect&lt;/th&gt;
&lt;th&gt;Typical clue&lt;/th&gt;
&lt;th&gt;Next action&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Input&lt;/td&gt;
&lt;td&gt;Path, type, latest value&lt;/td&gt;
&lt;td&gt;Empty, stale, or renamed field&lt;/td&gt;
&lt;td&gt;Check the upstream node output&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Condition&lt;/td&gt;
&lt;td&gt;Operator, expected value, AND/OR&lt;/td&gt;
&lt;td&gt;Format or whitespace mismatch&lt;/td&gt;
&lt;td&gt;Run a fixed sample once&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Branch&lt;/td&gt;
&lt;td&gt;Selected handle and active edge&lt;/td&gt;
&lt;td&gt;False path selected, node skipped&lt;/td&gt;
&lt;td&gt;Compare the runtime record&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Output&lt;/td&gt;
&lt;td&gt;Downstream input and final value&lt;/td&gt;
&lt;td&gt;Missing field or unchanged status&lt;/td&gt;
&lt;td&gt;Check variable write-back and consumer&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Confirm the scheduler followed the selected edge
&lt;/h2&gt;

&lt;p&gt;A true condition only identifies a selected case. The following nodes still depend on graph connections and upstream branch state. The scheduler continues along an active edge; a node without an active upstream path may be skipped. When the condition looks right but the result never appears, inspect the branch handle and edge connections before changing the rule.&lt;/p&gt;

&lt;p&gt;Runtime records become more useful when viewed together: condition results, the selected handle, and node status should tell the same story. If the handle is correct, inspect the graph connection and downstream input. If the handle is wrong, return to the variable and comparison layers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reproduce the issue with a small sample set
&lt;/h2&gt;

&lt;p&gt;Prepare three fixed cases: an obvious match, an obvious non-match, and a boundary value. Change one field at a time and record the input, condition result, selected branch, and downstream output. This keeps concurrency, stale variables, and external service changes from hiding the real cause.&lt;/p&gt;

&lt;p&gt;For amounts, dates, and enumerated statuses, define one input format and one default value. When a model returns natural language such as “approved,” “passed,” or “review completed,” pass it through a structured step before the condition node. A branch should compare stable fields, not several phrasings that mean roughly the same thing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep the diagnosis in the runtime record
&lt;/h2&gt;

&lt;p&gt;Branch errors often return after a workflow is edited. Keep the test samples, expected paths, and observed results after each correction, then run the same checks before release. ZGI’s variable pool and runtime records give the team a shared place to discuss the input, decision, and execution result.&lt;/p&gt;

&lt;p&gt;Stable branching comes from a visible chain: every input has a source, each condition can be reviewed, the active path is clear, and downstream nodes receive the expected fields. Working through these four layers makes troubleshooting easier to repeat and easier to turn into an acceptance checklist.&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/zgiai/zgi" rel="noopener noreferrer"&gt;https://github.com/zgiai/zgi&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Gitee: &lt;a href="https://gitee.com/zgiai/zgi" rel="noopener noreferrer"&gt;https://gitee.com/zgiai/zgi&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  ZGI #Workflow #ConditionBranching #VariablePool #RuntimeRecords #EnterpriseAutomation
&lt;/h1&gt;

</description>
      <category>devtools</category>
      <category>automation</category>
      <category>aiops</category>
      <category>workflow</category>
    </item>
    <item>
      <title>When Agent Workflows Run for Hours: Designing for Failure, Recovery, and Inspection</title>
      <dc:creator>ZGI | AI Agent Platform</dc:creator>
      <pubDate>Wed, 26 Aug 2026 14:59:51 +0000</pubDate>
      <link>https://dev.to/zgi_ai/when-agent-workflows-run-for-hours-designing-for-failure-recovery-and-inspection-1875</link>
      <guid>https://dev.to/zgi_ai/when-agent-workflows-run-for-hours-designing-for-failure-recovery-and-inspection-1875</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fac7l46yz2pq98sfuj4vu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fac7l46yz2pq98sfuj4vu.png" alt=" " width="800" height="343"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A five-minute agent demo can assume that the process stays alive, the network cooperates, and every tool returns a clear result.&lt;/p&gt;

&lt;p&gt;A five-hour workflow cannot.&lt;/p&gt;

&lt;p&gt;Long-running agents wait on external APIs, process large files, call models repeatedly, trigger side effects, and sometimes pause for a human decision. During that time a worker can crash, a container can be replaced, a request can time out after the remote system has already succeeded, or a workflow can resume under a different prompt or tool version.&lt;/p&gt;

&lt;p&gt;At that point, an agent workflow is no longer “a prompt with several tool calls.” It is a distributed workflow with probabilistic steps.&lt;/p&gt;

&lt;p&gt;This article presents a generic production pattern for making those workflows recoverable and inspectable. It is a synthesis of durable-execution systems, workflow engines, observability standards, and published engineering cases. It is not a claim that any one agent platform provides every component described here.&lt;/p&gt;

&lt;h2&gt;
  
  
  Durable does not mean keeping one process alive
&lt;/h2&gt;

&lt;p&gt;The central idea behind durable execution is simple:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Preserve the information required to continue outside the process that is doing the work.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://docs.temporal.io/encyclopedia/architecture/temporal-sdks" rel="noopener noreferrer"&gt;Temporal&lt;/a&gt; persists workflow event history so a worker can reconstruct state after failure. &lt;a href="https://docs.langchain.com/oss/python/langgraph/persistence" rel="noopener noreferrer"&gt;LangGraph persistence&lt;/a&gt; stores graph-state checkpoints associated with a thread. &lt;a href="https://docs.aws.amazon.com/step-functions/latest/dg/redrive-executions.html" rel="noopener noreferrer"&gt;AWS Step Functions redrive&lt;/a&gt; can continue eligible failed executions from unsuccessful steps while retaining successful step results.&lt;/p&gt;

&lt;p&gt;The mechanisms differ, but the architectural lesson is consistent: memory in a worker is not durable state.&lt;/p&gt;

&lt;p&gt;It also helps to separate three kinds of storage:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Workflow state&lt;/strong&gt; — the current node, attempts, decisions, deadlines, and checkpoint pointers for one run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Application memory&lt;/strong&gt; — reusable user or organizational information that can survive across runs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Artifacts&lt;/strong&gt; — large files, generated reports, tool outputs, and datasets stored separately and referenced by hash or URI.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Mixing these lifecycles makes recovery harder. A checkpoint should not need to serialize a two-gigabyte artifact, and long-term memory should not be treated as proof that a specific node completed successfully.&lt;/p&gt;

&lt;h2&gt;
  
  
  The failures you must model explicitly
&lt;/h2&gt;

&lt;p&gt;“Failed” is too broad to be a useful workflow state. Different failures require different responses.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Transient dependency failure
&lt;/h3&gt;

&lt;p&gt;Network interruptions, rate limits, temporary capacity problems, and service restarts may succeed on a later attempt. Retry them with a limit, exponential backoff, jitter, and a total retry budget.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Permanent or deterministic failure
&lt;/h3&gt;

&lt;p&gt;Invalid arguments, missing permissions, incompatible schemas, and policy rejections will not improve with another identical request. Route them to a repair path, a human, or a terminal state.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Unknown side-effect outcome
&lt;/h3&gt;

&lt;p&gt;This is the dangerous one. Your HTTP request timed out, but the remote service may already have sent the email, charged the card, created the ticket, or changed the database.&lt;/p&gt;

&lt;p&gt;Do not classify this as ordinary failure. Use a first-class &lt;code&gt;NEEDS_RECONCILIATION&lt;/code&gt; state and verify the external result before retrying.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Worker or sandbox loss
&lt;/h3&gt;

&lt;p&gt;Containers are replaceable. The workflow identity, event history, and checkpoints must not be. Anthropic’s description of its managed-agent architecture makes a similar separation: a session is represented as an append-only event log, while harness and sandbox processes can be replaced.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Replay incompatibility
&lt;/h3&gt;

&lt;p&gt;A checkpoint may outlive the code, prompt, model route, tool schema, or policy that created it. Resume against a pinned release, or perform an explicit migration. Silent upgrades during recovery turn an incident response into an untested deployment.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Retry storm
&lt;/h3&gt;

&lt;p&gt;Retries add load to a system that may already be unhealthy. If every layer retries independently, traffic can multiply rapidly. Pick one retry-owning layer, add backoff and jitter, and use a circuit breaker when a dependency is likely to remain unavailable.&lt;/p&gt;

&lt;h3&gt;
  
  
  7. Zombie execution
&lt;/h3&gt;

&lt;p&gt;An agent can loop indefinitely, wait forever for an approval, or continue spending tokens after the result has lost value. Every run needs a total deadline plus limits for model calls, tool calls, cost, iterations, and idle time.&lt;/p&gt;

&lt;h3&gt;
  
  
  8. Duplicate or concurrent resume
&lt;/h3&gt;

&lt;p&gt;The same event can be delivered twice. Two people can approve simultaneously. A retry can race with a manual repair. Stable workflow IDs, optimistic locking, and idempotent resume tokens protect state transitions from duplication.&lt;/p&gt;

&lt;h2&gt;
  
  
  A minimum production architecture
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frizkor67axmtlag833gk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frizkor67axmtlag833gk.png" alt=" " width="800" height="343"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A practical architecture does not need to be enormous, but it needs explicit boundaries:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Trigger / API
     |
     v
Durable Orchestrator
  - workflow_id
  - pinned release manifest
  - node states and attempts
  - deadlines and budgets
  - checkpoint pointers
     |
     +----&amp;gt; Node Workers / Tool Adapters
     |          |
     |          +----&amp;gt; External APIs / Databases
     |          +----&amp;gt; Artifact Store
     |          +----&amp;gt; Side-effect Ledger
     |
     +----&amp;gt; Human Inbox (wait / approve / resume)
     |
     +----&amp;gt; Trace, Log, and Evaluation Store
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;strong&gt;orchestrator&lt;/strong&gt; owns state transitions. Workers execute bounded steps. The &lt;strong&gt;artifact store&lt;/strong&gt; holds large outputs. The &lt;strong&gt;side-effect ledger&lt;/strong&gt; records the intent, idempotency key, and external receipt for operations that change the world. The &lt;strong&gt;human inbox&lt;/strong&gt; persists waiting states instead of holding an HTTP connection open. The &lt;strong&gt;trace store&lt;/strong&gt; explains what happened across models, tools, queues, and services.&lt;/p&gt;

&lt;h2&gt;
  
  
  Give each node a real state machine
&lt;/h2&gt;

&lt;p&gt;At minimum, use states that preserve operational meaning:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;READY
  |
  v
RUNNING --------------------------&amp;gt; SUCCEEDED
  |
  +-- transient -----------------&amp;gt; RETRY_SCHEDULED --&amp;gt; READY
  +-- human required ------------&amp;gt; WAITING_HUMAN ----&amp;gt; READY
  +-- outcome unknown -----------&amp;gt; NEEDS_RECONCILIATION
  +-- permanent -----------------&amp;gt; FAILED_PERMANENT
  +-- rollback required ---------&amp;gt; COMPENSATING
                                      |
                                      +--&amp;gt; COMPENSATED / FAILED
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;NEEDS_RECONCILIATION&lt;/code&gt; deserves special emphasis. “The client did not receive success” and “the operation did not happen” are different facts. AWS’s guidance on idempotent APIs recommends client-supplied request tokens and server-side records that associate a token with the original request. If the same token arrives with different parameters, that should be treated as an error rather than a new operation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Idempotency belongs to the logical operation
&lt;/h2&gt;

&lt;p&gt;An idempotency key should remain stable across attempts of the same logical action.&lt;/p&gt;

&lt;p&gt;This is wrong:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;workflow_id&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;:&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;node_id&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;:&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;attempt_number&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every retry gets a new key, so the downstream system sees a new operation.&lt;/p&gt;

&lt;p&gt;Prefer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;stable_hash&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;workflow_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;node_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;logical_operation_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Store the key before dispatching the side effect. Record the external receipt when it arrives. If the response is lost, query the downstream service or ledger using that same identity.&lt;/p&gt;

&lt;p&gt;Do not assume a workflow framework removes this responsibility. Temporal notes that an Activity can run successfully and then be retried if the worker crashes before reporting completion. LangGraph warns that code before an interrupt may execute again when the node resumes. The application still needs safe side-effect semantics.&lt;/p&gt;

&lt;h2&gt;
  
  
  A simplified execution loop
&lt;/h2&gt;

&lt;p&gt;The following pseudocode omits framework-specific details, but shows the responsibilities clearly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;run_workflow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;workflow_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;load_or_create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;workflow_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;workflow_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;release_manifest&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nf"&gt;current_release_manifest&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;is_terminal&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;enforce_deadline&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;enforce_cost_and_tool_budgets&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="n"&gt;node&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;planner&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;next_ready_node&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;requires_human&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;issue_resume_token&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="n"&gt;workflow_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;workflow_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;node_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;state_version&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;version&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;checkpoint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;wait_for_human&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;status&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;waiting_human&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;token&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;stable_hash&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;workflow_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;logical_operation_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;execute_with_policy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;idempotency_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;retry_if&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;is_transient_and_safe&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;backoff&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;exponential_with_jitter&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="p"&gt;)&lt;/span&gt;

            &lt;span class="n"&gt;side_effect_ledger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;record_receipt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;receipt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;apply_result&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;checkpoint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="n"&gt;UnknownSideEffectOutcome&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;checkpoint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;needs_reconciliation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;status&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;needs_reconciliation&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="n"&gt;PermanentError&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;compensate_or_fail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;checkpoint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;final_result&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice what is not left implicit: deadlines, budgets, release versions, human waits, idempotency, reconciliation, compensation, and checkpoint boundaries.&lt;/p&gt;

&lt;h2&gt;
  
  
  Human-in-the-loop is a durable state, not a modal dialog
&lt;/h2&gt;

&lt;p&gt;Human review is often presented as a UI feature. Architecturally, it is a long-lived workflow state.&lt;/p&gt;

&lt;p&gt;Pause before irreversible actions such as sending an external message, deleting data, moving money, changing production systems, or approving access. Persist the &lt;code&gt;WAITING_HUMAN&lt;/code&gt; state. Bind the resume token to the workflow, node, and expected state version. Make repeated submissions idempotent. Provide expiration, rejection, cancellation, and escalation paths.&lt;/p&gt;

&lt;p&gt;Most importantly, revalidate business conditions when the workflow resumes. Permission, price, inventory, risk, and policy may have changed while the agent was waiting.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trace the decisions, not only the final answer
&lt;/h2&gt;

&lt;p&gt;OpenTelemetry defines a span as a unit of work with timing, attributes, events, links, and status. That model maps well to agent nodes. A node-level record should include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;workflow, run, node, attempt, trace, and parent-span IDs;&lt;/li&gt;
&lt;li&gt;workflow, prompt, model, tool, and knowledge-index versions;&lt;/li&gt;
&lt;li&gt;input, output, state, and checkpoint references with hashes;&lt;/li&gt;
&lt;li&gt;idempotency key, side-effect intent, receipt, and reconciliation state;&lt;/li&gt;
&lt;li&gt;timeout, deadline, heartbeat, retry reason, and backoff;&lt;/li&gt;
&lt;li&gt;human request, actor, decision, and timestamp;&lt;/li&gt;
&lt;li&gt;error class, policy result, evaluation score, and final state.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Agent-specific tracing systems can add model generations, tool calls, handoffs, and guardrail events. Trace grading can then identify which step caused a regression. It should be treated as a debugging and evaluation aid, not as proof that the workflow is correct.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where ZGI fits
&lt;/h2&gt;

&lt;p&gt;We are building &lt;a href="https://github.com/zgiai/zgi" rel="noopener noreferrer"&gt;ZGI&lt;/a&gt;, an open-source, self-hostable Agent Runtime. It brings agents, visual workflows, knowledge, database connections, reusable Skills, model integrations, and tool execution into one workspace. The goal is to reduce repeated integration work for developers and make agent applications easier to assemble and operate.&lt;/p&gt;

&lt;p&gt;ZGI is relevant here because production reliability spans the whole agent application, not only the model call. A shared runtime gives teams a place to connect the workflow, tools, knowledge, and human interactions that need to be inspected together.&lt;/p&gt;

&lt;p&gt;This article’s checkpoint protocol, retry model, side-effect ledger, state machine, and tracing fields are a general reference architecture. They should not be interpreted as a statement that ZGI currently implements every mechanism exactly as shown. We prefer to keep that boundary explicit while building the project in the open.&lt;/p&gt;

&lt;h2&gt;
  
  
  The test that matters
&lt;/h2&gt;

&lt;p&gt;The most useful question for a long-running agent is not “Can it complete the happy path?”&lt;/p&gt;

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

&lt;blockquote&gt;
&lt;p&gt;If the worker disappears immediately after step 12 changes an external system, can we determine what happened, avoid repeating the action, restore the correct versioned state, and continue safely?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If the answer is unclear, the workflow is not durable yet.&lt;/p&gt;

&lt;p&gt;Long-running agent reliability is mostly the disciplined engineering of state, identity, side effects, time, and evidence. Models make the workflow intelligent. The runtime makes it operable.&lt;/p&gt;




&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.temporal.io/encyclopedia/architecture/temporal-sdks" rel="noopener noreferrer"&gt;Temporal workflow event history&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.temporal.io/activity-definition" rel="noopener noreferrer"&gt;Temporal Activities: retries and idempotency&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.langchain.com/oss/python/langgraph/persistence" rel="noopener noreferrer"&gt;LangGraph persistence&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.langchain.com/oss/python/langgraph/interrupts" rel="noopener noreferrer"&gt;LangGraph interrupts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/step-functions/latest/dg/redrive-executions.html" rel="noopener noreferrer"&gt;AWS Step Functions redrive&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/builders-library/timeouts-retries-and-backoff-with-jitter/" rel="noopener noreferrer"&gt;AWS: Timeouts, retries, and backoff with jitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/" rel="noopener noreferrer"&gt;AWS: Making retries safe with idempotent APIs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://opentelemetry.io/docs/concepts/signals/traces/" rel="noopener noreferrer"&gt;OpenTelemetry traces&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents" rel="noopener noreferrer"&gt;Anthropic: Effective harnesses for long-running agents&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://netflixtechblog.com/netflix-conductor-a-microservices-orchestrator-2e8d4771bf40" rel="noopener noreferrer"&gt;Netflix Conductor&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/zgiai/zgi" rel="noopener noreferrer"&gt;ZGI on GitHub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
    </item>
    <item>
      <title>Your AI Agents Don’t Need More Context. They Need Current Context.</title>
      <dc:creator>ZGI | AI Agent Platform</dc:creator>
      <pubDate>Wed, 26 Aug 2026 14:56:23 +0000</pubDate>
      <link>https://dev.to/zgi_ai/your-ai-agents-dont-need-more-context-they-need-current-context-m5l</link>
      <guid>https://dev.to/zgi_ai/your-ai-agents-dont-need-more-context-they-need-current-context-m5l</guid>
      <description>&lt;p&gt;&lt;em&gt;The next reliability problem for enterprise agents is not how much they can read. It is whether the knowledge, permissions, tools, and instructions they use still describe the same reality.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvty1wzhu76qk28d6z83r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvty1wzhu76qk28d6z83r.png" alt=" " width="800" height="342"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Imagine an enterprise agent handling a routine request. It retrieves the relevant policy, checks the customer record, follows the approved workflow, and produces a clear recommendation.&lt;/p&gt;

&lt;p&gt;Everything looks correct—except the policy changed yesterday.&lt;/p&gt;

&lt;p&gt;The source document was updated, but the search index had not finished syncing. The prompt still referenced the old process. A tool schema had moved to a new version. The customer’s permissions had changed since the conversation began. Every individual component behaved as designed, yet together they assembled an answer from different moments in time.&lt;/p&gt;

&lt;p&gt;This is one of the most important reliability problems in enterprise AI: &lt;strong&gt;context drift&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The industry has spent years making context windows larger and retrieval systems more capable. Those advances matter. But an agent that can read more is not automatically an agent that knows what is current. In a production system, the real question is not “How much context did we provide?” It is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Did the agent receive the smallest, freshest, most authoritative set of information permitted for this task—and can we prove it?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  More context can make the wrong answer more convincing
&lt;/h2&gt;

&lt;p&gt;Retrieval-augmented generation was designed in part to give language models access to updateable knowledge and source provenance. That was a major step beyond relying only on facts stored in model parameters. But RAG creates an interface for knowledge governance; it does not provide governance automatically.&lt;/p&gt;

&lt;p&gt;Research on knowledge conflicts shows why this distinction matters. Models can face conflicts between their parametric memory and retrieved material, between multiple retrieved sources, or even within their own learned knowledge. In experiments where generated and retrieved contexts disagreed, models sometimes favored plausible but incorrect generated information. Semantic similarity alone did not guarantee authority or truth.&lt;/p&gt;

&lt;p&gt;This becomes more difficult inside an organization. A single question might touch a policy page, a database row, a Slack discussion, a ticket, a workflow definition, and a user-specific permission. A recent enterprise RAG benchmark intentionally includes near-duplicate documents, incorrect filing, conflicting information, missing information, and data spread across multiple business systems. Although the benchmark uses synthetic enterprise data and remains a preprint, the failure modes are familiar to anyone who has worked with internal knowledge.&lt;/p&gt;

&lt;p&gt;Adding more documents can therefore amplify three risks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;More old material increases the chance that obsolete guidance will be retrieved.&lt;/li&gt;
&lt;li&gt;More near-duplicates can let repetition dominate ranking, even when the repeated claim is no longer authoritative.&lt;/li&gt;
&lt;li&gt;More conflicting excerpts force the model to decide which source to trust, often without the metadata needed to make that decision safely.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The problem is not a lack of tokens. It is a lack of temporal and operational coherence.&lt;/p&gt;

&lt;h2&gt;
  
  
  An agent operates across several clocks
&lt;/h2&gt;

&lt;p&gt;“The knowledge base is up to date” sounds like a simple statement. In practice, an enterprise agent depends on several independently changing versions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;when a business fact or policy becomes effective;&lt;/li&gt;
&lt;li&gt;when the source document was revised;&lt;/li&gt;
&lt;li&gt;when a connector last synced successfully;&lt;/li&gt;
&lt;li&gt;which parser, chunking method, embedding model, and index generation processed it;&lt;/li&gt;
&lt;li&gt;which prompt commit is running in production;&lt;/li&gt;
&lt;li&gt;which workflow and tool contract are active;&lt;/li&gt;
&lt;li&gt;which database or semantic model version answers the query;&lt;/li&gt;
&lt;li&gt;which permissions apply to the current user;&lt;/li&gt;
&lt;li&gt;which corrections remain in agent memory.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each clock can be valid on its own. Context drift appears when they stop moving together.&lt;/p&gt;

&lt;p&gt;Official product documentation offers concrete examples. Amazon Bedrock documents that changes in a source must be synchronized before they appear in a knowledge base. It also warns that direct ingestion and source synchronization can diverge: a direct index change may not update the original source, and a later source sync may overwrite it. Google Cloud exposes fields such as refresh interval, last synchronization time, update time, and recent errors for data connectors. LlamaIndex uses document IDs and hashes to decide whether a document needs to be reprocessed.&lt;/p&gt;

&lt;p&gt;These are not minor implementation details. They are evidence that freshness is a state that must be measured, not a label that can be assumed.&lt;/p&gt;

&lt;p&gt;Prompt and workflow versions introduce the same issue. A production prompt may still expect an old database field. A new tool definition may be deployed before the workflow that knows how to use it. An updated policy may reach the index while an older approval rule remains active. Even when every deployment is individually successful, the combined runtime may be inconsistent.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6rt1hgdr1p5u7905srpv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6rt1hgdr1p5u7905srpv.png" alt=" " width="800" height="343"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Treat context as a release, not a pile of documents
&lt;/h2&gt;

&lt;p&gt;Software teams would not knowingly deploy half of one application release and half of another. Enterprise context deserves the same discipline.&lt;/p&gt;

&lt;p&gt;One useful pattern is a &lt;strong&gt;Context Release Manifest&lt;/strong&gt;: a versioned record of the exact knowledge and operational dependencies used by an agent run. It might pin the prompt commit, workflow version, tool contract, knowledge index generation, semantic model, policy version, and permission scope. Each source can carry an owner, revision, effective time, ingestion time, validation time, and content hash.&lt;/p&gt;

&lt;p&gt;This is a general architecture pattern, not a claim about a specific platform feature. Its purpose is to make one previously vague question answerable: &lt;em&gt;What reality did this agent believe it was operating in?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The manifest should be paired with a &lt;strong&gt;Context Contract&lt;/strong&gt;. Data contracts already express commitments between producers and consumers around schema, freshness, and quality. Applied to agent context, the contract can define:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;who owns a knowledge source;&lt;/li&gt;
&lt;li&gt;what its schema and business meaning are;&lt;/li&gt;
&lt;li&gt;how stale it is allowed to become;&lt;/li&gt;
&lt;li&gt;which access controls must survive ingestion;&lt;/li&gt;
&lt;li&gt;which source wins when two sources conflict;&lt;/li&gt;
&lt;li&gt;what the agent must do when freshness or provenance cannot be verified.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For low-risk work, the fallback may be to warn the user. For a financial operation, permission change, legal decision, or irreversible action, the correct behavior may be to abstain and escalate.&lt;/p&gt;

&lt;p&gt;That distinction is important. Freshness is not a single global threshold. A product FAQ may tolerate a day of lag. Inventory, pricing, access rights, or fraud signals may require runtime verification. The system should apply a freshness objective appropriate to the decision being made.&lt;/p&gt;

&lt;h2&gt;
  
  
  A practical update path
&lt;/h2&gt;

&lt;p&gt;A safer context pipeline separates ingestion from publication. Instead of continuously mutating the production index with no clear boundary, teams can process a new generation, test it, and then publish it atomically.&lt;/p&gt;

&lt;p&gt;A practical flow looks like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Detect a source event, change-data-capture event, or scheduled refresh.&lt;/li&gt;
&lt;li&gt;Resolve the canonical identity, owner, revision, effective time, access controls, and provenance.&lt;/li&gt;
&lt;li&gt;Validate freshness, schema, policy, duplication, deletion, and conflict rules.&lt;/li&gt;
&lt;li&gt;Parse, chunk, embed, and build a shadow index generation.&lt;/li&gt;
&lt;li&gt;Run retrieval regressions, answer evaluations, and permission tests.&lt;/li&gt;
&lt;li&gt;Publish the prompt, workflow, tools, semantic model, and index as a compatible release—or block the release if they are not compatible.&lt;/li&gt;
&lt;li&gt;Monitor stale retrievals, unresolved conflicts, synchronization failures, and version skew.&lt;/li&gt;
&lt;li&gt;Revalidate, roll back, or remove obsolete material when a contract fails.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This turns knowledge updates into an observable operational process. It also makes rollback possible. If a new parser loses table structure or a new index reduces citation quality, the system can return to a known release instead of debugging a moving target.&lt;/p&gt;

&lt;h2&gt;
  
  
  Measure the age of what the agent actually used
&lt;/h2&gt;

&lt;p&gt;Many teams monitor whether an ingestion job completed. That is necessary, but it is not enough. The more useful metrics describe the context seen at decision time:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source age:&lt;/strong&gt; time since the underlying information became effective or was last verified.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ingestion lag:&lt;/strong&gt; time between a source change and successful publication to the active index.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deletion latency:&lt;/strong&gt; time between removal at the source and disappearance from retrieval.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Provenance coverage:&lt;/strong&gt; percentage of retrieved material with a source revision, owner, and effective time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stale-hit rate:&lt;/strong&gt; percentage of answers that relied on superseded content.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Conflict rate:&lt;/strong&gt; percentage of retrievals containing contradictory sources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Release skew:&lt;/strong&gt; percentage of runs using incompatible prompt, workflow, tool, schema, or index versions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unowned context rate:&lt;/strong&gt; percentage of knowledge assets with no accountable owner.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These metrics move the conversation away from “the chatbot seems accurate” and toward a reliability model that engineering, security, and business teams can inspect together.&lt;/p&gt;

&lt;h2&gt;
  
  
  Retrieval should be selective—and sometimes live
&lt;/h2&gt;

&lt;p&gt;Not every question should be answered from the same storage layer.&lt;/p&gt;

&lt;p&gt;Stable procedures and approved documentation are good candidates for indexed retrieval. Rapidly changing operational facts may need a live query against a database, semantic model, or business API. Sensitive questions must preserve the requesting user’s permissions. High-risk answers should return evidence that a person can inspect.&lt;/p&gt;

&lt;p&gt;OpenAI’s description of its internal data agent illustrates this layered approach: curated organizational context is combined with runtime warehouse queries when existing context is missing or stale. The company describes this as an internal system, not a public product, so it should be read as an engineering case study rather than a universal blueprint. The broader pattern is still useful: &lt;strong&gt;prepare durable context offline, but verify volatile facts at runtime.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Likewise, a very large instruction file is not necessarily better context. OpenAI’s harness engineering team describes using a short navigation file and a structured, versioned documentation system rather than putting every rule into one ever-growing file. Progressive disclosure reduces noise and makes important instructions easier to maintain and test.&lt;/p&gt;

&lt;p&gt;The objective is not to show the model everything. It is to reveal the right information at the moment it becomes relevant.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where an Agent Runtime fits
&lt;/h2&gt;

&lt;p&gt;Context governance does not live in the vector database alone. It crosses models, knowledge, tools, permissions, workflows, memory, and human decisions. That is one reason teams increasingly need an Agent Runtime: a common operational layer where these parts can be assembled, inspected, and managed as one application rather than as disconnected integrations.&lt;/p&gt;

&lt;p&gt;We are building &lt;a href="https://github.com/zgiai/zgi" rel="noopener noreferrer"&gt;ZGI&lt;/a&gt; as an open-source, self-hostable Agent Runtime. It brings agents, visual workflows, knowledge, database connections, reusable Skills, model integrations, and tool execution into one workspace. For developers, the aim is to reduce repeated integration work. For teams deploying agents in real environments, the aim is to make the system around the model easier to understand and operate.&lt;/p&gt;

&lt;p&gt;ZGI should not be read as a shortcut around the engineering described in this article. The Context Contract and Context Release Manifest are general design proposals, and this article does not claim that ZGI automatically implements every freshness, provenance, release, or rollback control described above. The point is simpler: reliable agents need a runtime where knowledge and action can be governed together, and we are building in that direction in the open.&lt;/p&gt;

&lt;h2&gt;
  
  
  The next context race is about coherence
&lt;/h2&gt;

&lt;p&gt;Larger context windows will continue to improve. Retrieval systems will become faster. Models will get better at resolving ambiguity. None of that removes the need to know when a source changed, who owns it, which version was used, whether the user was allowed to see it, and what the agent should do when those facts cannot be reconciled.&lt;/p&gt;

&lt;p&gt;Enterprise agents do not fail only because they lack information. They also fail because they receive too much information from different versions of reality.&lt;/p&gt;

&lt;p&gt;The next step is not simply to give agents more context.&lt;/p&gt;

&lt;p&gt;It is to make context current, compatible, attributable, and safe to act on.&lt;/p&gt;

</description>
      <category>ai</category>
    </item>
    <item>
      <title>Reversible Context Compaction: How to Compress Agent History Without Losing the Evidence</title>
      <dc:creator>ZGI | AI Agent Platform</dc:creator>
      <pubDate>Thu, 20 Aug 2026 12:13:42 +0000</pubDate>
      <link>https://dev.to/zgi_ai/reversible-context-compaction-how-to-compress-agent-history-without-losing-the-evidence-5c2c</link>
      <guid>https://dev.to/zgi_ai/reversible-context-compaction-how-to-compress-agent-history-without-losing-the-evidence-5c2c</guid>
      <description>&lt;p&gt;Context compaction is often explained as a summarization problem: when the prompt becomes too large, summarize the old messages and continue in a fresh window.&lt;/p&gt;

&lt;p&gt;That description is adequate for a conversation. It is incomplete for an agent.&lt;/p&gt;

&lt;p&gt;An agent trace is not only prose. It contains tool calls, tool results, approvals, files, database records, identifiers, checkpoints, and evidence that may later become important. If all of that is flattened into a paragraph, the runtime may save tokens while losing the ability to prove, inspect, or safely resume what happened.&lt;/p&gt;

&lt;p&gt;For long-running agents, useful compaction should be reversible.&lt;/p&gt;

&lt;h2&gt;
  
  
  A summary is not a source of truth
&lt;/h2&gt;

&lt;p&gt;Imagine an agent reviewing a large contract. A parsing tool returns 40,000 tokens of clauses, page coordinates, metadata, and extraction diagnostics. The model initially needs only the liability section, so a compactor later reduces the result to:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The contract contains a limitation-of-liability clause with several exceptions.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That sentence may be enough for the next planning step. It is not enough when the agent later needs the exact cap, the governing subsection, or the original page reference. It is also dangerous if a later model treats the summary as primary evidence.&lt;/p&gt;

&lt;p&gt;The original tool result and the compact model view have different roles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the original result is durable evidence;&lt;/li&gt;
&lt;li&gt;the preview is a navigation aid;&lt;/li&gt;
&lt;li&gt;the summary carries task-relevant conclusions;&lt;/li&gt;
&lt;li&gt;the reference allows the agent to recover the source.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Compaction should change how information is loaded, not silently delete the only copy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Store the original, send a bounded view
&lt;/h2&gt;

&lt;p&gt;ZGI handles oversized tool results by moving the full result into an Artifact store and sending a smaller projection to the model. A conceptual receipt looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ArtifactReceipt
  reference: artifact://task/7f3a...
  media_type: application/json
  original_size: 40,812 tokens
  preview: selected high-signal fields and excerpts
  content_hash: sha256:...
  source_tool: contract_parser
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The receipt is deliberately not a replacement for the source. It tells the model what exists, where it came from, and how to request the complete content.&lt;/p&gt;

&lt;p&gt;The content hash serves two purposes. It verifies that the recovered artifact is the same result the model saw earlier, and it allows the runtime to reuse an existing reference instead of creating a new artifact every time the source is opened.&lt;/p&gt;

&lt;p&gt;That second property matters. Without reference reuse, an agent can accidentally create a recursive storage loop:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;large result
  -&amp;gt; artifact A
  -&amp;gt; agent reloads artifact A
  -&amp;gt; reloaded content becomes artifact B
  -&amp;gt; agent reloads artifact B
  -&amp;gt; artifact C ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A stable reference turns the same flow into:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;large result
  -&amp;gt; artifact A
  -&amp;gt; agent reloads artifact A
  -&amp;gt; runtime recognizes the content hash
  -&amp;gt; context returns to the same artifact A reference
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The model can inspect the full source when necessary without causing context and storage to grow recursively.&lt;/p&gt;

&lt;h2&gt;
  
  
  Preserve complete API rounds
&lt;/h2&gt;

&lt;p&gt;Reversible evidence is only one invariant. Tool protocol integrity is another.&lt;/p&gt;

&lt;p&gt;Most model APIs represent an agent step as a response containing one or more tool calls, followed by the corresponding tool results. These messages are structurally linked. Compaction must not select arbitrary message boundaries.&lt;/p&gt;

&lt;p&gt;Treat the following as one complete API round:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;model response
  -&amp;gt; tool call A
  -&amp;gt; tool call B
tool result A
tool result B
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The runtime may retain, summarize, or archive that round, but it should not produce an intermediate context such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;model response
  -&amp;gt; tool call A
  -&amp;gt; tool call B
tool result A
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The missing result is not merely incomplete information. It creates an invalid execution history and may cause the next model call to fail or reason from a tool action that never appears to have completed.&lt;/p&gt;

&lt;p&gt;The same rule applies to persistence and recovery. If an interruption leaves an incomplete tail, the runtime should restore the last complete round and represent the interrupted work as explicit task state rather than pretending the partial trace is valid history.&lt;/p&gt;

&lt;h2&gt;
  
  
  Compress in a controlled order
&lt;/h2&gt;

&lt;p&gt;A robust compaction pipeline can be represented as a sequence of increasingly expensive interventions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;protect stable instructions and active task state

if request &amp;gt; working budget:
    project oversized tool results into artifact receipts

if request still &amp;gt; working budget:
    shrink old, already-consumed tool results

if request still &amp;gt; working budget:
    summarize the oldest complete API rounds

rebuild the request
validate tool-call pairing, task state, and token budget

if request &amp;gt; hard limit:
    run controlled recovery compaction
    validate again

if validation fails:
    checkpoint and stop with an explicit failure state
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This order avoids unnecessary semantic summarization. Raw output can often be reduced through deterministic projection alone. Semantic compaction is reserved for history whose meaning, rather than exact payload, must be carried forward.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summaries should be written for continuation
&lt;/h2&gt;

&lt;p&gt;A generic meeting-style summary is a poor handoff for an agent. The compaction prompt should produce a continuation record that preserves operational information:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the current objective and success criteria;&lt;/li&gt;
&lt;li&gt;decisions already made and why;&lt;/li&gt;
&lt;li&gt;completed actions and their outcomes;&lt;/li&gt;
&lt;li&gt;unresolved questions and failed attempts;&lt;/li&gt;
&lt;li&gt;pending approvals or external events;&lt;/li&gt;
&lt;li&gt;references to source artifacts;&lt;/li&gt;
&lt;li&gt;constraints that must remain active;&lt;/li&gt;
&lt;li&gt;the most likely next step.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is closer to a checkpoint manifest than a recap.&lt;/p&gt;

&lt;p&gt;Anthropic’s guidance on long-horizon context similarly emphasizes preserving architectural decisions, unresolved bugs, and implementation details while removing redundant tool output. OpenAI’s native compaction retains high-value prior state for subsequent windows. The implementation details differ, but the shared goal is continuity, not merely brevity.&lt;/p&gt;

&lt;p&gt;References:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents" rel="noopener noreferrer"&gt;Anthropic: Effective context engineering for AI agents&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://openai.com/index/equip-responses-api-computer-environment/" rel="noopener noreferrer"&gt;OpenAI: Context compaction for tool-driven agents&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.googleblog.com/en/architecting-efficient-context-aware-multi-agent-framework-for-production/" rel="noopener noreferrer"&gt;Google: Context-aware multi-agent architecture&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Revalidate after compaction
&lt;/h2&gt;

&lt;p&gt;Compaction output should never be accepted solely because a summarizer returned successfully. The reconstructed request needs a second validation pass.&lt;/p&gt;

&lt;p&gt;At minimum, the runtime should verify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the next request is within the working and hard budgets;&lt;/li&gt;
&lt;li&gt;every visible tool call has the required result;&lt;/li&gt;
&lt;li&gt;active instructions and the current user goal remain present;&lt;/li&gt;
&lt;li&gt;pending approvals and workflow state are still represented;&lt;/li&gt;
&lt;li&gt;artifact references resolve and match their expected hashes;&lt;/li&gt;
&lt;li&gt;private runtime data has not leaked into the client-visible transcript.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If any invariant fails, the runtime needs a known recovery path. “Try the same oversized request again” is not a recovery strategy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep model context separate from frontend history
&lt;/h2&gt;

&lt;p&gt;One subtle design mistake is using the same message object for model input, persistence, debugging, and frontend rendering. These consumers need different views.&lt;/p&gt;

&lt;p&gt;The model may require private tool metadata, internal references, or compressed execution state. The frontend should usually receive only user-safe messages and approved execution details. Debugging may require another privileged trace containing the final model request and the reason each compaction decision was made.&lt;/p&gt;

&lt;p&gt;Separating these views improves both security and observability:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;private context does not need to be exposed to the browser;&lt;/li&gt;
&lt;li&gt;developers can inspect what the model actually received;&lt;/li&gt;
&lt;li&gt;users can see a clean interaction history;&lt;/li&gt;
&lt;li&gt;the runtime can evolve its internal representation without breaking the UI contract.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The real metric is recoverable progress
&lt;/h2&gt;

&lt;p&gt;Token reduction is useful, but it is not the success condition. A successful compaction system should allow the agent to continue making correct, inspectable progress.&lt;/p&gt;

&lt;p&gt;That means testing whether the agent can reload original evidence, preserve paired parallel tool calls, recover after summary failure, resume from checkpoints, and stop safely when valid reconstruction is impossible.&lt;/p&gt;

&lt;p&gt;Reversible compaction turns context from a disposable prompt into a managed runtime layer. The model sees a small, relevant working set. The system keeps the complete evidence and execution state. When detail becomes important again, the agent can retrieve it rather than guess.&lt;/p&gt;

&lt;p&gt;That is the foundation long-running agents need if they are expected to complete work rather than merely continue a conversation.&lt;/p&gt;

&lt;p&gt;ZGI’s source is available on GitHub: &lt;a href="https://github.com/zgiai/zgi" rel="noopener noreferrer"&gt;github.com/zgiai/zgi&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
    </item>
    <item>
      <title>A Larger Context Window Is Not a Runtime Strategy for Long-Running Agents</title>
      <dc:creator>ZGI | AI Agent Platform</dc:creator>
      <pubDate>Thu, 20 Aug 2026 11:47:00 +0000</pubDate>
      <link>https://dev.to/zgi_ai/a-larger-context-window-is-not-a-runtime-strategy-for-long-running-agents-4n4m</link>
      <guid>https://dev.to/zgi_ai/a-larger-context-window-is-not-a-runtime-strategy-for-long-running-agents-4n4m</guid>
      <description>&lt;p&gt;Modern models can accept more context than ever. That helps developers build richer prototypes, but it can also encourage a dangerous assumption: if an agent has a large enough context window, it can keep working indefinitely.&lt;/p&gt;

&lt;p&gt;Long-running agents fail for a different reason. The problem is not only how much information the model can technically receive. It is whether the runtime can keep the right information available, preserve execution state, control tool output, and recover after the working window has been reorganized.&lt;/p&gt;

&lt;p&gt;This is why context engineering is becoming runtime engineering.&lt;/p&gt;

&lt;h2&gt;
  
  
  A long task is a sequence of model calls
&lt;/h2&gt;

&lt;p&gt;A chatbot may answer after one or two model calls. An agent completing a real task can make dozens or hundreds. It searches, reads files, calls APIs, inspects results, revises its plan, requests approval, and tries again.&lt;/p&gt;

&lt;p&gt;Every step adds new material:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;user instructions and business constraints;&lt;/li&gt;
&lt;li&gt;model decisions and intermediate plans;&lt;/li&gt;
&lt;li&gt;tool calls and their results;&lt;/li&gt;
&lt;li&gt;retrieved documents and database records;&lt;/li&gt;
&lt;li&gt;approval states, checkpoints, and generated artifacts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tool results are usually the fastest-growing part. A single repository scan, document extraction, or analytics query can return more tokens than the conversation that preceded it. Replaying all of that material on every inference call increases cost and latency while making the current task harder to see.&lt;/p&gt;

&lt;p&gt;Google has described the same failure mode in ADK: long-running workflows accumulate irrelevant conversation, old tool output, and duplicated instructions. OpenAI also notes that tool-driven loops fill the context window quickly and now provides native compaction for extended workflows. Anthropic frames the underlying discipline as context engineering: selecting the smallest set of high-signal tokens that gives the model the best chance of taking the right next action.&lt;/p&gt;

&lt;p&gt;The common conclusion is simple: a larger physical window does not remove the need for an actively managed working window.&lt;/p&gt;

&lt;p&gt;References:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://openai.com/index/equip-responses-api-computer-environment/" rel="noopener noreferrer"&gt;OpenAI: From model to agent&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.googleblog.com/build-long-running-ai-agents-that-pause-resume-and-never-lose-context-with-adk/" rel="noopener noreferrer"&gt;Google: Build long-running agents that pause and resume&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents" rel="noopener noreferrer"&gt;Anthropic: Effective context engineering for AI agents&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Separate the model window from the task state
&lt;/h2&gt;

&lt;p&gt;A reliable agent should not treat its prompt as the only copy of reality. At minimum, the runtime needs to distinguish four forms of state:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Stable instructions&lt;/strong&gt; — the agent’s role, policies, tool contracts, and the user’s current goal.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Durable task state&lt;/strong&gt; — checkpoints, approvals, pending actions, workflow position, and structured variables.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Evidence and artifacts&lt;/strong&gt; — original documents, tool outputs, generated files, and other material that may need to be inspected again.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Working context&lt;/strong&gt; — the compact, task-relevant view sent to the model for the next decision.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The working context is a view, not the database of record. It may be much smaller than the model’s maximum input window. That is intentional: the runtime needs space for the next tool result, the next model response, and unexpected branches in the task.&lt;/p&gt;

&lt;p&gt;This also changes the meaning of memory. Memory is not “keep every message forever.” It is the ability to reconstruct the information required for the next correct action.&lt;/p&gt;

&lt;h2&gt;
  
  
  Govern context before every model call
&lt;/h2&gt;

&lt;p&gt;In ZGI, context is treated as runtime working memory. Before a model call, the runtime estimates the request, preserves non-compressible state, reduces low-value history, rebuilds the working view, and validates it again.&lt;/p&gt;

&lt;p&gt;Conceptually, the loop looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;collect current task state
  -&amp;gt; estimate the next request
  -&amp;gt; protect instructions and active tool rounds
  -&amp;gt; project oversized results into references
  -&amp;gt; compact consumed history when necessary
  -&amp;gt; rebuild the working context
  -&amp;gt; validate budget and protocol integrity
  -&amp;gt; call the model
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Doing this before every inference is important. Agent context can grow suddenly: several parallel tools may finish in the same round, or one tool may return an unexpectedly large payload. A policy that runs only when the hard model limit is reached reacts too late.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use layered compaction, not one destructive summary
&lt;/h2&gt;

&lt;p&gt;The safest reduction is usually the least semantic one. ZGI therefore applies context reduction in layers.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Project oversized results
&lt;/h3&gt;

&lt;p&gt;Large tool results are stored outside the model window. The model receives a bounded preview, metadata, and a reference to the complete result. The source remains available if the agent later needs a precise passage or value.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Replace consumed output with a receipt
&lt;/h3&gt;

&lt;p&gt;Once the model has already used a tool result, the runtime does not need to replay the raw payload forever. A compact receipt can preserve the source, size, summary, content hash, and artifact reference.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Compact older complete rounds
&lt;/h3&gt;

&lt;p&gt;If deterministic reduction is not enough, older execution history can be summarized. The boundary matters: a model response and all tool results produced from it form one complete API round. The runtime should never keep the tool call while dropping its result, or keep the result while losing the call that produced it.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Recover safely
&lt;/h3&gt;

&lt;p&gt;If the rebuilt request still exceeds the hard limit, the runtime needs a controlled recovery path. It can perform a more aggressive final compaction, revalidate the result, and continue only if the task state remains legal. Otherwise it should checkpoint and stop clearly instead of retrying a request that cannot succeed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test continuity, not just token reduction
&lt;/h2&gt;

&lt;p&gt;A context system can reduce token counts while quietly damaging the task. Useful tests therefore need to check more than input size.&lt;/p&gt;

&lt;p&gt;ZGI’s validation scenarios include a single task running through 100 tool-call rounds with multiple compactions, parallel tool results remaining correctly paired, oversized artifacts being projected and reloaded, repeated summary failures converging safely, and complete execution history being restored across user turns.&lt;/p&gt;

&lt;p&gt;The important questions are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Can the agent still identify the current goal?&lt;/li&gt;
&lt;li&gt;Are tool calls and results structurally valid?&lt;/li&gt;
&lt;li&gt;Can original evidence be recovered?&lt;/li&gt;
&lt;li&gt;Are approvals and checkpoints preserved?&lt;/li&gt;
&lt;li&gt;Does failure stop in a known state?&lt;/li&gt;
&lt;li&gt;Can developers inspect why compaction happened?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is the difference between prompt trimming and runtime context management.&lt;/p&gt;

&lt;h2&gt;
  
  
  Context is now part of the execution layer
&lt;/h2&gt;

&lt;p&gt;Long-running agents need more than larger windows. They need explicit task state, bounded working context, recoverable evidence, complete tool-call history, and a failure path that does not invent progress.&lt;/p&gt;

&lt;p&gt;Models will continue to improve. Context windows will continue to grow. Neither change eliminates the runtime’s responsibility to decide what the model should see at each step.&lt;/p&gt;

&lt;p&gt;ZGI is being built around that responsibility: helping agents keep working within finite windows while preserving the state and evidence required to finish real tasks.&lt;/p&gt;

&lt;p&gt;The source is available on GitHub: [github.com/zgiai/zgi]&lt;/p&gt;

</description>
      <category>ai</category>
    </item>
    <item>
      <title>A Bigger Context Window Is Not Agent Memory</title>
      <dc:creator>ZGI | AI Agent Platform</dc:creator>
      <pubDate>Mon, 17 Aug 2026 03:56:05 +0000</pubDate>
      <link>https://dev.to/zgi_ai/a-bigger-context-window-is-not-agent-memory-3hp2</link>
      <guid>https://dev.to/zgi_ai/a-bigger-context-window-is-not-agent-memory-3hp2</guid>
      <description>&lt;p&gt;A one-million-token context window is an impressive engineering capability. It allows an agent to retain more code, tool output, documents, and conversation history before older information must be summarized or removed.&lt;br&gt;
But a larger context window should not be confused with a complete memory system.&lt;br&gt;
When building agents, it helps to separate three concepts: context, memory, and state.&lt;br&gt;
Context is the model’s current working set. It may include the user request, retrieved documents, tool results, recent messages, and system instructions. A larger context window increases the amount of information the model can consider during one execution.&lt;br&gt;
Memory is information that should persist beyond the current execution. This could include user preferences, previous decisions, reusable knowledge, commitments, or results that will be needed in a future session.&lt;br&gt;
State describes the progress of a task. It records which steps have completed, which tools were called, what outputs were produced, whether approval is pending, and where execution should resume after a failure.&lt;br&gt;
These layers have different lifecycles.&lt;br&gt;
Context may be compacted or discarded. Memory must be selected and updated intentionally. Workflow state must be stored deterministically enough for the system to resume, inspect, or replay an execution.&lt;br&gt;
Trying to solve all three by placing more information inside the prompt creates several problems:&lt;br&gt;
Token usage and latency continue to grow.&lt;br&gt;
Old and irrelevant information competes with useful context.&lt;br&gt;
Task progress becomes difficult to inspect.&lt;br&gt;
Recovery depends on the model reconstructing what happened.&lt;br&gt;
Permissions and tool actions remain mixed with natural-language history.&lt;br&gt;
A production Agent Runtime should therefore manage these responsibilities outside the model where appropriate.&lt;br&gt;
The model still reasons over context, but persistent memory, workflow state, permissions, tool execution, and runtime logs need their own structures.&lt;br&gt;
This is one of the architectural ideas we are exploring in ZGI. The goal is not to fit the entire system into a larger prompt. It is to give each layer a clear responsibility and make agent execution easier to understand and operate.&lt;br&gt;
ZGI is available here, and feedback from other builders is welcome:&lt;br&gt;
&lt;a href="https://github.com/zgiai/zgi" rel="noopener noreferrer"&gt;https://github.com/zgiai/zgi&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Should Agent Companies Build a Platform or Solve One Workflow First?</title>
      <dc:creator>ZGI | AI Agent Platform</dc:creator>
      <pubDate>Thu, 13 Aug 2026 03:22:20 +0000</pubDate>
      <link>https://dev.to/zgi_ai/should-agent-companies-build-a-platform-or-solve-one-workflow-first-1ej9</link>
      <guid>https://dev.to/zgi_ai/should-agent-companies-build-a-platform-or-solve-one-workflow-first-1ej9</guid>
      <description>&lt;p&gt;AI agents are changing the shape of software.&lt;/p&gt;

&lt;p&gt;Traditional SaaS gives users a set of features and expects them to operate the product. Agent-based software starts from a goal: the system retrieves context, chooses tools, executes steps, asks for approval when needed, and returns an outcome.&lt;/p&gt;

&lt;p&gt;The interface may become simpler. The system behind it becomes much harder to operate.&lt;/p&gt;

&lt;p&gt;That creates an early strategic question for agent companies: should they build a general platform, or begin with one concrete workflow?&lt;/p&gt;

&lt;p&gt;Why vertical workflows are easier to validate&lt;/p&gt;

&lt;p&gt;A focused workflow makes the value visible.&lt;/p&gt;

&lt;p&gt;Resolving a support ticket, reviewing a contract, handling an invoice exception, onboarding an employee, or routing a procurement request all have recognizable inputs, steps, owners, and outcomes. A team can speak with the people doing the work, observe where the process fails, and measure whether the product saves time or reduces manual intervention.&lt;/p&gt;

&lt;p&gt;A general agent platform is harder to evaluate. “Build any agent” sounds flexible, but it asks the buyer to identify the use case, design the workflow, connect the systems, define permissions, and carry much of the implementation risk.&lt;/p&gt;

&lt;p&gt;For an early product, flexibility can easily become work transferred to the customer.&lt;/p&gt;

&lt;p&gt;The workflow is only the visible layer&lt;/p&gt;

&lt;p&gt;Once an agent moves from a demo into a real organization, the same operational questions appear across industries:&lt;/p&gt;

&lt;p&gt;• Which data is the agent allowed to read?&lt;br&gt;
• Which identity does it use when calling a tool?&lt;br&gt;
• Which actions require human approval?&lt;br&gt;
• What happens when a long-running task fails halfway through?&lt;br&gt;
• Can an operator inspect the full execution history?&lt;br&gt;
• Can the team change models without rebuilding the business process?&lt;br&gt;
• Can the system meet deployment, security, and data-residency requirements?&lt;/p&gt;

&lt;p&gt;These may look like infrastructure concerns, but they directly affect adoption. A company will not give an agent meaningful access if it cannot control permissions, trace actions, or stop unsafe execution.&lt;/p&gt;

&lt;p&gt;This is where an agent runtime becomes relevant. The runtime is not the use case itself. It is the operational layer that keeps knowledge, tools, workflows, state, approvals, execution, and observability working together.&lt;/p&gt;

&lt;p&gt;“Start with a workflow” does not mean “stay vertical forever”&lt;/p&gt;

&lt;p&gt;The useful distinction is not simply platform versus application. It is whether the team can turn delivery experience into reusable product capability.&lt;/p&gt;

&lt;p&gt;A practical architecture has three layers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Runtime core — execution, state, permissions, tool access, approvals, logs, retries, and recovery.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reusable workflow layer — templates, Skills, nodes, and domain patterns that can be used across similar processes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Organization-specific configuration — data sources, identity systems, policies, approval rules, and internal integrations.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The first layer should remain general. The second should grow through repeated use. The third will always contain some variation, but it should not repeatedly force changes into the core.&lt;/p&gt;

&lt;p&gt;If every new customer requires the execution engine to be rewritten, the company is still doing custom projects. If a new deployment mostly involves configuration, integration, and workflow adaptation, the platform is beginning to compound.&lt;/p&gt;

&lt;p&gt;What should an early agent platform measure?&lt;/p&gt;

&lt;p&gt;Feature count is a weak signal. The number of supported models or workflow nodes says little about whether the system is usable in production.&lt;/p&gt;

&lt;p&gt;More useful questions are:&lt;/p&gt;

&lt;p&gt;• How long does it take to get the first real workflow running?&lt;br&gt;
• Does the second similar deployment require materially less work?&lt;br&gt;
• Can failed tasks be inspected and resumed instead of restarted?&lt;br&gt;
• How often does a human need to rescue the workflow?&lt;br&gt;
• Will a customer connect real systems and grant meaningful permissions?&lt;br&gt;
• Will they pay for reliable execution, not just access to a demo?&lt;/p&gt;

&lt;p&gt;These signals connect infrastructure work to business value.&lt;/p&gt;

&lt;p&gt;The path we are taking with ZGI&lt;/p&gt;

&lt;p&gt;We are building ZGI as a self-hostable Agent Runtime, primarily in Go. It brings models, knowledge, tools, Skills, workflows, state, and execution into one workspace.&lt;/p&gt;

&lt;p&gt;Our goal is not to claim that a horizontal platform can discover product-market fit in isolation. We want to validate the runtime through concrete workflows, identify the operational problems that repeat across deployments, and turn those repeated problems into reusable capabilities.&lt;/p&gt;

&lt;p&gt;In short: use workflows to discover the hard problems; use the runtime to solve the ones that keep returning.&lt;/p&gt;

&lt;p&gt;The source is available on GitHub:&lt;br&gt;
[&lt;a href="https://github.com/zgiai/zgi" rel="noopener noreferrer"&gt;https://github.com/zgiai/zgi&lt;/a&gt;]&lt;/p&gt;

&lt;p&gt;The open question for infrastructure teams is not whether to care about use cases. It is how to learn from use cases without allowing every implementation to become a separate product.&lt;/p&gt;

&lt;p&gt;What signal tells you that an agent company is building a repeatable platform rather than a collection of custom deployments?&lt;/p&gt;

</description>
      <category>ai</category>
    </item>
    <item>
      <title>A Workflow Shouldn’t Fail Just Because One Field Is Missing</title>
      <dc:creator>ZGI | AI Agent Platform</dc:creator>
      <pubDate>Wed, 12 Aug 2026 00:58:35 +0000</pubDate>
      <link>https://dev.to/zgi_ai/a-workflow-shouldnt-fail-just-because-one-field-is-missing-4b6n</link>
      <guid>https://dev.to/zgi_ai/a-workflow-shouldnt-fail-just-because-one-field-is-missing-4b6n</guid>
      <description>&lt;p&gt;Production workflows rarely receive perfect inputs.&lt;br&gt;
A support request is ambiguous.&lt;br&gt;
An onboarding document is missing.&lt;br&gt;
A purchase request needs confirmation before the next action can run.&lt;br&gt;
The difficult part isn’t simply asking another question. It’s pausing the workflow safely, preserving its state, collecting the right information, and resuming from the correct step.&lt;br&gt;
We’ve introduced the Q&amp;amp;A Node in ZGI to make this interaction part of the workflow.&lt;br&gt;
When information is missing, a workflow can:&lt;br&gt;
→ Pause at the current step&lt;br&gt;
→ Ask the user a specific question&lt;br&gt;
→ Collect a direct answer or selection&lt;br&gt;
→ Extract required fields from the response&lt;br&gt;
→ Pass the result to downstream nodes&lt;br&gt;
→ Resume execution&lt;br&gt;
This gives developers a reusable way to handle incomplete or ambiguous inputs without building separate forms, follow-up scripts, and resume logic for every exception.&lt;br&gt;
It can be used for employee onboarding, IT service requests, procurement approvals, compliance reviews, document processing, and other workflows that require human input before continuing.&lt;br&gt;
The goal is straightforward: let workflows handle real-world inputs—not only ideal ones.&lt;br&gt;
The Q&amp;amp;A Node is now available in ZGI. We welcome developers and teams to try it and share feedback with us:&lt;br&gt;
&lt;a href="https://github.com/zgiai/zgi" rel="noopener noreferrer"&gt;https://github.com/zgiai/zgi&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
    </item>
    <item>
      <title>ZGI Is Being Built in the Open</title>
      <dc:creator>ZGI | AI Agent Platform</dc:creator>
      <pubDate>Mon, 10 Aug 2026 08:56:36 +0000</pubDate>
      <link>https://dev.to/zgi_ai/zgi-is-being-built-in-the-open-4g40</link>
      <guid>https://dev.to/zgi_ai/zgi-is-being-built-in-the-open-4g40</guid>
      <description>&lt;p&gt;ZGI is a self-hostable Agent Runtime built primarily with Go.&lt;/p&gt;

&lt;p&gt;It brings models, knowledge, tools, Skills, memory, and workflows into one workspace, with the goal of reducing repeated integration work when building agent applications.&lt;/p&gt;

&lt;p&gt;We are developing ZGI in the open because practical feedback is most useful when developers can inspect the project directly.&lt;/p&gt;

&lt;p&gt;The source code is available on GitHub, including the current architecture, implementation, documentation, and open issues.&lt;/p&gt;

&lt;p&gt;If you are building or exploring AI agent applications, you are welcome to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;review the project;&lt;/li&gt;
&lt;li&gt;share feedback;&lt;/li&gt;
&lt;li&gt;report a problem;&lt;/li&gt;
&lt;li&gt;suggest an improvement;&lt;/li&gt;
&lt;li&gt;open an issue;&lt;/li&gt;
&lt;li&gt;or contribute code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;ZGI is still evolving, and feedback from real development work helps us understand what the project should improve next.&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/zgiai/zgi" rel="noopener noreferrer"&gt;https://github.com/zgiai/zgi&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
    </item>
  </channel>
</rss>
