惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
L
LINUX DO - 最新话题
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Forbes - Security
Forbes - Security
博客园 - 司徒正美
Hugging Face - Blog
Hugging Face - Blog
W
WeLiveSecurity
Jina AI
Jina AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
N
News and Events Feed by Topic
V
V2EX
Stack Overflow Blog
Stack Overflow Blog
Engineering at Meta
Engineering at Meta
PCI Perspectives
PCI Perspectives
Martin Fowler
Martin Fowler
T
The Exploit Database - CXSecurity.com
F
Full Disclosure
WordPress大学
WordPress大学
S
Security Affairs
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
SegmentFault 最新的问题
P
Privacy International News Feed
IT之家
IT之家
M
MIT News - Artificial intelligence
G
GRAHAM CLULEY
Hacker News: Ask HN
Hacker News: Ask HN
D
DataBreaches.Net
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
C
Check Point Blog
美团技术团队
Security Latest
Security Latest
Cyberwarzone
Cyberwarzone
N
News and Events Feed by Topic
MyScale Blog
MyScale Blog
H
Help Net Security
宝玉的分享
宝玉的分享
The Hacker News
The Hacker News
The Last Watchdog
The Last Watchdog
The Cloudflare Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
爱范儿
爱范儿
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
I
Intezer
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
AI
AI
I
InfoQ
N
News | PayPal Newsroom
TaoSecurity Blog
TaoSecurity Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
I Built an XAI Agent with Hermes Agent That Explains Any ML Model in Plain English — Here's Everything I Learned
Simran Shaik · 2026-05-18 · via DEV Community

TL;DR: I spent a weekend building XAI-Agent — an autonomous Hermes Agent pipeline that runs real SHAP + LIME analysis on any ML model and generates a plain-English explainability report. This post is everything I learned: how Hermes Agent's multi-step planning actually works, where it surprised me, where it frustrated me, and why I think it's the most underrated open-source agent framework right now.


The Conversation That Started This

Three weeks ago I was in a meeting presenting a RandomForest model I'd trained to predict customer churn. The model was good — 91% accuracy, solid precision-recall curve. I was proud of it.

Then our Head of Product asked: "But why does it predict churn for this specific customer?"

I opened my Jupyter notebook. Showed the SHAP waterfall plot.

She stared at it for five seconds.

"Can you just... tell me in normal words?"

That moment broke something in my brain. I'd spent three days training the model and thirty minutes on explainability. The explainability was useless to the person who needed it most.

So I built XAI-Agent. And in doing so, I learned more about Hermes Agent than I expected.


What Is Hermes Agent, Actually?

Before I get into what I built, let me give you the honest explanation I wish I'd had when I started.

Hermes Agent is an open-source agentic framework built for multi-step autonomous task execution.

That sentence has a lot of words. Here's what it actually means in practice:

Most "AI" tools you interact with are single-shot. You send a prompt, you get a response. Done. The model doesn't remember what it did, doesn't use the output of one step as input to the next, and doesn't make decisions about how to approach a problem.

Hermes Agent does all three of those things.

It gives you:

  • A planning loop — the agent breaks down a task into steps before executing
  • Tool use — distinct callable functions the agent can invoke in sequence
  • Context persistence — output from Tool 1 is available to Tool 2, 3, 4, and 5
  • Autonomous decision-making — the agent decides which tool to use and when, based on what it finds

This sounds abstract. Let me make it concrete with what I actually built.


The Problem I Was Solving (And Why It's Bigger Than You Think)

Explainable AI (XAI) has a dirty secret: the tools exist, but the workflow is broken.

SHAP and LIME are genuinely powerful libraries. But using them requires:

  1. Writing custom Python code for each model type
  2. Knowing which explainer to use (TreeExplainer? KernelExplainer? DeepExplainer?)
  3. Interpreting the numerical output yourself
  4. Translating that into language a non-technical person understands
  5. Running a separate bias audit
  6. Writing a report that combines all of this

That's 4-6 hours of work per model, requiring a data scientist to babysit every step.

And this isn't a niche problem. The EU AI Act requires explainability for high-risk AI. GDPR Article 22 gives EU citizens the right to explanation for automated decisions. US financial regulators require banks to explain ML-based credit decisions.

The demand for XAI is going to explode over the next 3 years. The tools to deliver it efficiently don't exist yet.

That's the gap I built XAI-Agent to fill.


How I Used Hermes Agent to Build It

Here's the part I want to go deep on — because understanding how Hermes Agent enabled this architecture is the most useful thing I can share.

The Core Insight: Tools Are Not Functions

When I first read about Hermes Agent's tool use, I thought of tools as just... functions. Like, the agent calls shap_analyze() and gets back a result.

That mental model is wrong, and it held me back for half a day.

Tools in Hermes Agent are autonomous units of responsibility. Each tool:

  • Has a single, clear job
  • Can access shared agent state (what previous tools discovered)
  • Makes decisions based on that state
  • Produces output that enriches the shared state for future tools

The difference sounds subtle. The impact on architecture is enormous.

Here's what my 5-tool pipeline looks like and, more importantly, why it's designed this way:

class HermesXAIAgent:
    """
    Hermes Agent implementation — 5 autonomous tools
    Each tool feeds context into the next
    """

    def tool_file_reader(self, model_path, dataset_path, target_col):
        """
        TOOL 1: Inspection

        This isn't just 'load the files'. The tool makes decisions:
        - What type of model is this? (affects every downstream tool)
        - What is the task? (classification vs regression)  
        - Is there class imbalance? (affects which samples LIME picks)
        - Which SHAP explainer should Tool 2 use?

        All of this gets stored in self.results for Tools 2-5 to use.
        """
        model = joblib.load(model_path)
        model_type = type(model).__name__  # e.g. "RandomForestClassifier"

        # This decision propagates through the entire pipeline
        task = "classification" if y.nunique() <= 10 else "regression"

        self.results["model_type"] = model_type  # Tool 2 reads this
        self.results["task"] = task               # Tools 3, 4, 5 read this

    def tool_shap_analyzer(self):
        """
        TOOL 2: Global Explainability

        Uses model_type from Tool 1 to auto-select the right explainer.
        A naive implementation would hardcode TreeExplainer.
        This tool makes an intelligent decision.
        """
        model_type = self.results["model_type"]  # Read from Tool 1

        TREE_MODELS = ["RandomForestClassifier", "XGBClassifier", ...]

        if model_type in TREE_MODELS:
            # TreeExplainer: fast, exact, works with tree structure
            explainer = shap.TreeExplainer(model)
        else:
            # KernelExplainer: slower, universal fallback
            explainer = shap.KernelExplainer(model.predict_proba, background)

        # Handle SHAP version incompatibility — this one took me 2 hours
        shap_raw = explainer.shap_values(X_sample)

        if isinstance(shap_raw, list):
            shap_vals = shap_raw[1]           # Old SHAP: list per class
        elif shap_raw.ndim == 3:
            shap_vals = shap_raw[:, :, 1]    # New SHAP: 3D array
        else:
            shap_vals = shap_raw             # Regression: use as-is

        self.results["shap_vals"] = shap_vals  # Tool 5 uses this
        self.results["imp_df"] = importance_df # Tools 3, 5 use this

Enter fullscreen mode Exit fullscreen mode

See how Tool 2 reads model_type from Tool 1's output? And produces imp_df that Tool 5 will use? That's the Hermes Agent planning loop in action. It's not a chain of independent function calls — it's a coherent reasoning process where every step builds on what came before.

The Part That Surprised Me: Fallback Planning

One of the things that makes Hermes Agent genuinely useful in production is that it handles failure gracefully within the planning loop.

In my tool_shap_analyzer, if the primary explainer fails (say, the model doesn't support TreeExplainer), the agent doesn't crash and show an error. It falls back to KernelExplainer, logs which method it used, and continues to Tool 3.

This sounds simple. But it means the agent's output is always a complete report — not a half-finished analysis with an error message in the middle.

That's the difference between a demo and a tool people actually use.

The Part That Frustrated Me: Context Size

Here's something nobody tells you about agentic pipelines: context accumulates fast.

By the time I got to Tool 5 (report_writer), my agent state contained:

  • The full model object
  • The original dataset (569 rows × 31 columns)
  • The SHAP values array (150 samples × 30 features)
  • Three LIME explanation objects
  • Feature importance DataFrames

That's a lot of state to pass around. For my use case (Streamlit + local execution) it was fine. But if you're building a Hermes Agent pipeline for production use with large datasets, you need to think carefully about what you store in self.results vs. what you compute on demand.

My solution: I store only what downstream tools need. The raw SHAP array (large) gets converted to a summary DataFrame (small) before storage. The LIME explanation objects get converted to plain lists immediately.


The Technical Deep Dive: SHAP + Hermes Agent

Let me go deeper on the SHAP integration because this is where the agentic approach really pays off.

Why SHAP Alone Isn't Enough

SHAP gives you this:

worst area                  0.0756
worst concave points        0.0538
mean concave points         0.0503
worst perimeter             0.0489
worst radius                0.0401

Enter fullscreen mode Exit fullscreen mode

That's useful to me. It's useless to my Head of Product.

What she needs is:

"The size of the tumor at its largest measurement ('worst area') is the single most important factor in this model's predictions. When this measurement is high, the model is significantly more likely to predict malignancy. Think of it as the model's primary red flag."

The Hermes Agent pipeline handles this translation. Tool 2 generates the numbers. Tool 5 converts them to prose using model-aware language. The agent knows it's a medical dataset (from the feature names) and calibrates its language accordingly.

The 3D SHAP Array Bug That Will Break Your Code

I want to specifically call this out because it's a real issue that hit me hard and I've seen it break other implementations.

SHAP's output format changed between versions. Older SHAP returns:

# Old SHAP (< 0.40): list of arrays, one per class
shap_values = [array_class_0, array_class_1]  # each: (n_samples, n_features)

Enter fullscreen mode Exit fullscreen mode

Newer SHAP (0.44+) returns:

# New SHAP (>= 0.44): single 3D array
shap_values  # shape: (n_samples, n_features, n_classes)

Enter fullscreen mode Exit fullscreen mode

If you write naive code like shap_values[1] to get class 1, it works on old SHAP and silently returns wrong results (a column, not a matrix) on new SHAP.

The Hermes Agent approach of having a dedicated tool_shap_analyzer with explicit version handling is what caught this. Because the tool is isolated, I could add this logic cleanly:

if isinstance(shap_raw, list):
    sv = shap_raw[1] if len(shap_raw) > 1 else shap_raw[0]
elif hasattr(shap_raw, 'ndim') and shap_raw.ndim == 3:
    sv = shap_raw[:, :, 1]  # New SHAP: take class 1 slice
else:
    sv = shap_raw  # Regression or binary

Enter fullscreen mode Exit fullscreen mode

This is a good example of why agentic tool isolation matters. If my SHAP analysis was one giant function, this fix would be buried in 200 lines of code. As a distinct tool, it's 10 lines, clearly documented, easy to test independently.


Hermes Agent vs. Other Agentic Frameworks

I know some of you are thinking: "Why Hermes Agent? Why not LangChain, AutoGen, or CrewAI?"

Fair question. Here's my honest take after building this:

LangChain

LangChain is powerful but opinionated. It works best when you're chaining LLM calls together. For my use case — where the "tools" are Python scientific computing libraries, not LLM endpoints — LangChain felt like overkill. I'd be fighting its abstractions rather than using them.

Use LangChain when: You're primarily chaining LLM calls, doing RAG, or need the massive ecosystem of pre-built integrations.

Use Hermes Agent when: You want clean, explicit tool definitions where you control exactly what runs and when.

AutoGen

AutoGen's multi-agent conversation model is fascinating but complex. For a pipeline where the execution order is deterministic (always: inspect → SHAP → LIME → bias → report), AutoGen's flexibility is unnecessary complexity.

Use AutoGen when: You need agents to negotiate with each other, have non-deterministic execution paths, or are building multi-agent debate systems.

Use Hermes Agent when: You have a clear sequential task where each step has defined inputs and outputs.

CrewAI

CrewAI is probably the closest conceptually — role-based agents with tool access. The main difference I found: Hermes Agent gives you more direct control over the planning loop. In CrewAI, the "crew" model adds abstraction that I didn't need.

Use CrewAI when: You want to model your problem as a team of specialized agents with roles and delegation.

Use Hermes Agent when: You want to own the planning logic explicitly and aren't sure yet what "roles" make sense for your problem.

My Honest Assessment

Hermes Agent's sweet spot is deterministic multi-step pipelines where you care about exactly what runs. Scientific computing, data analysis, document processing, code generation — anything where you can define clear tool responsibilities and want explicit control over the execution flow.

It's not trying to be everything. That's actually its strength.


What I'd Build Next

After spending a weekend with Hermes Agent, here's what I'm thinking about:

Counterfactual explanations. The natural next question after "why did the model predict X?" is "what would need to change to get a different prediction?" Hermes Agent would add a Tool 6 for this — using DiCE (Diverse Counterfactual Explanations) to generate "if your tumor's worst area had been 15% smaller, the model would have predicted benign."

Neural network support. Right now XAI-Agent handles tree models and most sklearn models. Adding SHAP DeepExplainer for PyTorch/TensorFlow would open up the majority of production models running in industry right now.

CI/CD integration. The most powerful version of this isn't a web app — it's a tool that runs automatically every time a model is retrained, generates a comparison report (did the important features change? did bias metrics shift?), and posts it as a GitHub PR comment.


The Bigger Picture: Why Open-Source Agents Matter

I want to end with something that's been on my mind since I started building this.

XAI platforms from companies like Fiddler AI, Arize, and Arthur AI are excellent. They're also $30K–$100K+ per year. A startup, a researcher, a solo developer, a nonprofit building AI for healthcare in a developing country — none of them can afford that.

The open-source AI agent ecosystem is the equalizer.

Hermes Agent running SHAP + LIME locally, generating a downloadable report, requiring nothing beyond a Python environment — that's accessible to anyone with a laptop.

As AI becomes more embedded in consequential decisions (loan approvals, medical diagnoses, hiring, parole, content moderation), the ability to explain and audit those decisions cannot be a luxury that only well-funded companies can afford.

Open, capable agent systems like Hermes Agent aren't just technically interesting. They're the infrastructure for making AI accountability universal.

That's why I built XAI-Agent. That's why I'm writing about Hermes Agent. And that's why I think the work this community is doing with open-source agents genuinely matters.


Try It Yourself

GitHub: github.com/SimranShaikh20/xai-agent

git clone https://github.com/SimranShaikh20/xai-agent
cd xai-agent
pip install -r requirements.txt
streamlit run app.py

Enter fullscreen mode Exit fullscreen mode

Test files (sample_model.pkl + sample_dataset.csv) are included. Full analysis in under 3 minutes.


Questions I'd Love to Discuss

I'm genuinely curious about the community's experience:

  • Have you used Hermes Agent on something other than text/LLM tasks? What was the use case?
  • How do you handle context accumulation in long agentic pipelines?
  • What explainability features would make XAI-Agent actually useful for your work?

Drop them in the comments — I read and respond to everything 👇


Built for the DEV Hermes Agent Challenge — May 2026

Tags: #hermesagentchallenge #agents #ai #machinelearning #explainableai #opensource #python #streamlit