[{"content":"I want to introduce a new concept: Expert-in-the-Loop (EITL). Instead of a human reviewing every AI decision, a deterministic expert system sits alongside the LLM \u0026ndash; reasoning over facts, enforcing policies, and predicting outcomes. The LLM handles conversation and intent. Expert system handles knowledge and inference. They have to work together.\nThe Problem with Human-in-the-Loop In today\u0026rsquo;s world, the phrase \u0026ldquo;Human-in-the-Loop (HITL)\u0026rdquo; comes up more and more often. I am against this idea. In this decision-making paradigm, the human remains the part that slows down the process, slows down decision-making, and creates a new level of performance problems in the system.\nAI has proven its ability to work 24/7 without weekends, to analyze and process massive datasets \u0026ndash; but it waits for a human (an expert?) to press the approve button.\nSociety fears changes to the world it\u0026rsquo;s accustomed to, and looks for some kind of switch that will make decisions, that will add humanity to those decisions. How bad is that? I believe there\u0026rsquo;s no great sense in it. Let\u0026rsquo;s look at a simple example.\nA Real-World Example A team of 6 developers uses AI tools for their work. They generate up to 20-30 pull requests per day. The company, understanding that such changes in production could trigger an avalanche of bugs or alter system behavior for end users, introduces Human-in-the-Loop (HITL) for pull request review.\nIs the business logic correct? Undoubtedly \u0026ndash; there should be a person who makes the decision and takes responsibility for it. But this also means that 2-3 senior developers will spend every day reviewing pull requests generated by AI. Of course, they\u0026rsquo;ll also use AI tools for the review. But in the end, it comes down to AI checking AI, with a human approving \u0026ndash; guided by that very same AI.\nIs there a human in the loop here? Legally, yes. But in practice, no.\nAnd this is just one real-life example. The same thing happens in everyday life \u0026ndash; reviewing contracts, agreements. AI is entering our lives, even bursting in.\nWhat Does Expert-in-the-Loop (EITL) Propose? It proposes removing the human from decision-making entirely.\nMadness? Perhaps. But well-described rules that rely on documentation, that can be verified, and that are written by humans \u0026ndash; are far more effective than the humans themselves. They don\u0026rsquo;t need rest. They don\u0026rsquo;t need vacations.\nLet\u0026rsquo;s take our example above. 3-4 senior engineers describe how code review should work using clear rules. For example (Talon language):\ndefine \u0026#34;small_change\u0026#34; { \u0026#34;pr.lines_changed\u0026#34; \u0026lt; 50 \u0026#34;pr.files_changed\u0026#34; \u0026lt; 5 } define \u0026#34;critical_path\u0026#34; { \u0026#34;pr.touches_auth\u0026#34; == true or \u0026#34;pr.touches_payments\u0026#34; == true or \u0026#34;pr.touches_database_schema\u0026#34; == true or \u0026#34;pr.touches_infrastructure\u0026#34; == true } define \u0026#34;has_module_docs\u0026#34; { \u0026#34;module.documentation_url\u0026#34; != \u0026#34;\u0026#34; } define \u0026#34;ui_change\u0026#34; { \u0026#34;pr.touches_css\u0026#34; == true or \u0026#34;pr.touches_components\u0026#34; == true or \u0026#34;pr.touches_templates\u0026#34; == true or \u0026#34;pr.touches_assets\u0026#34; == true } // ── Auto-approve ──────────────────────────────────────── rule \u0026#34;Auto-approve safe changes\u0026#34; { when is \u0026#34;small_change\u0026#34; and \u0026#34;pr.tests_passing\u0026#34; == true and \u0026#34;pr.has_description\u0026#34; == true and not is \u0026#34;critical_path\u0026#34; and not is \u0026#34;ui_change\u0026#34; do approve \u0026#34;pr\u0026#34; do emit \u0026#34;notify_author\u0026#34; } // ── LLM documentation review ──────────────────────────── rule \u0026#34;Verify code matches documentation\u0026#34; { when \u0026#34;pr.files_changed\u0026#34; changes and is \u0026#34;has_module_docs\u0026#34; do llm_review \u0026#34;module.documentation_url\u0026#34; \u0026#34;pr.diff\u0026#34; } rule \u0026#34;Block when code contradicts documentation\u0026#34; { when \u0026#34;llm_review.result\u0026#34; == \u0026#34;mismatch\u0026#34; do block \u0026#34;pr.merge\u0026#34; do comment \u0026#34;pr\u0026#34; \u0026#34;llm_review.explanation\u0026#34; } rule \u0026#34;Approve when code matches documentation\u0026#34; { when \u0026#34;llm_review.result\u0026#34; == \u0026#34;match\u0026#34; and \u0026#34;pr.tests_passing\u0026#34; == true and not is \u0026#34;critical_path\u0026#34; do approve \u0026#34;pr\u0026#34; } // ── Critical paths — always human ─────────────────────── rule \u0026#34;Require human review for critical paths\u0026#34; { when is \u0026#34;critical_path\u0026#34; do require \u0026#34;review.senior_engineer\u0026#34; do assign \u0026#34;pr\u0026#34; \u0026#34;team.senior_oncall\u0026#34; do comment \u0026#34;pr\u0026#34; \u0026#34;This PR touches critical infrastructure — requires human approval\u0026#34; } rule \u0026#34;Require human review for large PRs\u0026#34; { when \u0026#34;pr.lines_changed\u0026#34; \u0026gt; 500 do require \u0026#34;review.human\u0026#34; do comment \u0026#34;pr\u0026#34; \u0026#34;Large change — automatic approval disabled\u0026#34; } // ── UI changes — deploy, screenshot, notify designers ─── rule \u0026#34;Deploy preview for UI changes\u0026#34; { when is \u0026#34;ui_change\u0026#34; and \u0026#34;pr.tests_passing\u0026#34; == true do deploy_preview \u0026#34;pr\u0026#34; } rule \u0026#34;Take screenshots after preview deployed\u0026#34; { when \u0026#34;preview.status\u0026#34; == \u0026#34;deployed\u0026#34; and is \u0026#34;ui_change\u0026#34; do screenshot \u0026#34;preview.url\u0026#34; 375 667 do screenshot \u0026#34;preview.url\u0026#34; 768 1024 do screenshot \u0026#34;preview.url\u0026#34; 1440 900 do screenshot \u0026#34;preview.url\u0026#34; 1920 1080 } rule \u0026#34;Notify designers when screenshots ready\u0026#34; { when \u0026#34;screenshots.status\u0026#34; == \u0026#34;ready\u0026#34; and is \u0026#34;ui_change\u0026#34; do require \u0026#34;review.design_team\u0026#34; do notify \u0026#34;team.designers\u0026#34; \u0026#34;screenshots.gallery_url\u0026#34; do comment \u0026#34;pr\u0026#34; \u0026#34;UI changes detected — screenshots at {screenshots.gallery_url}. Design team review required.\u0026#34; } rule \u0026#34;Designer approved UI changes\u0026#34; { when \u0026#34;review.design_team.approved\u0026#34; == true and \u0026#34;pr.tests_passing\u0026#34; == true and not is \u0026#34;critical_path\u0026#34; do approve \u0026#34;pr\u0026#34; } // ── Security ──────────────────────────────────────────── rule \u0026#34;Security review for new dependencies\u0026#34; { when \u0026#34;pr.new_dependencies\u0026#34; \u0026gt; 0 do require \u0026#34;review.security_team\u0026#34; do scan_dependencies \u0026#34;pr\u0026#34; do comment \u0026#34;pr\u0026#34; \u0026#34;New dependencies added — security review required\u0026#34; } rule \u0026#34;Block vulnerable dependencies\u0026#34; { when \u0026#34;dependency_scan.vulnerabilities\u0026#34; \u0026gt; 0 do block \u0026#34;pr.merge\u0026#34; do comment \u0026#34;pr\u0026#34; \u0026#34;dependency_scan.report_url\u0026#34; } // ── Block incomplete ──────────────────────────────────── rule \u0026#34;Block incomplete PRs\u0026#34; { when \u0026#34;pr.has_description\u0026#34; == false or \u0026#34;pr.tests_passing\u0026#34; == false or \u0026#34;pr.lint_passing\u0026#34; == false do block \u0026#34;pr.merge\u0026#34; do comment \u0026#34;pr\u0026#34; \u0026#34;PR is missing requirements: description, passing tests, and lint\u0026#34; } Looks much simpler than having a human review everything, doesn\u0026rsquo;t it?\nThe Result AI can work autonomously on bug fixes, add features based on data, and not involve a human in decision-making when one isn\u0026rsquo;t needed. After all, a programmer doesn\u0026rsquo;t think about how the low-level layer works when writing in Ruby, Java, TypeScript, or any other high-level language. So why do we need to think about AI\u0026rsquo;s work when it doesn\u0026rsquo;t touch a critical system path? When it\u0026rsquo;s just a typo fix, or a UI change, or just renaming a field?\nThe same solutions can be integrated in other domains \u0026ndash; language models understand the rules perfectly well. But can they make decisions? Of course not. A language model is not immune to errors. But expert rules provide a 100% guarantee against mistakes.\nConsider healthcare. An LLM can summarize patient records, extract symptoms from natural language, and draft preliminary assessments. But should it decide on a treatment plan? Absolutely not. An expert system, however, built on validated medical protocols and drug interaction databases, can enforce that no contraindicated medication is ever prescribed. The LLM does the reading. The expert system does the reasoning. The doctor writes the rules once \u0026ndash; and they apply to every patient, every time, without fatigue or oversight.\nInsurance is another clear case. Claim processing involves parsing documents, extracting data, and matching it against policy terms. LLMs excel at the first two tasks. But the decision to approve or deny a claim must follow regulatory rules precisely. An expert system encoded with those rules will never misinterpret a policy clause at 3 AM on a Friday. It won\u0026rsquo;t skip a step because it\u0026rsquo;s overwhelmed with volume. Every claim gets the same rigorous, deterministic evaluation.\nLegal contract review follows the same pattern. An LLM can read a 200-page contract and highlight unusual clauses in seconds. But determining whether those clauses violate company policy or regulatory requirements? That\u0026rsquo;s where expert rules shine. A legal team defines what\u0026rsquo;s acceptable and what\u0026rsquo;s not. The expert system enforces those boundaries across every contract, every vendor, every jurisdiction \u0026ndash; consistently and instantly.\nFinancial compliance is perhaps the most obvious application. Anti-money laundering, KYC verification, transaction monitoring \u0026ndash; these processes require both the pattern recognition that AI provides and the deterministic rule enforcement that regulations demand. An LLM might flag a suspicious transaction. But the decision to block it, report it, or escalate it must follow exact regulatory rules. There\u0026rsquo;s no room for \u0026ldquo;probably\u0026rdquo; in compliance.\nThe core insight is this: LLMs are powerful tools for understanding and generating language, for pattern recognition and data processing. But they are fundamentally probabilistic \u0026ndash; they predict the most likely next token, not the correct answer. Expert systems are the opposite. They are deterministic \u0026ndash; given the same inputs and rules, they always produce the same output. Combining the two creates something neither can achieve alone: a system that understands the messy, unstructured real world through AI, and makes precise, auditable, guaranteed-correct decisions through expert rules. That is what Expert-in-the-Loop (EITL) is about.\nFurther Reading Expert in the Loop: Why AI Needs Specialists, Not Just Humans ","permalink":"http://opakalex.github.io/posts/expert-in-the-loop/","summary":"Why Human-in-the-Loop (HITL) is a bottleneck, and how Expert-in-the-Loop (EITL) with deterministic expert systems alongside LLMs offers a better paradigm for AI-driven decision making.","title":"Expert in the Loop (EITL)"},{"content":"A selection of my open source work on GitHub and OpenTalon.\nAI / Expert System OpenTalon \u0026ndash; AI enterprise orchestration eco system Talon Language \u0026ndash; Expert system programming language OpenTalon Kubernetes \u0026ndash; Kubernetes operator for deploying and managing AI agent instances with production-grade security and observability Elixir Tirexs \u0026ndash; Elasticsearch client and DSL for Elixir couch_gears \u0026ndash; A better way for extending CouchDB than httpd_db_handlers couch_normalizer \u0026ndash; Data migration appliance that works inside CouchDB node ","permalink":"http://opakalex.github.io/projects/","summary":"Open source projects and contributions","title":"Open Source Projects"}]