{"id":700,"date":"2026-01-28T09:05:14","date_gmt":"2026-01-28T09:05:14","guid":{"rendered":"https:\/\/datascientists.info\/?p=700"},"modified":"2026-01-28T09:05:14","modified_gmt":"2026-01-28T09:05:14","slug":"production-grade-genai-agent","status":"publish","type":"post","link":"https:\/\/datascientists.info\/index.php\/2026\/01\/28\/production-grade-genai-agent\/","title":{"rendered":"Designing Production-Grade GenAI Automation"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>A dbt Ops Agent Case Study<\/strong><\/h2>\n\n\n\n<p>A small, well-instrumented workflow can turn dbt failures into reviewable Git changes by combining deterministic parsing, constrained LLM tooling, and VCS-native delivery \u2014 while preserving governance through traces, guardrails, and CI. This is a blueprint to build a first Production-Grade GenAI Agent.<\/p>\n\n\n\n<p>You can find the complete implementation and reusable blueprint for this <a href=\"https:\/\/gitlab.com\/marc8435105\/data-ops-agent\" target=\"_blank\" rel=\"noreferrer noopener\">Production-Grade GenAI Agent on GitLab<\/a>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Executive Summary (Leadership + Technical TL;DR)<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>What you\u2019ll ship<\/strong><\/h3>\n\n\n\n<p>A production-ready CLI\/worker that monitors dbt execution environments to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Detect:<\/strong> Isolate the specific failing model and error signature from raw dbt.log artifacts.<\/li>\n\n\n\n<li><strong>Generate:<\/strong> Synthesize a structured fix proposal using <strong><a href=\"https:\/\/ai.pydantic.dev\/\">PydanticAI<\/a><\/strong> to enforce strict type safety and tool-calling reliability.<\/li>\n\n\n\n<li><strong>Test:<\/strong> Run <em>dbt compile<\/em> on the LLM generated fix<\/li>\n\n\n\n<li><strong>Deliver:<\/strong> Open a GitLab Merge Request (MR) containing the proposed patch, explanation, and trace links.<\/li>\n\n\n\n<li><strong>Audit:<\/strong> Emit end-to-end traces for every reasoning step, ensuring full accountability and a path for optimization.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Why it matters<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>MTTR Reduction:<\/strong> Eliminates the manual &#8220;context-switching tax&#8221; of locating files and opening boilerplate MRs.<\/li>\n\n\n\n<li><strong>Governance Preserved:<\/strong> AI acts as a &#8220;drafting assistant,&#8221; not a committer. Human review remains the final gate.<\/li>\n\n\n\n<li><strong>Operational Visibility:<\/strong> Transforms &#8220;black box&#8221; AI into a measurable pipeline with distinct success\/failure metrics.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>What makes it \u201cscalable GenAI\u201d<\/strong><\/h3>\n\n\n\n<p>This system moves beyond simple chat interfaces. It utilizes <strong>PydanticAI\u2019s<\/strong> structured result types, <strong>dependency injection<\/strong> for unit-testable context, and <strong>deterministic workflow graphs<\/strong> to ensure reliability at an enterprise level.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Problem Framing: dbt Failures Are an Ops Workflow<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>The reality in mature data orgs<\/strong><\/h3>\n\n\n\n<p>In high-volume data platforms, dbt runs fail frequently due to upstream schema changes or minor logic drifts. The &#8220;fix&#8221; is often trivial, but the <strong>workflow glue<\/strong> is expensive. Engineers spend 80% of their time identifying the failing file, checking out a branch, and navigating the repository structure rather than solving the logic.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>What we should automate (and what we should not)<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Automate:<\/strong> Error detection, context gathering (fetching relevant .sql and .yml files), patch packaging, and MR creation.<\/li>\n\n\n\n<li><strong>Do Not Automate:<\/strong> Silent pushes to production, sweeping architectural refactors, or changes to sensitive financial logic without human oversight.<\/li>\n<\/ul>\n\n\n\n<p><em>\u201cWe\u2019re not automating decisions; we\u2019re automating the path to a decision.\u201d<\/em><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>System Overview (Architecture + Responsibilities)<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"225\" src=\"https:\/\/datascientists.info\/wp-content\/uploads\/2026\/01\/image-1024x225.png\" alt=\"Production-Grade GenAI Agent\" class=\"wp-image-701\" srcset=\"https:\/\/datascientists.info\/wp-content\/uploads\/2026\/01\/image-1024x225.png 1024w, https:\/\/datascientists.info\/wp-content\/uploads\/2026\/01\/image-300x66.png 300w, https:\/\/datascientists.info\/wp-content\/uploads\/2026\/01\/image-768x169.png 768w, https:\/\/datascientists.info\/wp-content\/uploads\/2026\/01\/image-1536x338.png 1536w, https:\/\/datascientists.info\/wp-content\/uploads\/2026\/01\/image.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Components and boundaries<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Parser:<\/strong> A deterministic Python module that regex-extracts the failing model name and error snippet.<\/li>\n\n\n\n<li><strong>Agent (PydanticAI):<\/strong> A typed agent that takes the error context and returns a validated FixProposal object.<\/li>\n\n\n\n<li><strong>VCS Delivery:<\/strong> A wrapper for the GitLab API to handle branch creation and MR documentation.<\/li>\n\n\n\n<li><strong>Observability:<\/strong> A tracing layer to record every LLM input and output for auditability.<\/li>\n<\/ul>\n\n\n\n<p><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Designing for Resiliency with Workflow Graphsy<\/strong><\/p>\n\n\n\n<p>In simple scripts, a failure at any step (like a network timeout or a hallucinated SQL syntax) kills the process. For a production ops agent, we use a <strong>Workflow Graph<\/strong> approach. This allows us to handle non-linear logic\u2014specifically the &#8220;Retry Loop&#8221; when an AI-generated fix fails to compile.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Why this architecture works:<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Early Exit:<\/strong> If parse_log returns ok, the system terminates immediately at no_error, saving compute and LLM tokens.<\/li>\n\n\n\n<li><strong>The Validation Loop:<\/strong> By connecting dbt_compile back to generate_fix with a retry edge, we give the agent a second chance. We can pass the compiler error <em>back<\/em> to the LLM as feedback, allowing it to self-correct before a human ever sees the code.<\/li>\n\n\n\n<li><strong>State Management:<\/strong> Each node in this graph only needs to know about the data passed from the previous node, making the system modular and significantly easier to unit test.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Core Design Pattern: \u201cConstrain + Structure + Trace\u201d<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Constrain: Reduce the agent\u2019s degrees of freedom<\/strong><\/h3>\n\n\n\n<p>Do not give the agent a &#8220;search the whole repo&#8221; tool. Feed it only the specific failing .sql file and its immediate sources.yml. This prevents the agent from getting &#8220;lost&#8221; in large monorepos and reduces token costs.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Structure: PydanticAI Result Types<\/strong><\/h3>\n\n\n\n<p>Instead of parsing raw JSON strings from an LLM, we use PydanticAI\u2019s result_type. This ensures that the agent <em>cannot<\/em> return a response unless it fits our strict operational schema.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n@dataclass(frozen=True)\nclass FixDeps:\n    config: Config\n    model_path: str \n\n    @property\n    def dbt_base_path(self) -&gt; Path:\n        return Path(self.config.dbt_base_path)\n\n    @property\n    def model_full_path(self) -&gt; Path:\n        return self.dbt_base_path \/ self.model_path\n\n    @property\n    def sources_full_path(self) -&gt; Path:\n        # Note: In a real monorepo, you might resolve this dynamically\n        return self.dbt_base_path \/ &quot;models\/data_project\/sources.yml&quot;\n<\/pre><\/div><\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step-by-Step Deep Dive<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 1 \u2014 Parsing the dbt log: Deterministic and reliable<\/strong><\/h3>\n\n\n\n<p>LLMs are overkill for log parsing. Use a deterministic parser to identify the ERROR block. This ensures 100% reliability in identifying the target model.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>pattern = r&#8221;[error].<em>?ERROR creating.<\/em>?model ([^\\s]+)&#8221;<br>match = re.search(pattern, content, re.DOTALL | re.IGNORECASE)<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 2 \u2014 Context assembly: The \u201cminimum viable evidence\u201d<\/strong><\/h3>\n\n\n\n<p>Provide the &#8220;Triple Threat&#8221; of context: The Error, the current Model SQL, and the Source Schema. Using PydanticAI <strong>Dependencies<\/strong>, we can inject these files into the agent&#8217;s context at runtime.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 3 \u2014 Fix generation: The PydanticAI Agent<\/strong><\/h3>\n\n\n\n<p>The agent\u2019s job is not to \u201ctalk\u201d; it\u2019s to produce a structured patch proposal.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfix_agent = Agent(\n   model=&quot;openai:gpt-4&quot;,\n   output_type=DbtFix,\n   deps_type=FixDeps,\n   instructions=system_prompt,\n)\n\n@fix_agent.tool\n@observe(name=&quot;tool.read_model_file&quot;)\nasync def read_model_file(ctx: RunContext&#x5B;FixDeps]) -&gt; str:\n   &quot;&quot;&quot;Reads the dbt model currently being analyzed.&quot;&quot;&quot;\n   return ctx.deps.model_full_path.read_text(encoding=&quot;utf-8&quot;)\n\n@fix_agent.tool\n@observe(name=&quot;tool.read_source_definitions&quot;)\nasync def read_source_definitions(ctx: RunContext&#x5B;FixDeps]) -&gt; str:\n   &quot;&quot;&quot;Reads the project&#039;s sources.yml to verify available source columns.&quot;&quot;&quot;\n   return ctx.deps.sources_full_path.read_text(encoding=&quot;utf-8&quot;)\n<\/pre><\/div><\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 4 \u2014 Validation: The agent as a tester<\/strong><\/h3>\n\n\n\n<p>Before the MR is even opened, run dbt compile &#8211;select &lt;model&gt;. If the AI&#8217;s &#8220;fix&#8221; doesn&#8217;t even compile, don&#8217;t waste a human&#8217;s time\u2014 the agent then retries to generate the fix, giving the new error message as additional information.<\/p>\n\n\n\n<p><strong>Pro Tip:<\/strong> When dbt compile fails, capture the stderr. Feed that specific error message back into the PydanticAI agent&#8217;s next prompt. This &#8220;Reflection&#8221; pattern often turns a 70% success rate into 95%+.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ndbt_project_dir = Path(self.config.dbt_base_path).resolve()\nmodel_path = fix.model_path\nmodel_full_path = (dbt_project_dir \/ model_path).resolve()\n\n# Write the fixed SQL into the local workspace so compile validates what we will ship\nmodel_full_path.parent.mkdir(parents=True, exist_ok=True)\nmodel_full_path.write_text(fix.fixed_sql.rstrip() + &quot;\\n&quot;, encoding=&quot;utf-8&quot;)\n# Run dbt compile (use cwd to ensure dbt_project.yml is found)\ncmd = &#x5B;\n   &quot;dbt&quot;,\n   &quot;compile&quot;,\n   &quot;--project-dir&quot;,\n   str(dbt_project_dir),\n   &quot;--profiles-dir&quot;,\n   str(dbt_project_dir),\n   &quot;--select&quot;,\n   f&quot;path:{model_path}&quot;,\n]\n<\/pre><\/div><\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 5 \u2014 Delivery via GitLab MR: The agent as a teammate<\/strong><\/h3>\n\n\n\n<p>Assign the MR to the data engineer responsible for that domain. Use a clear naming convention: fix\/ai-proposal-fct-orders-170605.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nmodel_slug = fix.model_path.split(&quot;\/&quot;)&#x5B;-1].replace(&quot;.sql&quot;, &quot;&quot;)\nrun_suffix = time.strftime(&quot;%Y%m%d-%H%M%S&quot;)\nbranch_name = f&quot;fix\/{model_slug}\/{run_suffix}&quot;\n\n# Base the branch on the latest main SHA on the server.\nmain_branch = project.branches.get(&quot;main&quot;)\nmain_sha = main_branch.commit&#x5B;&quot;id&quot;]\n\ntry:\n   project.branches.create({&quot;branch&quot;: branch_name, &quot;ref&quot;: main_sha})\nexcept gitlab.exceptions.GitlabCreateError as e:\n   msg = str(e).lower()\n   if e.response_code in (400, 409) and (&quot;already exists&quot; in msg or &quot;branch&quot; in msg):\n       print(f&quot;Branch {branch_name} already exists, using existing branch.&quot;)\n       project.branches.get(branch_name)\n   else:\n       raise\n<\/pre><\/div><\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Operational Visibility: Peeking Under the Hood<\/strong><\/h2>\n\n\n\n<p>While the workflow graph provides the structure, <a href=\"https:\/\/langfuse.com\/\">Langfuse<\/a> provides the &#8220;black box&#8221; recording of what actually happens inside the LLM\u2019s reasoning steps. This is the difference between a script that &#8220;just runs&#8221; and a system that can be audited for production use.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>The Trace View: Tracking the Thought Loop<\/strong><\/h3>\n\n\n\n<p>By instrumenting the agent with the @observe() decorator, we capture every turn of the conversation. This is especially critical during the Step 4 Validation Loop.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Auditability: If a generated fix fails, we can see the exact stderr from dbt and how the agent parsed it to attempt a second fix.<\/li>\n\n\n\n<li>Prompt Iteration: We can compare different versions of the system_prompt to see which one produces the most syntactically correct SQL.<\/li>\n<\/ul>\n\n\n\n<p><strong>Cost and Latency: Managing the &#8220;GenAI Tax&#8221;<\/strong><\/p>\n\n\n\n<p>Production-grade systems require predictable costs. Langfuse allows us to monitor token usage in real-time.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"57\" src=\"https:\/\/datascientists.info\/wp-content\/uploads\/2026\/01\/Bildschirmfoto-vom-2026-01-25-10-14-43-1024x57.png\" alt=\"Production-Grade GenAI Agent\" class=\"wp-image-705\" srcset=\"https:\/\/datascientists.info\/wp-content\/uploads\/2026\/01\/Bildschirmfoto-vom-2026-01-25-10-14-43-1024x57.png 1024w, https:\/\/datascientists.info\/wp-content\/uploads\/2026\/01\/Bildschirmfoto-vom-2026-01-25-10-14-43-300x17.png 300w, https:\/\/datascientists.info\/wp-content\/uploads\/2026\/01\/Bildschirmfoto-vom-2026-01-25-10-14-43-768x43.png 768w, https:\/\/datascientists.info\/wp-content\/uploads\/2026\/01\/Bildschirmfoto-vom-2026-01-25-10-14-43-1536x86.png 1536w, https:\/\/datascientists.info\/wp-content\/uploads\/2026\/01\/Bildschirmfoto-vom-2026-01-25-10-14-43-2048x114.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Constraint Efficacy<\/strong>: By following our &#8220;Minimum Viable Evidence&#8221; pattern, we can verify that the agent is staying within a tight token budget (typically &lt; 2k tokens per run).<\/li>\n\n\n\n<li><strong>Latency Bottlenecks<\/strong>: We can identify if specific tools\u2014like read_source_definitions\u2014are adding unnecessary delay to the MTTR.<\/li>\n<\/ul>\n\n\n\n<p><strong>The &#8220;Merge&#8221; Metric: Building the Golden Dataset<\/strong><\/p>\n\n\n\n<p>The ultimate goal is a high Merge Rate. We use Langfuse scores to track whether the human data engineer actually accepted the AI\u2019s proposal.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Feedback Loop<\/strong>: When an MR is merged, a GitLab webhook sends a score=1 to the specific Langfuse trace.<\/li>\n\n\n\n<li><strong>Data Mining<\/strong>: Over time, these &#8220;thumbs up&#8221; traces become our Golden Dataset\u2014a collection of verified dbt errors and their correct AI-generated fixes, perfect for future fine-tuning or regression testing.<\/li>\n<\/ul>\n\n\n\n<p><strong>Implementation Note:<\/strong><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nfrom langfuse.decorators import observe\n\n@observe()\nasync def dbt_ops_worker(error_log: str):\n    # This single decorator captures all nested tool calls\n    # and PydanticAI structured outputs automatically.\n\n<\/pre><\/div><\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Production Hardening: Turning a Helpful Agent into a Safe System<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Guardrails (non-negotiable)<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Repository Scope:<\/strong> The agent can only touch models\/\u2014it should never have access to profiles.yml or CI secrets.<\/li>\n\n\n\n<li><strong>File Type Allowlist:<\/strong> Only .sql files.<\/li>\n\n\n\n<li><strong>Branch Protections:<\/strong> Never push to main or master.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Evaluation: Proving It Works<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Metric<\/strong><\/td><td><strong>Target<\/strong><\/td><td><strong>Purpose<\/strong><\/td><\/tr><tr><td><strong>MTTR Reduction<\/strong><\/td><td>&gt; 40%<\/td><td>Measure speed gains.<\/td><\/tr><tr><td><strong>Merge Rate<\/strong><\/td><td>&gt; 70%<\/td><td>Measure fix quality.<\/td><\/tr><tr><td><strong>Compilation Pass Rate<\/strong><\/td><td>&gt; 90%<\/td><td>Measure syntax accuracy.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Extending the System to \u201cLarger Scale\u201d<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Agent Routing:<\/strong> As you scale, use a &#8220;Classifier&#8221; to determine if the error is a Missing Column, a Schema Drift, or a Syntax Error, routing to specialized prompts for each.<\/li>\n\n\n\n<li><strong>Shadow Mode:<\/strong> Run the agent in the background for a month, generating fixes but not opening MRs, to build a &#8220;Golden Dataset&#8221; for evaluation.<br>By versioning your agent&#8217;s traces alongside the actual human-corrected SQL that eventually merged, you create a fine-tuning dataset that can eventually be used to train a smaller, faster model (like GPT-4o-mini, Claude Haiku or an on-premise model) to perform the same task at a fraction of the cost.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n","protected":false},"excerpt":{"rendered":"<p>A dbt Ops Agent Case Study A small, well-instrumented workflow can turn dbt failures into reviewable Git changes by combining deterministic parsing, constrained LLM tooling, and VCS-native delivery \u2014 while preserving governance through traces, guardrails, and CI. This is a blueprint to build a first Production-Grade GenAI Agent. You can find the complete implementation and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[137,7],"tags":[149,136,148,147],"ppma_author":[144,145],"class_list":["post-700","post","type-post","status-publish","format-standard","hentry","category-generative-ai","category-machine-learning","tag-agentic-ai","tag-genai","tag-llm","tag-pydanticai","author-marc","author-saidah"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Designing Production-Grade GenAI Automation - DATA DO - \u30c7\u30fc\u30bf \u9053<\/title>\n<meta name=\"description\" content=\"Learn to build a Production-Grade GenAI Agent for dbt. Use PydanticAI and Langfuse to automate error recovery and data ops while maintaining human-in-the-loop governance.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/datascientists.info\/index.php\/2026\/01\/28\/production-grade-genai-agent\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Designing Production-Grade GenAI Automation - DATA DO - \u30c7\u30fc\u30bf \u9053\" \/>\n<meta property=\"og:description\" content=\"Learn to build a Production-Grade GenAI Agent for dbt. Use PydanticAI and Langfuse to automate error recovery and data ops while maintaining human-in-the-loop governance.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/datascientists.info\/index.php\/2026\/01\/28\/production-grade-genai-agent\/\" \/>\n<meta property=\"og:site_name\" content=\"DATA DO - \u30c7\u30fc\u30bf \u9053\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataScientists\/\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-28T09:05:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/datascientists.info\/wp-content\/uploads\/2026\/01\/image-1024x225.png\" \/>\n<meta name=\"author\" content=\"Marc Matt, Saidah Kafka\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Marc Matt\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/datascientists.info\\\/index.php\\\/2026\\\/01\\\/28\\\/production-grade-genai-agent\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/datascientists.info\\\/index.php\\\/2026\\\/01\\\/28\\\/production-grade-genai-agent\\\/\"},\"author\":{\"name\":\"Marc Matt\",\"@id\":\"https:\\\/\\\/datascientists.info\\\/#\\\/schema\\\/person\\\/723078870bf3135121086d46ebb12f19\"},\"headline\":\"Designing Production-Grade GenAI Automation\",\"datePublished\":\"2026-01-28T09:05:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/datascientists.info\\\/index.php\\\/2026\\\/01\\\/28\\\/production-grade-genai-agent\\\/\"},\"wordCount\":1350,\"publisher\":{\"@id\":\"https:\\\/\\\/datascientists.info\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/datascientists.info\\\/index.php\\\/2026\\\/01\\\/28\\\/production-grade-genai-agent\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/datascientists.info\\\/wp-content\\\/uploads\\\/2026\\\/01\\\/image-1024x225.png\",\"keywords\":[\"Agentic AI\",\"GenAI\",\"LLM\",\"PydanticAI\"],\"articleSection\":[\"Generative AI\",\"Machine Learning\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/datascientists.info\\\/index.php\\\/2026\\\/01\\\/28\\\/production-grade-genai-agent\\\/\",\"url\":\"https:\\\/\\\/datascientists.info\\\/index.php\\\/2026\\\/01\\\/28\\\/production-grade-genai-agent\\\/\",\"name\":\"Designing Production-Grade GenAI Automation - DATA DO - \u30c7\u30fc\u30bf \u9053\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/datascientists.info\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/datascientists.info\\\/index.php\\\/2026\\\/01\\\/28\\\/production-grade-genai-agent\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/datascientists.info\\\/index.php\\\/2026\\\/01\\\/28\\\/production-grade-genai-agent\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/datascientists.info\\\/wp-content\\\/uploads\\\/2026\\\/01\\\/image-1024x225.png\",\"datePublished\":\"2026-01-28T09:05:14+00:00\",\"description\":\"Learn to build a Production-Grade GenAI Agent for dbt. Use PydanticAI and Langfuse to automate error recovery and data ops while maintaining human-in-the-loop governance.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/datascientists.info\\\/index.php\\\/2026\\\/01\\\/28\\\/production-grade-genai-agent\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/datascientists.info\\\/index.php\\\/2026\\\/01\\\/28\\\/production-grade-genai-agent\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/datascientists.info\\\/index.php\\\/2026\\\/01\\\/28\\\/production-grade-genai-agent\\\/#primaryimage\",\"url\":\"https:\\\/\\\/datascientists.info\\\/wp-content\\\/uploads\\\/2026\\\/01\\\/image.png\",\"contentUrl\":\"https:\\\/\\\/datascientists.info\\\/wp-content\\\/uploads\\\/2026\\\/01\\\/image.png\",\"width\":2048,\"height\":450},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/datascientists.info\\\/index.php\\\/2026\\\/01\\\/28\\\/production-grade-genai-agent\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/datascientists.info\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Designing Production-Grade GenAI Automation\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/datascientists.info\\\/#website\",\"url\":\"https:\\\/\\\/datascientists.info\\\/\",\"name\":\"Data Scientists\",\"description\":\"Digging data, Big Data, Analysis, Data Mining\",\"publisher\":{\"@id\":\"https:\\\/\\\/datascientists.info\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/datascientists.info\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/datascientists.info\\\/#organization\",\"name\":\"DATA DO - \u30c7\u30fc\u30bf \u9053\",\"url\":\"https:\\\/\\\/datascientists.info\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/datascientists.info\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/datascientists.info\\\/wp-content\\\/uploads\\\/2026\\\/02\\\/Bildschirmfoto-vom-2026-02-02-08-13-21.png\",\"contentUrl\":\"https:\\\/\\\/datascientists.info\\\/wp-content\\\/uploads\\\/2026\\\/02\\\/Bildschirmfoto-vom-2026-02-02-08-13-21.png\",\"width\":250,\"height\":174,\"caption\":\"DATA DO - \u30c7\u30fc\u30bf \u9053\"},\"image\":{\"@id\":\"https:\\\/\\\/datascientists.info\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/DataScientists\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/datascientists.info\\\/#\\\/schema\\\/person\\\/723078870bf3135121086d46ebb12f19\",\"name\":\"Marc Matt\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/74f48ef754cf04f628f42ed117a3f2b42931feeb41a3cca2313b9714a7d4fdd2?s=96&d=mm&r=g53b84b5f47a2156ba8b047d71d6d05fc\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/74f48ef754cf04f628f42ed117a3f2b42931feeb41a3cca2313b9714a7d4fdd2?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/74f48ef754cf04f628f42ed117a3f2b42931feeb41a3cca2313b9714a7d4fdd2?s=96&d=mm&r=g\",\"caption\":\"Marc Matt\"},\"description\":\"Senior Data Architect with 15+ years of experience helping Hamburg's leading enterprises modernize their data infrastructure. I bridge the gap between legacy systems (SAP, Hadoop) and modern AI capabilities. I help clients: Migrate &amp; Modernize: Transitioning on-premise data warehouses to Google Cloud\\\/AWS to reduce costs and increase agility. Implement GenAI: Building secure RAG (Retrieval-Augmented Generation) pipelines to unlock value from internal knowledge bases using LangChain and Vector DBs. Scale MLOps: Operationalizing machine learning models from PoC to production with Kubernetes and Airflow. Proven track record leading engineering teams.\",\"sameAs\":[\"https:\\\/\\\/data-do.de\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Designing Production-Grade GenAI Automation - DATA DO - \u30c7\u30fc\u30bf \u9053","description":"Learn to build a Production-Grade GenAI Agent for dbt. Use PydanticAI and Langfuse to automate error recovery and data ops while maintaining human-in-the-loop governance.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/datascientists.info\/index.php\/2026\/01\/28\/production-grade-genai-agent\/","og_locale":"en_US","og_type":"article","og_title":"Designing Production-Grade GenAI Automation - DATA DO - \u30c7\u30fc\u30bf \u9053","og_description":"Learn to build a Production-Grade GenAI Agent for dbt. Use PydanticAI and Langfuse to automate error recovery and data ops while maintaining human-in-the-loop governance.","og_url":"https:\/\/datascientists.info\/index.php\/2026\/01\/28\/production-grade-genai-agent\/","og_site_name":"DATA DO - \u30c7\u30fc\u30bf \u9053","article_publisher":"https:\/\/www.facebook.com\/DataScientists\/","article_published_time":"2026-01-28T09:05:14+00:00","og_image":[{"url":"https:\/\/datascientists.info\/wp-content\/uploads\/2026\/01\/image-1024x225.png","type":"","width":"","height":""}],"author":"Marc Matt, Saidah Kafka","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Marc Matt","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/datascientists.info\/index.php\/2026\/01\/28\/production-grade-genai-agent\/#article","isPartOf":{"@id":"https:\/\/datascientists.info\/index.php\/2026\/01\/28\/production-grade-genai-agent\/"},"author":{"name":"Marc Matt","@id":"https:\/\/datascientists.info\/#\/schema\/person\/723078870bf3135121086d46ebb12f19"},"headline":"Designing Production-Grade GenAI Automation","datePublished":"2026-01-28T09:05:14+00:00","mainEntityOfPage":{"@id":"https:\/\/datascientists.info\/index.php\/2026\/01\/28\/production-grade-genai-agent\/"},"wordCount":1350,"publisher":{"@id":"https:\/\/datascientists.info\/#organization"},"image":{"@id":"https:\/\/datascientists.info\/index.php\/2026\/01\/28\/production-grade-genai-agent\/#primaryimage"},"thumbnailUrl":"https:\/\/datascientists.info\/wp-content\/uploads\/2026\/01\/image-1024x225.png","keywords":["Agentic AI","GenAI","LLM","PydanticAI"],"articleSection":["Generative AI","Machine Learning"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/datascientists.info\/index.php\/2026\/01\/28\/production-grade-genai-agent\/","url":"https:\/\/datascientists.info\/index.php\/2026\/01\/28\/production-grade-genai-agent\/","name":"Designing Production-Grade GenAI Automation - DATA DO - \u30c7\u30fc\u30bf \u9053","isPartOf":{"@id":"https:\/\/datascientists.info\/#website"},"primaryImageOfPage":{"@id":"https:\/\/datascientists.info\/index.php\/2026\/01\/28\/production-grade-genai-agent\/#primaryimage"},"image":{"@id":"https:\/\/datascientists.info\/index.php\/2026\/01\/28\/production-grade-genai-agent\/#primaryimage"},"thumbnailUrl":"https:\/\/datascientists.info\/wp-content\/uploads\/2026\/01\/image-1024x225.png","datePublished":"2026-01-28T09:05:14+00:00","description":"Learn to build a Production-Grade GenAI Agent for dbt. Use PydanticAI and Langfuse to automate error recovery and data ops while maintaining human-in-the-loop governance.","breadcrumb":{"@id":"https:\/\/datascientists.info\/index.php\/2026\/01\/28\/production-grade-genai-agent\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/datascientists.info\/index.php\/2026\/01\/28\/production-grade-genai-agent\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/datascientists.info\/index.php\/2026\/01\/28\/production-grade-genai-agent\/#primaryimage","url":"https:\/\/datascientists.info\/wp-content\/uploads\/2026\/01\/image.png","contentUrl":"https:\/\/datascientists.info\/wp-content\/uploads\/2026\/01\/image.png","width":2048,"height":450},{"@type":"BreadcrumbList","@id":"https:\/\/datascientists.info\/index.php\/2026\/01\/28\/production-grade-genai-agent\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/datascientists.info\/"},{"@type":"ListItem","position":2,"name":"Designing Production-Grade GenAI Automation"}]},{"@type":"WebSite","@id":"https:\/\/datascientists.info\/#website","url":"https:\/\/datascientists.info\/","name":"Data Scientists","description":"Digging data, Big Data, Analysis, Data Mining","publisher":{"@id":"https:\/\/datascientists.info\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/datascientists.info\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/datascientists.info\/#organization","name":"DATA DO - \u30c7\u30fc\u30bf \u9053","url":"https:\/\/datascientists.info\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/datascientists.info\/#\/schema\/logo\/image\/","url":"https:\/\/datascientists.info\/wp-content\/uploads\/2026\/02\/Bildschirmfoto-vom-2026-02-02-08-13-21.png","contentUrl":"https:\/\/datascientists.info\/wp-content\/uploads\/2026\/02\/Bildschirmfoto-vom-2026-02-02-08-13-21.png","width":250,"height":174,"caption":"DATA DO - \u30c7\u30fc\u30bf \u9053"},"image":{"@id":"https:\/\/datascientists.info\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataScientists\/"]},{"@type":"Person","@id":"https:\/\/datascientists.info\/#\/schema\/person\/723078870bf3135121086d46ebb12f19","name":"Marc Matt","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/74f48ef754cf04f628f42ed117a3f2b42931feeb41a3cca2313b9714a7d4fdd2?s=96&d=mm&r=g53b84b5f47a2156ba8b047d71d6d05fc","url":"https:\/\/secure.gravatar.com\/avatar\/74f48ef754cf04f628f42ed117a3f2b42931feeb41a3cca2313b9714a7d4fdd2?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/74f48ef754cf04f628f42ed117a3f2b42931feeb41a3cca2313b9714a7d4fdd2?s=96&d=mm&r=g","caption":"Marc Matt"},"description":"Senior Data Architect with 15+ years of experience helping Hamburg's leading enterprises modernize their data infrastructure. I bridge the gap between legacy systems (SAP, Hadoop) and modern AI capabilities. I help clients: Migrate &amp; Modernize: Transitioning on-premise data warehouses to Google Cloud\/AWS to reduce costs and increase agility. Implement GenAI: Building secure RAG (Retrieval-Augmented Generation) pipelines to unlock value from internal knowledge bases using LangChain and Vector DBs. Scale MLOps: Operationalizing machine learning models from PoC to production with Kubernetes and Airflow. Proven track record leading engineering teams.","sameAs":["https:\/\/data-do.de"]}]}},"authors":[{"term_id":144,"user_id":1,"is_guest":0,"slug":"marc","display_name":"Marc Matt","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/74f48ef754cf04f628f42ed117a3f2b42931feeb41a3cca2313b9714a7d4fdd2?s=96&d=mm&r=g","0":null,"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""},{"term_id":145,"user_id":2,"is_guest":0,"slug":"saidah","display_name":"Saidah Kafka","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/015737c94dd80772d772f2b24a55e96c868068f28684c8577d9492f3313e4dd3?s=96&d=mm&r=g","0":null,"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/datascientists.info\/index.php\/wp-json\/wp\/v2\/posts\/700","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/datascientists.info\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/datascientists.info\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/datascientists.info\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/datascientists.info\/index.php\/wp-json\/wp\/v2\/comments?post=700"}],"version-history":[{"count":5,"href":"https:\/\/datascientists.info\/index.php\/wp-json\/wp\/v2\/posts\/700\/revisions"}],"predecessor-version":[{"id":712,"href":"https:\/\/datascientists.info\/index.php\/wp-json\/wp\/v2\/posts\/700\/revisions\/712"}],"wp:attachment":[{"href":"https:\/\/datascientists.info\/index.php\/wp-json\/wp\/v2\/media?parent=700"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/datascientists.info\/index.php\/wp-json\/wp\/v2\/categories?post=700"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/datascientists.info\/index.php\/wp-json\/wp\/v2\/tags?post=700"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/datascientists.info\/index.php\/wp-json\/wp\/v2\/ppma_author?post=700"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}