{
  "source_file": "0930",
  "source_platform": "Ghost",
  "author": "Avi Chawla / Daily Dose of Data Science",
  "title_listed": "Building Trustworthy Agentic RAG Workflows",
  "keywords": "",
  "domain": "大模型算法",
  "content_type": "深度技术解析",
  "is_paid_flag": "否",
  "url": "https://www.dailydoseofds.com/p/building-trustworthy-agentic-rag-workflows/",
  "publish_date": "2026-05-31",
  "corpus_stage": "",
  "notes": "",
  "id": "034dc2221bcc",
  "collected_at": "2026-10-02T13:47:24",
  "title": "Building Trustworthy Agentic/RAG Workflows",
  "body_markdown": "Aug 2, 2025\nBuilding Trustworthy Agentic/RAG Workflows\n...explained step-by-step with code.\nAvi Chawla\n👉\n​\nIt is common for RAG systems to produce inaccurate/unhelpful responses.\nToday, let’s look at how we can improve this using\n​\nCleanlab Codex\n​\n, which is commonly used in production systems to automatically detect and resolve RAG inaccuracies.\nTech stack:\nLlamaIndex for orchestration\n​\nMilvus\n​\nas the self-hosted vectorDB\n​\nCleanlab Codex\n​\nto validate the response\nOpenRouterAI to access the latest Qwen3 C\nHere's the workflow:\nLLM processes the query to select a tool\nConverts the query into the right format (text/SQL)\nExecutes the tool and fetch the output\nGenerates a response with enriched context\nValidates the response using Cleanlab's Codex\nThe video below depicts this entire system in action:\n0:00\n/\n1:07\n1×\nNow, let's see the code!\nSet up LLM\nWe'll use the latest Qwen3, served via OpenRouter.\nEnsure the LLM supports tool calling for seamless execution.\nSet up SQL Query engine\nA Natural Language to SQL Engine turns plain queries into SQL commands, enabling easy data interaction.\nSet up RAG Query engine\nConvert PDF, DOCX, or any document to Markdown for Vector Storage with Docling.\nQuery Engine fetches context from Milvus, combines it with the query, and sends it to LLM for a response.\nSet up tools\nNow, it's time to set up and use both the query engines we defined above as tools. Our Agent will then smartly route the query to it's right tools.\nCleanlab Codex Validation\nNext, we integrate Cleanlab Codex to evaluate and monitor the RAG app in just a few lines of code:\nCreate an Agentic workflow\nWith everything set up, let's create our agentic routing workflow.\nKick off the workflow\nWith everything set, it's time to activate our workflow.\nWe begin by equipping LLM with two tools: Document & Text-to-SQL Query.\nAfter that, we invoke the workflow:\nStreamlit UI\nTo enhance user-friendliness, we present everything within a clean and interactive Streamlit UI.\nUpon prompting, notice that the app displays a Trust Score on the generated response.\nThis is incredibly important for RAG/Agentic workflows that are quite susceptible to inaccuracies and hallucinations.\nAlong with this, we also get specific evaluation metrics along with detailed insights and reasoning for each test run:\n​\nHere’s the Codex documentation →\n​\n​\nAnd you can find the code for today’s issue in this GitHub repo →\nThanks for reading!\nPublished on Aug 2, 2025\nComments\nShare\nCopy link\nShare to X\nShare to Facebook\nShare to Linkedin\nCopied\nPrevious\nBackground and Foundations for ML in Production\nNext\nThe Machine Learning System Lifecycle",
  "metadata": {
    "title": "Building Trustworthy Agentic/RAG Workflows",
    "description": "...explained step-by-step with code.",
    "keywords": null,
    "author": null,
    "og:site_name": "Daily Dose of Data Science",
    "og:type": "article",
    "og:title": "Building Trustworthy Agentic/RAG Workflows",
    "og:description": "...explained step-by-step with code.",
    "og:url": "https://www.dailydoseofds.com/p/building-trustworthy-agentic-rag-workflows/",
    "og:image": "https://storage.ghost.io/c/3f/df/3fdf6ed2-17ac-4b12-a693-8078bd13e748/content/images/2025/10/9e2fe84f-67cb-4d56-8346-5f5c21b3e776_800x692.gif",
    "og:image:width": "800",
    "og:image:height": "692",
    "twitter:card": "summary_large_image",
    "twitter:title": "Building Trustworthy Agentic/RAG Workflows",
    "twitter:description": "...explained step-by-step with code.",
    "twitter:url": "https://www.dailydoseofds.com/p/building-trustworthy-agentic-rag-workflows/",
    "twitter:image": "https://storage.ghost.io/c/3f/df/3fdf6ed2-17ac-4b12-a693-8078bd13e748/content/images/2025/10/9e2fe84f-67cb-4d56-8346-5f5c21b3e776_800x692.gif",
    "twitter:label1": "Written by",
    "twitter:data1": "Avi Chawla",
    "twitter:label2": "Filed under",
    "twitter:site": "@_avichawla",
    "article:published_time": "2025-08-02T10:07:00.000Z",
    "article:modified_time": "2026-05-31T11:40:33.000Z"
  },
  "paywall": {
    "listed_paid": false,
    "detected": false,
    "marker": "",
    "public_only": false,
    "policy": "付费/会员内容只保留页面公开可见部分，不绕过付费墙"
  },
  "crawl": {
    "success": true,
    "status_code": 200,
    "error": ""
  },
  "code_blocks": [],
  "images": [
    {
      "status": "ok",
      "url": "https://storage.ghost.io/c/3f/df/3fdf6ed2-17ac-4b12-a693-8078bd13e748/content/images/size/w400/2026/03/avi-google.jpg",
      "bytes": 11344,
      "reused": true,
      "local_path": "attachments/034dc2221bcc/images/000.jpg",
      "src": "https://storage.ghost.io/c/3f/df/3fdf6ed2-17ac-4b12-a693-8078bd13e748/content/images/size/w400/2026/03/avi-google.jpg",
      "alt": "Avi Chawla",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://storage.ghost.io/c/3f/df/3fdf6ed2-17ac-4b12-a693-8078bd13e748/content/images/2026/01/https-3a-2f-2fsubstack-post-media-s3-amazonaws-com-2fpublic-2fimages-2f9e2fe84f-67cb-4d56-8346-5f5c21b3e776_800x692.gif",
      "bytes": 409422,
      "reused": true,
      "local_path": "attachments/034dc2221bcc/images/001.gif",
      "src": "https://storage.ghost.io/c/3f/df/3fdf6ed2-17ac-4b12-a693-8078bd13e748/content/images/2026/01/https-3a-2f-2fsubstack-post-media-s3-amazonaws-com-2fpublic-2fimages-2f9e2fe84f-67cb-4d56-8346-5f5c21b3e776_800x692.gif",
      "alt": "",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://storage.ghost.io/c/3f/df/3fdf6ed2-17ac-4b12-a693-8078bd13e748/content/images/2026/01/https-3a-2f-2fsubstack-post-media-s3-amazonaws-com-2fpublic-2fimages-2f17e68c1e-2c33-48ee-8dca-d93c36dd209c_680x405.png",
      "bytes": 53664,
      "reused": true,
      "local_path": "attachments/034dc2221bcc/images/003.png",
      "src": "https://storage.ghost.io/c/3f/df/3fdf6ed2-17ac-4b12-a693-8078bd13e748/content/images/2026/01/https-3a-2f-2fsubstack-post-media-s3-amazonaws-com-2fpublic-2fimages-2f17e68c1e-2c33-48ee-8dca-d93c36dd209c_680x405.png",
      "alt": "",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://storage.ghost.io/c/3f/df/3fdf6ed2-17ac-4b12-a693-8078bd13e748/content/images/2026/01/https-3a-2f-2fsubstack-post-media-s3-amazonaws-com-2fpublic-2fimages-2f91962d58-3a8f-49c5-98ce-b5928f50b56c_680x442.png",
      "bytes": 33906,
      "reused": true,
      "local_path": "attachments/034dc2221bcc/images/005.png",
      "src": "https://storage.ghost.io/c/3f/df/3fdf6ed2-17ac-4b12-a693-8078bd13e748/content/images/2026/01/https-3a-2f-2fsubstack-post-media-s3-amazonaws-com-2fpublic-2fimages-2f91962d58-3a8f-49c5-98ce-b5928f50b56c_680x442.png",
      "alt": "",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://storage.ghost.io/c/3f/df/3fdf6ed2-17ac-4b12-a693-8078bd13e748/content/images/2026/01/https-3a-2f-2fsubstack-post-media-s3-amazonaws-com-2fpublic-2fimages-2f531d633b-6e67-48ce-8595-9a0a99f3359a_680x429.png",
      "bytes": 46016,
      "reused": true,
      "local_path": "attachments/034dc2221bcc/images/007.png",
      "src": "https://storage.ghost.io/c/3f/df/3fdf6ed2-17ac-4b12-a693-8078bd13e748/content/images/2026/01/https-3a-2f-2fsubstack-post-media-s3-amazonaws-com-2fpublic-2fimages-2f531d633b-6e67-48ce-8595-9a0a99f3359a_680x429.png",
      "alt": "",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://storage.ghost.io/c/3f/df/3fdf6ed2-17ac-4b12-a693-8078bd13e748/content/images/2026/01/https-3a-2f-2fsubstack-post-media-s3-amazonaws-com-2fpublic-2fimages-2f2ad33105-e9da-459e-8c7a-6723492cd5ca_680x456.png",
      "bytes": 30845,
      "reused": true,
      "local_path": "attachments/034dc2221bcc/images/009.png",
      "src": "https://storage.ghost.io/c/3f/df/3fdf6ed2-17ac-4b12-a693-8078bd13e748/content/images/2026/01/https-3a-2f-2fsubstack-post-media-s3-amazonaws-com-2fpublic-2fimages-2f2ad33105-e9da-459e-8c7a-6723492cd5ca_680x456.png",
      "alt": "",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://storage.ghost.io/c/3f/df/3fdf6ed2-17ac-4b12-a693-8078bd13e748/content/images/2026/01/https-3a-2f-2fsubstack-post-media-s3-amazonaws-com-2fpublic-2fimages-2fe93d5710-ed85-4a73-afa9-4c0432f92c67_800x591.gif",
      "bytes": 312118,
      "reused": true,
      "local_path": "attachments/034dc2221bcc/images/011.gif",
      "src": "https://storage.ghost.io/c/3f/df/3fdf6ed2-17ac-4b12-a693-8078bd13e748/content/images/2026/01/https-3a-2f-2fsubstack-post-media-s3-amazonaws-com-2fpublic-2fimages-2fe93d5710-ed85-4a73-afa9-4c0432f92c67_800x591.gif",
      "alt": "",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://storage.ghost.io/c/3f/df/3fdf6ed2-17ac-4b12-a693-8078bd13e748/content/images/2026/01/https-3a-2f-2fsubstack-post-media-s3-amazonaws-com-2fpublic-2fimages-2f64ed8525-7cba-4350-ba03-899442798546_680x575.png",
      "bytes": 38972,
      "reused": true,
      "local_path": "attachments/034dc2221bcc/images/013.png",
      "src": "https://storage.ghost.io/c/3f/df/3fdf6ed2-17ac-4b12-a693-8078bd13e748/content/images/2026/01/https-3a-2f-2fsubstack-post-media-s3-amazonaws-com-2fpublic-2fimages-2f64ed8525-7cba-4350-ba03-899442798546_680x575.png",
      "alt": "",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://storage.ghost.io/c/3f/df/3fdf6ed2-17ac-4b12-a693-8078bd13e748/content/images/2026/01/https-3a-2f-2fsubstack-post-media-s3-amazonaws-com-2fpublic-2fimages-2fe3323f0f-ca75-4e7a-94e0-f6733909e95e_680x576.png",
      "bytes": 51270,
      "reused": true,
      "local_path": "attachments/034dc2221bcc/images/015.png",
      "src": "https://storage.ghost.io/c/3f/df/3fdf6ed2-17ac-4b12-a693-8078bd13e748/content/images/2026/01/https-3a-2f-2fsubstack-post-media-s3-amazonaws-com-2fpublic-2fimages-2fe3323f0f-ca75-4e7a-94e0-f6733909e95e_680x576.png",
      "alt": "",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://storage.ghost.io/c/3f/df/3fdf6ed2-17ac-4b12-a693-8078bd13e748/content/images/2026/01/https-3a-2f-2fsubstack-post-media-s3-amazonaws-com-2fpublic-2fimages-2f6d102336-0083-43f3-91a7-17274c89ab14_680x403.png",
      "bytes": 38800,
      "reused": true,
      "local_path": "attachments/034dc2221bcc/images/017.png",
      "src": "https://storage.ghost.io/c/3f/df/3fdf6ed2-17ac-4b12-a693-8078bd13e748/content/images/2026/01/https-3a-2f-2fsubstack-post-media-s3-amazonaws-com-2fpublic-2fimages-2f6d102336-0083-43f3-91a7-17274c89ab14_680x403.png",
      "alt": "",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://storage.ghost.io/c/3f/df/3fdf6ed2-17ac-4b12-a693-8078bd13e748/content/images/2026/01/https-3a-2f-2fsubstack-post-media-s3-amazonaws-com-2fpublic-2fimages-2fc6523660-253e-4ddb-98de-b2d221529dd0_930x672-png.jpg",
      "bytes": 132749,
      "reused": true,
      "local_path": "attachments/034dc2221bcc/images/019.jpg",
      "src": "https://storage.ghost.io/c/3f/df/3fdf6ed2-17ac-4b12-a693-8078bd13e748/content/images/2026/01/https-3a-2f-2fsubstack-post-media-s3-amazonaws-com-2fpublic-2fimages-2fc6523660-253e-4ddb-98de-b2d221529dd0_930x672-png.jpg",
      "alt": "",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://storage.ghost.io/c/3f/df/3fdf6ed2-17ac-4b12-a693-8078bd13e748/content/images/2026/01/https-3a-2f-2fsubstack-post-media-s3-amazonaws-com-2fpublic-2fimages-2f1839db70-e8fa-465c-9eba-2419d536f695_1508x800-png.jpg",
      "bytes": 271944,
      "reused": true,
      "local_path": "attachments/034dc2221bcc/images/021.jpg",
      "src": "https://storage.ghost.io/c/3f/df/3fdf6ed2-17ac-4b12-a693-8078bd13e748/content/images/2026/01/https-3a-2f-2fsubstack-post-media-s3-amazonaws-com-2fpublic-2fimages-2f1839db70-e8fa-465c-9eba-2419d536f695_1508x800-png.jpg",
      "alt": "",
      "downloaded": true
    }
  ],
  "audio": [],
  "videos": [
    {
      "url": "https://storage.ghost.io/c/3f/df/3fdf6ed2-17ac-4b12-a693-8078bd13e748/content/media/2025/10/hybrid-rag.mp4",
      "src": "https://storage.ghost.io/c/3f/df/3fdf6ed2-17ac-4b12-a693-8078bd13e748/content/media/2025/10/hybrid-rag.mp4",
      "status": "ok",
      "kind": "direct_video",
      "bytes": 33797918,
      "reused": false,
      "content_type": "application/octet-stream",
      "valid": true,
      "height": 1080,
      "width": 1592,
      "duration": "67.800000",
      "local_path": "attachments/034dc2221bcc/videos/repair-2b2f67f1adfc17552a4b.mp4"
    }
  ],
  "links": [
    {
      "href": "https://github.com/patchy631/ai-engineering-hub/tree/main/rag-sql-router?ref=dailydoseofds.com",
      "label": "​",
      "type": "a"
    },
    {
      "href": "https://help.cleanlab.ai/codex/?ref=dailydoseofds.com",
      "label": "​ Cleanlab Codex ​",
      "type": "a"
    },
    {
      "href": "https://github.com/milvus-io/milvus?ref=dailydoseofds.com",
      "label": "​ Milvus ​",
      "type": "a"
    },
    {
      "href": "https://storage.ghost.io/c/3f/df/3fdf6ed2-17ac-4b12-a693-8078bd13e748/content/media/2025/10/hybrid-rag.mp4",
      "label": "",
      "type": "video"
    },
    {
      "href": "https://x.com/intent/tweet?url=https%3A%2F%2Fwww.dailydoseofds.com%2Fp%2Fbuilding-trustworthy-agentic-rag-workflows%2F&text=Building%20Trustworthy%20Agentic%2FRAG%20Workflows",
      "label": "Share to X",
      "type": "a"
    },
    {
      "href": "https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fwww.dailydoseofds.com%2Fp%2Fbuilding-trustworthy-agentic-rag-workflows%2F",
      "label": "Share to Facebook",
      "type": "a"
    },
    {
      "href": "https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fwww.dailydoseofds.com%2Fp%2Fbuilding-trustworthy-agentic-rag-workflows%2F",
      "label": "Share to Linkedin",
      "type": "a"
    },
    {
      "href": "https://www.dailydoseofds.com/mlops-crash-course-part-1/",
      "label": "Previous Background and Foundations for ML in Production",
      "type": "a"
    },
    {
      "href": "https://www.dailydoseofds.com/mlops-crash-course-part-2/",
      "label": "Next The Machine Learning System Lifecycle",
      "type": "a"
    }
  ],
  "repair_version": 2,
  "repaired_at": "2026-10-14T10:47:58Z",
  "source_url": "https://www.dailydoseofds.com/p/building-trustworthy-agentic-rag-workflows/",
  "papers": [],
  "actual_video_files": [],
  "body_chars": 2641,
  "expected_body_images": 12,
  "discovery_status": "ok",
  "delivery_status": "ok",
  "missing_reason": "",
  "raw_html": "attachments/034dc2221bcc/pages/source.html",
  "local_html": "attachments/034dc2221bcc/pages/article.html",
  "body_base_path": "attachments/034dc2221bcc/pages/",
  "body_markdown_path": "attachments/034dc2221bcc/pages/article.md"
}