<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sanchit Rote on Medium]]></title>
        <description><![CDATA[Stories by Sanchit Rote on Medium]]></description>
        <link>https://medium.com/@sanchitrote?source=rss-6886c8ffb741------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*T77yg2vEoy-RwmJf9Q0cKw.jpeg</url>
            <title>Stories by Sanchit Rote on Medium</title>
            <link>https://medium.com/@sanchitrote?source=rss-6886c8ffb741------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 03:50:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sanchitrote/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[From 3 GB to 96 MB: Cutting Vector Search Memory by 32x with Binary Indexes]]></title>
            <link>https://medium.com/@sanchitrote/from-3-gb-to-96-mb-cutting-vector-search-memory-by-32x-with-binary-indexes-210149889ef2?source=rss-6886c8ffb741------2</link>
            <guid isPermaLink="false">https://medium.com/p/210149889ef2</guid>
            <category><![CDATA[milvus]]></category>
            <category><![CDATA[vector-embeddings]]></category>
            <category><![CDATA[vector-search]]></category>
            <category><![CDATA[agentic-rag]]></category>
            <category><![CDATA[vector-database]]></category>
            <dc:creator><![CDATA[Sanchit Rote]]></dc:creator>
            <pubDate>Tue, 24 Nov 2026 05:55:09 GMT</pubDate>
            <atom:updated>2026-11-24T05:55:09.819Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How 1-bit sign quantization works, when to use BIN_FLAT vs. BIN_IVF_FLAT in Milvus, and how to run it in Docling Pipelines without glue code.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mf2D8hGmskkuZ89MZz8IJQ.png" /></figure><p>Most RAG prototypes start out looking effortless. You ingest a few thousand PDFs, embed the chunks, push them into a vector database, and queries come back in milliseconds.</p><p>Problems show up when the corpus grows. A single 768-dimensional float32 embedding takes about 3 KB of memory (3,072 bytes). At 100 million chunks, you need over 300 GB of RAM just to store the raw vectors, before your index even allocates space for a search graph. What ran on a single machine suddenly needs a cluster.</p><p>Binary vector quantization shrinks that footprint by 32x. Below, we’ll walk through how binary vectors are built, how Milvus searches them, where they fall short compared to dense indexes, and how to turn them on in Docling Pipelines.</p><h3>From 768 floats to 768 yes-or-no answers</h3><p>Think of a 768-dimensional embedding as 768 measurements describing a chunk of text. A dense float32 vector records each measurement to seven decimal places (+0.8421931, -0.0138472, +0.4910284), spending 32 bits on every dimension.</p><p>For an initial search pass, you rarely need that much precision just to find documents in the same semantic neighborhood. Knowing whether each dimension is positive (1) or zero/negative (0) preserves most of the vector&#39;s direction.</p><p>1-bit sign quantization does two things:</p><ol><li>Any value greater than 0 becomes 1, and anything less than or equal to 0 becomes 0.</li><li>numpy.packbits packs eight of those bits into a single byte.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WeSx1arXg9UgjUzezTmPDg.png" /><figcaption>1-bit sign thresholding and byte packing in Embeddings Operator</figcaption></figure><p>A 768-dimensional vector drops from 3,072 bytes to 96 bytes. At that size, one million vectors fit in 96 MB of RAM.</p><p>Because the split sits at zero, this works best with zero-centered, normalized embedding models like nomic-embed-text or all-MiniLM-L6-v2. If a model&#39;s outputs skew heavily positive or negative, thresholding at zero throws away too much signal.</p><h3>How search works on ones and zeros</h3><p>Once vectors are packed into bitstrings, comparing two documents stops requiring hundreds of floating-point multiplications. At query time, your search client applies the same arr &gt; 0 thresholding and np.packbits packing to the query embedding before sending it to Milvus. Milvus supports two bitwise distance metrics for binary vectors (Milvus 2.6+ dropped older metrics like TANIMOTO, SUBSTRUCTURE, and SUPERSTRUCTURE):</p><ul><li>HAMMING lines up two bitstrings and counts how many bit positions differ. CPUs compute this with a bitwise XORfollowed by a POPCNT instruction in a few clock cycles.</li><li>JACCARD compares how many 1 bits two vectors share against the total 1 bits across both, which is useful when bits represent overlapping features or tokens.</li></ul><p>Milvus pairs those metrics with two index types:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PHI7qwHvHJKIsZofvnTzLA.png" /><figcaption>Comparing BIN_FLAT and BIN_IVF_FLAT in Milvus</figcaption></figure><p>BIN_FLAT scans every binary vector directly. Bitwise comparisons are cheap enough that brute-force search stays fast up to roughly 500,000 documents, with 100% exact recall over the binary vectors and zero extra RAM spent building an index structure.</p><p>BIN_IVF_FLAT groups similar binary vectors into clusters (nlist, defaulting to 128). At query time, Milvus only searches the closest clusters, keeping queries sub-millisecond even across tens of millions of documents.</p><h3>Trade-offs against dense indexes</h3><p>Compression comes with trade-offs, and binary indexes have clear limits.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yI6JFazOxetXxLcsmZE2mA.png" /><figcaption>Trade-offs between binary and dense float vector indexes</figcaption></figure><p>Collapsing 0.95 and 0.02 into the same 1 bit discards magnitude. Binary search is good at pulling the right neighborhood of documents, but it can struggle to rank two very similar candidates accurately on its own. You also need a zero-centered embedding model, and you need a standalone or distributed Milvus server. Embedded Milvus Lite (auth_type: &quot;lite&quot;) and OpenSearch do not support binary vector indexes.</p><p>Many production setups avoid choosing one over the other by storing both in the same Milvus collection:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ad4zLnm7NdsbdOaVL53SjQ.png" /><figcaption>Multi-vector Milvus collection combining binary, dense, and sparse fields</figcaption></figure><p>In a two-stage setup, BIN_IVF_FLAT with HAMMING stays in RAM to scan millions of chunks in under a millisecond and pull the top 100 candidates. Stage 2 then rescores only those 100 candidates, either with a cross-encoder reranker over the text or by fetching dense float vectors from disk/mmap rather than holding a full dense index in RAM. That way you keep the memory savings while recovering dense-level ranking quality. In the <a href="https://arxiv.org/abs/2106.00882">Binary Passage Retriever (BPR) paper</a>(Yamada et al., ACL 2021), this two-stage pattern shrank a 21-million-passage Wikipedia index from 65 GB down to 2 GB with virtually no drop in end-to-end QA accuracy.</p><h3>Using binary indexes in Docling Pipelines</h3><p>Docling Pipelines handles quantization, schema creation, and validation inside the existing pipeline operators, so you do not need custom bit-packing scripts or extra DAG nodes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3ifXmKClgr3sBOQzT8YWFg.png" /><figcaption>Automatic vector_binary feature propagation across the pipeline DAG</figcaption></figure><h3>Flow JSON and CLI</h3><p>Add &quot;quantization&quot;: &quot;binary&quot; to your embeddings node, and configure your vectordb node with BIN_IVF_FLAT (or BIN_FLAT) and HAMMING (or JACCARD). Here are the two relevant nodes from <a href="https://github.com/docling-project/docling-pipelines/blob/main/sample_flows/vectordb/milvus_binary_integration.json">sample_flows/vectordb/milvus_binary_integration.json</a>:</p><pre>{<br>  &quot;type&quot;: &quot;embeddings&quot;,<br>  &quot;name&quot;: &quot;generate_binary_embeddings&quot;,<br>  &quot;config&quot;: {<br>    &quot;provider&quot;: &quot;litellm&quot;,<br>    &quot;embeddings_column&quot;: &quot;embeddings&quot;,<br>    &quot;quantization&quot;: &quot;binary&quot;,<br>    &quot;provider_config&quot;: {<br>      &quot;model_id&quot;: &quot;openai/nomic-embed-text&quot;,<br>      &quot;api_base&quot;: &quot;http://localhost:11434/v1&quot;,<br>      &quot;api_key&quot;: &quot;${OLLAMA_API_KEY:-ollama}&quot;<br>    }<br>  },<br>  &quot;depends_on&quot;: [&quot;chunk_documents&quot;]<br>},<br>{<br>  &quot;type&quot;: &quot;vectordb&quot;,<br>  &quot;name&quot;: &quot;store_in_milvus_binary&quot;,<br>  &quot;config&quot;: {<br>    &quot;provider&quot;: &quot;milvus&quot;,<br>    &quot;doc_id_column&quot;: &quot;doc_id_hash&quot;,<br>    &quot;provider_config&quot;: {<br>      &quot;collection_name&quot;: &quot;binary_embeddings_collection&quot;,<br>      &quot;host&quot;: &quot;localhost&quot;,<br>      &quot;port&quot;: 19530,<br>      &quot;auth_type&quot;: &quot;standalone&quot;,<br>      &quot;index_type&quot;: &quot;BIN_IVF_FLAT&quot;,<br>      &quot;metric_type&quot;: &quot;HAMMING&quot;,<br>      &quot;index_parameters&quot;: { &quot;nlist&quot;: 128 }<br>    },<br>    &quot;feature_mappings&quot;: [<br>      { &quot;feature_name&quot;: &quot;doc_id_hash&quot;, &quot;mapped_column_name&quot;: &quot;pk&quot; },<br>      { &quot;feature_name&quot;: &quot;content&quot;, &quot;mapped_column_name&quot;: &quot;text&quot; },<br>      { &quot;feature_name&quot;: &quot;embeddings&quot;, &quot;mapped_column_name&quot;: &quot;binary_vector&quot; }<br>    ]<br>  },<br>  &quot;depends_on&quot;: [&quot;generate_binary_embeddings&quot;]<br>}</pre><p>Validate and run the flow from the CLI:</p><pre>docling-pipelines --flow-file sample_flows/vectordb/milvus_binary_integration.json --validate<br>docling-pipelines --flow-file sample_flows/vectordb/milvus_binary_integration.json</pre><p>When Docling Pipelines sees &quot;quantization&quot;: &quot;binary&quot; on the embeddings node, it propagates the output feature as vector_binarydownstream. The Milvus adapter then creates a BINARY_VECTOR field with the bit dimension (len(bytes) * 8) and streams the packed bytes directly into Milvus. If a collection mixes dense and binary embeddings, each field gets its own compatible index automatically.</p><h3>Visual canvas</h3><p>You can configure the same pipeline in the UI properties panel without touching JSON.</p><p><strong>Step 1: Enable quantization on the Embeddings node.</strong> Open the Embeddings node panel, expand Advanced, and set Quantization to Binary (1-bit packed).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*r3lVtkk0YTmsN9hbVnoBlg.png" /></figure><p><strong>Step 2: Configure Milvus and binary metrics on the VectorDB node.</strong> Open the VectorDB node panel, pick a non-Lite Milvus connection, and open the Feature Mapping tearsheet to choose HAMMING or JACCARD. The tearsheet filters metrics automatically based on whether the mapped vector is binary or dense, and Milvus defaults binary fields to BIN_FLAT (if you want BIN_IVF_FLAT and custom nlist settings, you can add index_type and index_parameters under Advanced configuration).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8t4O5hKLD-Ytk4HKb9UrSQ.png" /></figure><p>If you connect upstream binary embeddings to Milvus Lite or OpenSearch, the panel flags it immediately with an inline warning banner so you can switch deployments or reset Quantization before running the flow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*dpDAeTLG26CW9db7Sj1P0w.png" /></figure><h3>Upfront validation</h3><p>Both the CLI validator and the UI check for incompatible configurations before ingestion starts:</p><ul><li>Connecting binary embeddings to Milvus Lite or OpenSearch is rejected early (the UI displays an inline warning banner with instructions to switch providers or disable quantization).</li><li>Pairing a binary index with a dense metric like L2 or COSINE (or pairing a dense index with HAMMING or JACCARD) fails validation.</li><li>Bit dimensions are checked to ensure dim % 8 == 0 and to catch mismatches against an existing Milvus collection.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ihu5h0AEc8DAcdfNQTvIcA.png" /><figcaption>Compile-time validation checks for Milvus binary vector flows</figcaption></figure><p>If you want to try it on your own documents, start from <a href="https://github.com/docling-project/docling-pipelines/blob/main/sample_flows/vectordb/milvus_binary_integration.json">sample_flows/vectordb/milvus_binary_integration.json</a>, point it at a standalone Milvus instance, and run --validate before ingesting.</p><p><em>Binary vector indexing is just one piece of what we are building in </em><a href="https://github.com/docling-project/docling-pipelines"><em>Docling Pipelines</em></a><em>. Explore the GitHub repository to see more operators, sample flows, and production patterns for unstructured AI data pipelines, and feel free to open an issue or PR if you want to build along with us.</em></p><p><em>If you found this useful, you might also like my other posts in this series on </em><a href="https://medium.com/@sanchitrote/stop-hardcoding-secrets-in-your-ai-pipelines-how-we-brought-hashicorp-vault-to-docling-pipelines-c87c5a7eafbe"><em>keeping secrets out of AI pipelines with HashiCorp Vault</em></a><em> and </em><a href="https://medium.com/@sanchitrote/your-ai-is-only-as-good-as-your-data-heres-how-to-fix-that-7ecaa1fbd454"><em>improving RAG data quality with Quality Operators</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=210149889ef2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop Hardcoding Secrets in Your AI Pipelines: How We Brought HashiCorp Vault to Docling Pipelines]]></title>
            <link>https://medium.com/@sanchitrote/stop-hardcoding-secrets-in-your-ai-pipelines-how-we-brought-hashicorp-vault-to-docling-pipelines-c87c5a7eafbe?source=rss-6886c8ffb741------2</link>
            <guid isPermaLink="false">https://medium.com/p/c87c5a7eafbe</guid>
            <category><![CDATA[hashicorp-vault]]></category>
            <category><![CDATA[data-pipeline]]></category>
            <category><![CDATA[docling]]></category>
            <category><![CDATA[unstructured-data]]></category>
            <dc:creator><![CDATA[Sanchit Rote]]></dc:creator>
            <pubDate>Wed, 21 Oct 2026 13:54:43 GMT</pubDate>
            <atom:updated>2026-10-21T13:54:43.373Z</atom:updated>
            <content:encoded><![CDATA[<p><em>From plain-text API keys and container environment sprawl to zero-leak enterprise security — an architectural deep dive and hands-on guide for document processing workflows.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LzmJgjgIJdGl5v8jI1lDaA.jpeg" /></figure><h3>The Secret Everyone Has (And Nobody Wants in Git)</h3><p>Picture this: You’ve just built a state-of-the-art document processing pipeline using <a href="https://github.com/docling-project/docling-pipelines">Docling Pipelines</a>.</p><p>Your flow pulls hundred-page corporate PDFs from an AWS S3 bucket, uses Docling to extract tables and OCR layout structures, chunks the text, computes multi-lingual dense embeddings via an enterprise LLM provider like IBM watsonx or Hugging Face, and indexes thousands of chunks into an OpenSearch vector database.</p><p>It’s powerful. It’s fast. But look inside your pipeline configuration file:</p><pre>// pipeline_flow.json (the anti-pattern)<br>{<br>  &quot;type&quot;: &quot;embeddings&quot;,<br>  &quot;name&quot;: &quot;generate_embeddings&quot;,<br>  &quot;config&quot;: {<br>    &quot;provider&quot;: &quot;watsonx&quot;,<br>    &quot;api_key&quot;: &quot;eyJhbGciOi...DO_NOT_COMMIT_ME_PRODUCTION_KEY&quot;,<br>    &quot;model&quot;: &quot;ibm/granite-embedding-107m-multilingual&quot;<br>  }<br>}</pre><p>Sound familiar?</p><p>Even if you’re disciplined enough not to commit raw JSON files to GitHub, where does this JSON live when saved via the REST API or visualized in a pipeline canvas? It ends up stored in application databases, transmitted over WebSocket connections, logged in orchestrator traces, and rendered on developer monitors.</p><p>The traditional fallback is environment variable sprawl: littering your Kubernetes deployments or Docker containers with dozens of variables like WATSONX_API_KEY_NODE_3 or OPENSEARCH_PASSWORD_VECTORDB. But this quickly breaks down:</p><ul><li>No Least Privilege: Every container gets access to every secret, even if only one pipeline step needs it.</li><li>Rotation Hell: Rotating a database password or API token requires restarting pods, redeploying containers, or touching production manifests.</li><li>Zero Audit Trail: Who accessed the OpenSearch cluster password at 3:14 AM? Standard environment variables cannot answer that question.</li><li>Compliance Deadlock: SOC 2, ISO 27001, and HIPAA compliance auditors will fail systems that persist unencrypted credentials alongside pipeline metadata.</li></ul><p>To solve this for enterprise document processing, we integrated <a href="https://www.vaultproject.io/">HashiCorp Vault</a> natively into both the backend execution engine and the visual canvas UI of <a href="https://github.com/docling-project/docling-pipelines">Docling Pipelines</a>.</p><p>In this article, we’ll look at:</p><ol><li>The Architecture: How we designed zero-leak, Just-In-Time (JIT) secrets resolution.</li><li>The Visual UI: How the canvas properties panel lets users toggle between direct input and Vault references with a single click.</li><li>Hands-On Tutorial: How you can configure Vault and run an end-to-end secure document pipeline today.</li></ol><h3>The Design: How vault:// References Work</h3><p>Rather than turning the pipeline engine into a heavy credential store, we introduced a lightweight, URI-based abstraction. Instead of pasting an API key or password into your flow, you provide a Vault reference URI:</p><pre>vault://&lt;provider&gt;/&lt;secret_path&gt;#&lt;field_key&gt;</pre><p>For instance:</p><ul><li>vault://hashicorp/docpipe/watsonx#api_key</li><li>vault://hashicorp/docpipe/opensearch#password</li><li>vault://hashicorp/docpipe/s3_credentials#secret_access_key</li></ul><p>You can also pull an entire connection configuration dictionary from a single secret:</p><ul><li>vault://hashicorp/docpipe/milvus_cluster <em>(resolves directly into </em><em>{ &quot;host&quot;: &quot;...&quot;, &quot;port&quot;: 19530, &quot;token&quot;: &quot;...&quot; })</em></li></ul><pre>+-------------------------------------------------------------+<br>|                  Visual Canvas &amp; REST API                   |<br>|   User inputs URI: vault://hashicorp/docpipe/watsonx#api_key|<br>+------------------------------+------------------------------+<br>                               |<br>                               v<br>+-------------------------------------------------------------+<br>|            Zero-Leak Persistence &amp; Validation               |<br>|   • Stored in flow.json &amp; DB (No Plaintext Secrets)         |<br>|   • FlowValidator injects safe mocks during dry-run         |<br>+------------------------------+------------------------------+<br>                               |<br>                               v<br>+-------------------------------------------------------------+<br>|                Runtime Execution Engine                     |<br>|   • PythonOperatorExecutor intercepts parameters            |<br>|   • JIT fetch from HashiCorp Vault over AppRole/Token       |<br>|   • In-memory only: fed directly to Operator.transform()    |<br>+-------------------------------------------------------------+</pre><h3>The Three Guarantees</h3><p>When designing this integration, we established three strict non-negotiables:</p><ol><li>Zero-Leak Persistence: Plaintext secrets must never touch the flow file, database records, execution history tables, or API responses. Only the URI is stored.</li><li>Just-In-Time (JIT) Resolution: Credentials are only fetched from Vault milliseconds before an operator’s transform() method runs. Once the batch finishes, the in-memory operator config goes out of scope and gets garbage collected.</li><li>Safe Offline Validation: A user or CI pipeline should be able to run docling-pipelines --flow-file flow.json --validate without requiring production Vault connectivity. The validator detects vault:// URIs, verifies their syntax, and injects safe mock values for validation schemas without attempting to contact Vault.</li></ol><h3>The Visual Experience: Inside the Properties Panel</h3><p>Security controls that introduce friction get bypassed. If configuring a Vault secret requires editing cryptic YAML or jumping through CLI hoops, developers will copy-paste credentials directly into the UI.</p><p>To make the secure path the easiest path, we built VaultInput into the Docling Pipelines visual canvas:</p><figure><img alt="The Properties Panel for the Embeddings Operator. Toggling ‘Use Vault’ reveals the purple vault:// badge and allows typing the secret path." src="https://cdn-images-1.medium.com/max/940/1*M5-6vS4PssaRvknT8V0kEQ.png" /></figure><h3>How It Works in Practice</h3><p>Every sensitive field across our operators — such as API keys in EmbeddingsOperator, passwords in VectorDBOperator, or S3 keys in IngestSourceOperator—automatically renders with a &quot;Use Vault&quot; toggle:</p><ul><li>Direct Mode (Toggle Off): Functions like a standard Carbon Design System PasswordInput, masking plaintext with dots for quick prototyping in local development.</li><li>Vault Mode (Toggle On): The input transforms instantly. A distinctive purple vault:// badge appears, and the field accepts the target path and key (hashicorp/docpipe/watsonx#api_key).</li><li>Non-Destructive State: If you switch between Direct and Vault mode, your previous entries are preserved. You won’t accidentally wipe out your URI while checking a fallback value.</li><li>Inline Guidance: Hovering over the definition tooltip reveals the exact syntax rules, the active provider name, and examples tailored to that operator.</li></ul><p>When you click “Save Flow,” the JSON payload sent across the wire contains only the vault:// reference. Your API key never touches the browser&#39;s persistent storage or the backend database.</p><h3>Step-by-Step Tutorial: Running a Flow with Vault</h3><p>Let’s walk through an end-to-end example. We will:</p><ol><li>Spin up a local HashiCorp Vault server.</li><li>Store our LLM and Vector DB credentials inside Vault.</li><li>Configure Docling Pipelines to connect to Vault.</li><li>Run a pipeline that extracts text, embeds it, and indexes it into OpenSearch — without a single hardcoded credential.</li></ol><h3>Step 1: Start Vault and Store Secrets</h3><p>If you already have a Vault instance in your organization, you can use your existing KV v2 engine. For local testing, spin up Vault in dev mode:</p><pre># Terminal 1: Start local Vault in development mode<br>vault server -dev -dev-root-token-id=&quot;root-dev-token&quot;</pre><p>In a separate terminal, set your Vault address and write the secrets:</p><pre># Terminal 2: Configure environment and write secrets<br>export VAULT_ADDR=&#39;http://127.0.0.1:8200&#39;<br>export VAULT_TOKEN=&#39;root-dev-token&#39;</pre><pre># Store watsonx API credentials<br>vault kv put secret/docpipe/watsonx \<br>    api_key=&quot;W3_s3cr3t_t0k3n_x987&quot; \<br>    project_id=&quot;c8914614-7f61-4890-a526-9e8c31&quot;</pre><pre># Store OpenSearch Vector DB credentials<br>vault kv put secret/docpipe/opensearch \<br>    username=&quot;admin&quot; \<br>    password=&quot;SuperSecretPassword!2026&quot;</pre><p>You can verify the stored secrets immediately:</p><pre>vault kv get secret/docpipe/watsonx</pre><h3>Step 2: Configure Docling Pipelines</h3><p>Docling Pipelines supports configuration via either docling-pipelines-config.yaml or environment variables.</p><p>In your docling-pipelines-config.yaml:</p><pre># docling-pipelines-config.yaml<br>secrets:<br>  vault:<br>    enabled: true<br>    provider: hashicorp<br>    hashicorp:<br>      url: &quot;http://127.0.0.1:8200&quot;<br>      auth_method: &quot;token&quot;       # In production, use &quot;approle&quot;<br>      token: &quot;root-dev-token&quot;<br>      mount_point: &quot;secret&quot;<br>      kv_version: 2</pre><blockquote>Enterprise Tip (Production AppRole Auth): In production Kubernetes or VM clusters, avoid static root tokens. Set auth_method: &quot;approle&quot; and supply DOCPIPE_VAULT_APPROLE_ROLE_ID and DOCPIPE_VAULT_APPROLE_SECRET_ID. Docling Pipelines will handle automatic role login and background token renewal without restarting your services.</blockquote><p>You can also enable it on the fly using environment variables:</p><pre>export DOCPIPE_VAULT_ENABLED=true<br>export DOCPIPE_VAULT_URL=&quot;http://127.0.0.1:8200&quot;<br>export DOCPIPE_VAULT_TOKEN=&quot;root-dev-token&quot;</pre><h3>Step 3: Write the Secure Flow JSON</h3><p>Here is secure_rag_flow.json. Notice how all sensitive fields point to Vault URIs:</p><pre>// secure_rag_flow.json<br>{<br>  &quot;flow_name&quot;: &quot;secure-enterprise-rag&quot;,<br>  &quot;global_config&quot;: {<br>    &quot;doc_column&quot;: &quot;content&quot;,<br>    &quot;storage&quot;: &quot;in-memory&quot;,<br>    &quot;enable_micro_batching&quot;: true,<br>    &quot;micro_batch_size&quot;: 20<br>  },<br>  &quot;flow&quot;: [<br>    {<br>      &quot;type&quot;: &quot;ingest_source&quot;,<br>      &quot;name&quot;: &quot;ingest_pdfs&quot;,<br>      &quot;config&quot;: {<br>        &quot;provider&quot;: &quot;filesystem&quot;,<br>        &quot;connection_params&quot;: {<br>          &quot;paths&quot;: [&quot;./sample_docs&quot;]<br>        },<br>        &quot;include_filter&quot;: &quot;pdf&quot;<br>      }<br>    },<br>    {<br>      &quot;type&quot;: &quot;extract_operator&quot;,<br>      &quot;name&quot;: &quot;extract_text&quot;,<br>      &quot;config&quot;: {<br>        &quot;pipeline&quot;: &quot;docling_standard&quot;<br>      },<br>      &quot;depends_on&quot;: [&quot;ingest_pdfs&quot;]<br>    },<br>    {<br>      &quot;type&quot;: &quot;chunker&quot;,<br>      &quot;name&quot;: &quot;chunk_documents&quot;,<br>      &quot;config&quot;: {<br>        &quot;chunker_type&quot;: &quot;hybrid&quot;,<br>        &quot;max_tokens&quot;: 512<br>      },<br>      &quot;depends_on&quot;: [&quot;extract_text&quot;]<br>    },<br>    {<br>      &quot;type&quot;: &quot;embeddings&quot;,<br>      &quot;name&quot;: &quot;generate_embeddings&quot;,<br>      &quot;config&quot;: {<br>        &quot;provider&quot;: &quot;watsonx&quot;,<br>        &quot;model&quot;: &quot;ibm/granite-embedding-107m-multilingual&quot;,<br>        &quot;api_key&quot;: &quot;vault://hashicorp/docpipe/watsonx#api_key&quot;,<br>        &quot;project_id&quot;: &quot;vault://hashicorp/docpipe/watsonx#project_id&quot;<br>      },<br>      &quot;depends_on&quot;: [&quot;chunk_documents&quot;]<br>    },<br>    {<br>      &quot;type&quot;: &quot;vectordb&quot;,<br>      &quot;name&quot;: &quot;index_vectors&quot;,<br>      &quot;config&quot;: {<br>        &quot;db_type&quot;: &quot;opensearch&quot;,<br>        &quot;index_name&quot;: &quot;enterprise-knowledge-base&quot;,<br>        &quot;host&quot;: &quot;localhost&quot;,<br>        &quot;port&quot;: 9200,<br>        &quot;username&quot;: &quot;admin&quot;,<br>        &quot;password&quot;: &quot;vault://hashicorp/docpipe/opensearch#password&quot;<br>      },<br>      &quot;depends_on&quot;: [&quot;generate_embeddings&quot;]<br>    }<br>  ]<br>}</pre><p>This configuration file can be safely version-controlled, shared across team members, and rendered on screen. It contains zero sensitive credentials.</p><h3>Step 4: Validate and Run</h3><p>First, validate the flow without hitting Vault:</p><pre>docling-pipelines --flow-file secure_rag_flow.json --validate</pre><p>The output will confirm your DAG topology and operator parameters are structurally sound:</p><pre>[INFO] Validating flow: secure-enterprise-rag<br>[INFO] Operator &#39;generate_embeddings&#39;: 2 vault reference(s) detected. Sanitizing for schema validation...<br>[INFO] Operator &#39;index_vectors&#39;: 1 vault reference(s) detected. Sanitizing for schema validation...<br>[INFO] Flow validation passed with 0 errors and 0 warnings.</pre><p>Now, execute the flow:</p><pre>docling-pipelines --flow-file secure_rag_flow.json</pre><p>What happens under the hood during execution?</p><ol><li>The orchestrator prepares the generate_embeddings node.</li><li>PythonOperatorExecutor intercepts the config, identifies the two vault:// URIs, and calls the Vault client.</li><li>Vault authenticates the request, checks its internal ACL policy, records an audit log entry, and hands back the decrypted keys.</li><li>The operator runs embedding inference against watsonx and yields the enriched Arrow table.</li><li>In the next step, index_vectors fetches the OpenSearch password via JIT resolution and ingests the records.</li><li>Execution completes. At no point were credentials written to disk, job database logs, or terminal outputs.</li></ol><h3>Under the Hood: Resolving the Hidden Gotchas</h3><p>Building enterprise secret resolution into an existing DAG orchestrator comes with subtle challenges. Here are three architectural hurdles we had to solve:</p><h3>1. Schema Validation vs. Secret Masks</h3><p>Docling Pipelines operators strictly validate incoming config dictionaries. For instance, IngestSourceOperator expects connection_params to be a Python dictionary (dict).</p><p>If a user specifies:</p><pre>&quot;connection_params&quot;: &quot;vault://hashicorp/docpipe/s3_config&quot;</pre><p>A standard validator would raise a TypeError: expected dict, got str.</p><p>To fix this, the FlowValidator performs type-aware mocking:</p><ul><li>If the field expects a dict, it replaces the Vault URI with {} during the dry-run check.</li><li>If the field expects a str, it injects a dummy string &quot;__vault_ref_placeholder__&quot;.</li></ul><p>This allows the engine to strictly validate operator parameters ahead of time without needing real credentials.</p><h3>2. Thread-Safe Token Renewal</h3><p>Document ingestion pipelines often process massive batches of hundreds of thousands of pages, running continuously for hours. If a Vault client lease expires mid-batch, the pipeline fails catastrophically with 403 Forbidden.</p><p>To guarantee continuous operation, the backend Vault provider maintains a thread-safe token renewal lifecycle. Leases are proactively refreshed in the background before expiration, ensuring operators executing hours into a distributed job always receive a valid, authenticated session without interruption.</p><h3>3. Graceful Startup</h3><p>If Vault happens to be unreachable when the API server boots up, we deliberately don’t abort the entire Docling Pipelines service. Other pipelines that use local file systems or Ollama models shouldn’t be blocked. Instead, the VaultInitializer logs a clear warning and marks the provider as uninitialized. If a flow arrives that requires Vault, it returns an explicit error explaining that the Vault provider is unreachable.</p><h3>Summary &amp; Next Steps</h3><p>Credentials do not belong in pipeline definitions. By pairing HashiCorp Vault with Docling Pipelines, teams can enjoy:</p><ul><li>Zero credential leaks in Git, canvas exports, or trace databases.</li><li>Instant key rotation at the Vault level without touching pipeline configurations.</li><li>Full audit compliance for enterprise AI deployments.</li><li>A frictionless UI that gives developers one-click switching between prototyping and enterprise security.</li></ul><h3>Try It Out</h3><ul><li>Explore the open-source codebase on <a href="https://github.com/docling-project/docling-pipelines">GitHub</a>.</li><li>Read the official <a href="https://github.com/docling-project/docling-pipelines/blob/main/docs/guides/VAULT_INTEGRATION_GUIDE.md">Vault Integration Guide</a> for detailed mTLS, AppRole, and Docker secrets setup.</li><li>Star the repository and join the Docling community!</li></ul><p><em>Have you implemented centralized secrets in your AI and data pipelines? Let us know your thoughts and questions in the comments below!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c87c5a7eafbe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your AI Is Only as Good as Your Data — Here’s How to Fix That]]></title>
            <link>https://medium.com/@sanchitrote/your-ai-is-only-as-good-as-your-data-heres-how-to-fix-that-7ecaa1fbd454?source=rss-6886c8ffb741------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ecaa1fbd454</guid>
            <category><![CDATA[agentic-rag]]></category>
            <category><![CDATA[vector-database]]></category>
            <category><![CDATA[unstructured-data]]></category>
            <category><![CDATA[data-pipeline]]></category>
            <category><![CDATA[docling]]></category>
            <dc:creator><![CDATA[Sanchit Rote]]></dc:creator>
            <pubDate>Mon, 07 Sep 2026 11:01:11 GMT</pubDate>
            <atom:updated>2026-09-07T11:01:11.106Z</atom:updated>
            <content:encoded><![CDATA[<p>How Quality Operators in <a href="https://github.com/IBM/docling-pipelines">Docling Pipelines</a> help you clean, filter, and protect your data before it ever reaches a model.</p><p>By <a href="https://github.com/IBM/docling-pipelines">Docling-pipelines</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p5UXM6cTNiV--y1cXPsdAQ.jpeg" /></figure><p>If you’ve spent any time building RAG applications, fine-tuning language models, or shipping AI-powered products, you’ve probably learned one painful lesson the hard way:</p><p><strong>Your AI is only as good as the data you feed it.</strong></p><p>You can use the most advanced embedding model on the market. You can throw GPT-5, Claude, or Granite at the problem. But if the documents flowing into your pipeline are full of duplicates, riddled with PII, written in a language your model doesn’t understand, or so poorly structured that they’re barely readable — your system <em>will</em> hallucinate, <em>will</em> violate compliance, and <em>will</em> cost you more than it should.</p><p>The fix isn’t a better model. It’s a better pipeline.</p><h3>The Missing Layer in Most AI Pipelines</h3><p>Here’s how most document processing pipelines work today:</p><blockquote>Ingest → Extract → Chunk → Embed → Store → Query</blockquote><p>Simple, elegant — and dangerously incomplete.</p><p>What’s missing is <strong>the quality layer</strong> — a set of processing steps between extraction and downstream consumption that inspects, cleans, filters, and enriches your data <em>before</em> it becomes vectors in a database or context in a prompt.</p><p>This is exactly what <strong>Quality Operators</strong> in <a href="https://github.com/IBM/docling-pipelines">Docling Pipelines</a> are designed to do.</p><p>Docling Pipelines is an open-source framework for building modular document processing workflows. You define your pipeline as a JSON configuration — a directed acyclic graph (DAG) of operators — and the framework handles execution, batching, and orchestration. Quality Operators are a family of specialized operators that sit in the middle of your flow, acting as a data firewall.</p><p>Let’s meet them.</p><h3>The Quality Operators You Should Know</h3><h3>1. Document Quality (doc_quality)</h3><p>This operator computes heuristic text quality metrics for every document in your pipeline. It uses the dpk_doc_quality package under the hood and evaluates things like:</p><ul><li>Total word count</li><li>Character-to-word ratios</li><li>Lorem ipsum detection</li><li>Bad word frequency (using a configurable bad word list)</li></ul><p><strong>Why it matters:</strong> These metrics let you flag — or automatically discard — documents that are too short, too noisy, or structurally broken. A 50-word document with 40 special characters probably isn’t going to improve your RAG retrieval.</p><h3>2. ML Enrichment (ml_enrichment)</h3><p>A separate, more advanced operator that uses the dpk_enrichment package to extract <strong>30+ ML-driven quality features</strong> from your text, including:</p><ul><li>Basic statistics — word count, character count, paragraph count</li><li>Averages — average word length, average paragraph length</li><li>Character ratios — alphanumeric, punctuation, control characters</li><li>Duplication detection — paragraph-level and n-gram duplicates</li><li>Special pattern detection — ellipsis, bullet points, tabs, hashes</li></ul><p><strong>Why it matters:</strong> While doc_quality gives you a quick health check, ml_enrichment provides a deep feature vector you can use for downstream filtering, classification, or even as features in a machine learning model. Think of doc_quality as a thermometer and ml_enrichment as a full blood panel.</p><h3>3. Exact Deduplication (ededup)</h3><p>Duplicate content is one of the most common — and most overlooked — problems in document pipelines. The ededup operator uses content hashing to identify and remove exact duplicates.</p><p><strong>Why it matters:</strong> Duplicate documents bloat your vector store, increase embedding costs, and skew retrieval results. If three copies of the same policy memo exist in your corpus, your retrieval system might return all three — wasting context window tokens and confusing the model.</p><h3>4. Language Detection (lang_detect)</h3><p>This operator identifies the primary language of each document. It supports both lightweight detection and more robust FastText-based models for higher accuracy.</p><p><strong>Why it matters:</strong> If your downstream model only supports English and Spanish, feeding it a document in Mandarin isn’t just unhelpful — it can produce garbage output. Language detection lets you route documents to the right model or drop unsupported ones entirely.</p><h3>5. Readability (readability)</h3><p>Readability scoring has been around for decades in education and publishing. This operator brings it into your AI pipeline by computing standard metrics like:</p><ul><li><strong>Flesch Reading Ease</strong> — how easy is the text to read?</li><li><strong>Flesch-Kincaid Grade Level</strong> — what education level is needed?</li><li><strong>Gunning Fog Index</strong> — how complex is the sentence structure?</li><li><strong>Dale-Chall Readability Score</strong> — how many difficult words are present?</li></ul><p><strong>Why it matters:</strong> Not all text is created equal. A page scraped from the web might be a well-written article — or it might be a navigation menu with 200 links. Readability scores help you distinguish signal from noise programmatically.</p><h3>6. PII and HAP Detection (pii_and_hap)</h3><p>This operator uses LLM-powered analysis (via Ollama, vLLM, or WatsonX) to detect sensitive content in your documents:</p><ul><li><strong>PII (Personally Identifiable Information):</strong> Email addresses, phone numbers, SSNs, credit card numbers, bank account numbers, IP addresses.</li><li><strong>HAP (Hate, Abuse, and Profanity):</strong> Toxic or offensive language that could contaminate your model’s outputs.</li></ul><p>It can also <strong>redact</strong> detected entities inline, replacing them with masking characters (asterisks for PII, hash marks for HAP). You configure confidence thresholds, the specific PII types to look for, and whether to redact or just annotate.</p><p><strong>Why it matters:</strong> This isn’t optional — it’s a legal and ethical requirement. If you’re building an enterprise knowledge base that ingests HR documents, customer communications, or medical records, PII <em>will</em> be present. This operator ensures it never reaches your vector store or generation layer.</p><h3>7. Redaction (redaction)</h3><p>A simpler, regex-based operator for masking strings that match a given pattern or word. Unlike the LLM-powered pii_and_hap operator, this one is lightweight and deterministic — it uses regular expressions to find and replace sensitive text.</p><p><strong>Why it matters:</strong> Sometimes you don’t need an LLM to redact data. If you know the exact patterns you’re looking for — say, internal project codenames, specific account numbers, or custom regex patterns — the redaction operator gives you fast, predictable masking with zero inference cost.</p><h3>8. SQL Filter (sql_filter)</h3><p>The most flexible operator in the suite. It lets you write SQL-like conditions against document metadata to dynamically route, include, or exclude documents.</p><p>For example:</p><ul><li>Keep only English documents with a condition like language = &#39;en&#39;</li><li>Drop very short documents with docq_total_words &gt; 100</li><li>Enforce access controls with clearance_level != &#39;Top Secret&#39;</li></ul><p><strong>Why it matters:</strong> Every pipeline has domain-specific rules. The SQL filter gives you a declarative, readable way to express them without writing custom Python code.</p><h3>Real-World Use Cases</h3><h3>Building a Compliant Enterprise RAG System</h3><p>You’re building an internal AI assistant that answers employee questions using company documents — HR policies, handbooks, memos, org charts.</p><p>The problem? Those documents contain employee names, salaries, SSNs, and internal classifications.</p><p><strong>Your quality layer:</strong></p><ol><li><strong>ededup</strong> → Remove the five identical copies of last year’s benefits guide.</li><li><strong>pii_and_hap</strong> → Detect and redact all names, phone numbers, and salary figures using LLM-powered analysis.</li><li><strong>redaction</strong> → Catch any remaining patterns (like internal project codes) with regex-based masking.</li><li><strong>sql_filter</strong> → Drop any document marked confidential = true.</li></ol><p><em>Result: A RAG system that’s both useful and compliant.</em></p><h3>Curating a Multi-Lingual Knowledge Base</h3><p>Your company operates across 12 countries. Support tickets, product manuals, and FAQs pour in from every region. But your current LLM setup only handles English and Spanish reliably.</p><p><strong>Your quality layer:</strong></p><ol><li><strong>lang_detect</strong> → Tag every document with its detected language.</li><li><strong>sql_filter</strong> → Filter with a condition like language IN (&#39;en&#39;, &#39;es&#39;) to drop everything else.</li><li><strong>readability</strong> → Score remaining documents and filter out anything with a Flesch-Kincaid score below a threshold. Auto-translated gibberish tends to score poorly.</li></ol><p><em>Result: A clean, high-quality corpus in exactly the languages your model supports.</em></p><h3>Preparing Web-Scraped Data for LLM Training</h3><p>You’re scraping thousands of pages from industry blogs and forums to build a domain-specific training dataset. Web data is messy — duplicate pages, boilerplate navigation, cookie banners, and the occasional profanity-laden rant.</p><p><strong>Your quality layer:</strong></p><ol><li><strong>ededup</strong> → Discard identical pages (syndicated content, mirrors).</li><li><strong>doc_quality</strong> → Compute basic text quality metrics. Flag pages with excessive bad words or abnormal character ratios.</li><li><strong>ml_enrichment</strong> → Extract 30+ deep quality features. Filter out pages where n-gram duplication is high (boilerplate content).</li><li><strong>readability</strong> → Drop pages that score below a minimum readability threshold.</li><li><strong>pii_and_hap</strong> → Flag and remove content with hate speech or profanity.</li></ol><p><em>Result: A training corpus that’s clean, diverse, and safe.</em></p><h3>A Real Sample Flow: Quality-Based Routing</h3><p>Here’s where it gets really interesting. Docling Pipelines doesn’t just let you chain quality operators linearly — you can use them to <strong>branch your pipeline</strong> based on quality scores.</p><p>The following flow (adapted from the actual branching_quality_routing.json sample in the repository) ingests documents, runs them through a battery of quality checks, and then <strong>routes high-quality documents to one index and low-quality documents to another</strong>.</p><p>The pipeline looks like this:</p><blockquote>Ingest → Extract → Language Detection → Dedup → Doc Quality → Readability → <strong>Branching</strong></blockquote><p>From the branching point, the flow splits:</p><blockquote><strong>High Quality Branch:</strong> ML Enrichment → Embeddings → OpenSearch (high_quality index)</blockquote><blockquote><strong>Low Quality Branch:</strong> SQL Filter → Embeddings → OpenSearch (low_quality index)</blockquote><p>Here’s what the JSON configuration looks like (simplified for clarity):</p><pre>{<br>  &quot;flow_name&quot;: &quot;Quality Pipeline with Branching&quot;,<br>  &quot;description&quot;: &quot;Quality operators showcase with conditional routing.&quot;,<br>  &quot;global_config&quot;: {<br>    &quot;doc_column&quot;: &quot;content&quot;,<br>    &quot;storage&quot;: &quot;in-memory&quot;,<br>    &quot;execute_type&quot;: &quot;local&quot;<br>  },<br>  &quot;flow&quot;: [<br>    {<br>      &quot;name&quot;: &quot;ingest&quot;,<br>      &quot;type&quot;: &quot;ingest_source&quot;,<br>      &quot;config&quot;: {<br>        &quot;provider&quot;: &quot;filesystem&quot;,<br>        &quot;connection_params&quot;: {<br>          &quot;paths&quot;: [&quot;tests/fixtures/customer_support_docs/&quot;]<br>        },<br>        &quot;include_filter&quot;: &quot;txt,pdf&quot;<br>      }<br>    },<br>    {<br>      &quot;name&quot;: &quot;extract&quot;,<br>      &quot;type&quot;: &quot;extract_operator&quot;,<br>      &quot;config&quot;: {<br>        &quot;text_extraction&quot;: {<br>          &quot;provider&quot;: &quot;docling_library&quot;,<br>          &quot;doc_column&quot;: &quot;content&quot;<br>        }<br>      },<br>      &quot;depends_on&quot;: [&quot;ingest&quot;]<br>    },<br>    {<br>      &quot;name&quot;: &quot;detect_language&quot;,<br>      &quot;type&quot;: &quot;lang_detect&quot;,<br>      &quot;config&quot;: { &quot;doc_column&quot;: &quot;content&quot; },<br>      &quot;depends_on&quot;: [&quot;extract&quot;]<br>    },<br>    {<br>      &quot;name&quot;: &quot;dedup&quot;,<br>      &quot;type&quot;: &quot;ededup&quot;,<br>      &quot;config&quot;: {<br>        &quot;doc_column&quot;: &quot;content&quot;,<br>        &quot;doc_id_column&quot;: &quot;doc_id_hash&quot;<br>      },<br>      &quot;depends_on&quot;: [&quot;detect_language&quot;]<br>    },<br>    {<br>      &quot;name&quot;: &quot;doc_quality&quot;,<br>      &quot;type&quot;: &quot;doc_quality&quot;,<br>      &quot;config&quot;: {<br>        &quot;doc_column&quot;: &quot;content&quot;,<br>        &quot;doc_content_column&quot;: &quot;content&quot;,<br>        &quot;text_lang&quot;: &quot;en&quot;<br>      },<br>      &quot;depends_on&quot;: [&quot;dedup&quot;]<br>    },<br>    {<br>      &quot;name&quot;: &quot;readability&quot;,<br>      &quot;type&quot;: &quot;readability&quot;,<br>      &quot;config&quot;: {<br>        &quot;doc_column&quot;: &quot;content&quot;,<br>        &quot;readability_score_list&quot;: [<br>          &quot;flesch_reading_ease&quot;,<br>          &quot;flesch_kincaid_grade&quot;,<br>          &quot;gunning_fog&quot;,<br>          &quot;dale_chall_readability_score&quot;<br>        ]<br>      },<br>      &quot;depends_on&quot;: [&quot;doc_quality&quot;]<br>    },<br>    {<br>      &quot;name&quot;: &quot;quality_branching&quot;,<br>      &quot;type&quot;: &quot;branching&quot;,<br>      &quot;config&quot;: {<br>        &quot;branches&quot;: {<br>          &quot;high_quality_branch&quot;: {<br>            &quot;link_name&quot;: &quot;High Quality Documents&quot;,<br>            &quot;criteria_json&quot;: {<br>              &quot;criteria_list&quot;: [<br>                {<br>                  &quot;variable&quot;: &quot;flesch_reading_ease&quot;,<br>                  &quot;operator&quot;: &quot;&gt;&quot;,<br>                  &quot;value&quot;: 60<br>                }<br>              ]<br>            }<br>          },<br>          &quot;low_quality_branch&quot;: {<br>            &quot;link_name&quot;: &quot;Low Quality Documents&quot;,<br>            &quot;criteria_json&quot;: {<br>              &quot;criteria_list&quot;: [<br>                {<br>                  &quot;variable&quot;: &quot;flesch_reading_ease&quot;,<br>                  &quot;operator&quot;: &quot;&lt;=&quot;,<br>                  &quot;value&quot;: 60<br>                }<br>              ]<br>            }<br>          }<br>        }<br>      },<br>      &quot;depends_on&quot;: [&quot;readability&quot;]<br>    },<br>    {<br>      &quot;name&quot;: &quot;ml_enrichment_high_quality&quot;,<br>      &quot;type&quot;: &quot;ml_enrichment&quot;,<br>      &quot;config&quot;: { &quot;doc_column&quot;: &quot;content&quot; },<br>      &quot;depends_on&quot;: [&quot;quality_branching.high_quality_branch&quot;]<br>    },<br>    {<br>      &quot;name&quot;: &quot;sql_filter_low_quality&quot;,<br>      &quot;type&quot;: &quot;sql_filter&quot;,<br>      &quot;config&quot;: {<br>        &quot;criteria_json&quot;: {<br>          &quot;criteria_list&quot;: [<br>            {<br>              &quot;variable&quot;: &quot;docq_total_words&quot;,<br>              &quot;operator&quot;: &quot;&gt;&quot;,<br>              &quot;value&quot;: 0<br>            }<br>          ]<br>        }<br>      },<br>      &quot;depends_on&quot;: [&quot;quality_branching.low_quality_branch&quot;]<br>    }<br>  ]<br>}</pre><p>Notice how the branching operator splits the flow based on whether the Flesch Reading Ease score is above or below 60. High-quality documents get the full ML enrichment treatment, while low-quality documents are filtered with sql_filter to remove empty ones. Both branches eventually get embedded and stored — but in separate indices, so your retrieval system can prioritize the high-quality index.</p><p>This is the kind of sophisticated, production-grade data routing that usually requires hundreds of lines of custom Python. With Docling Pipelines, it’s a JSON file.</p><h3>The Takeaway</h3><p>If you’re building AI applications that consume documents — and in 2026, who isn’t? — data quality isn’t a nice-to-have. It’s the foundation everything else rests on.</p><p>Quality Operators in Docling Pipelines give you a modular, composable toolkit to solve this problem <em>inside</em> your pipeline rather than as an afterthought. They help you:</p><ul><li><strong>Protect</strong> sensitive data with both LLM-powered PII/HAP detection and lightweight regex-based redaction</li><li><strong>Assess</strong> document quality at two levels — quick heuristic checks with doc_quality and deep ML feature extraction with ml_enrichment</li><li><strong>Reduce costs</strong> by eliminating duplicates and low-value content before embedding</li><li><strong>Improve accuracy</strong> by ensuring only clean, readable, correctly-languaged text flows downstream</li><li><strong>Route intelligently</strong> by branching your pipeline based on quality scores</li></ul><p>The best part? They’re open source. You can start using them today.</p><p>👉 <strong>Explore Docling Pipelines on GitHub:</strong> <a href="https://github.com/IBM/docling-pipelines">https://github.com/IBM/docling-pipelines</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ecaa1fbd454" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>