Don't feed full HTML: how an agent fixes internal links without hallucination
cneuralnetwork · x · 2026-09-21
Developer @pujasr22 shared their work building agent tooling for SEO agency Enfra: when their agent refreshes content on a client's WordPress site, updating internal links triggers LLM hallucinations, broken images and injected plain links.
- Approach: stop giving the LLM the full HTML of every post.
- How: bs4 parses HTML into a tree; a first filter keeps only text-bearing tags (p, li, h2-h6) for the model to touch, while tags like img and figure go into another bucket that stays byte-identical after all operations.
- Result: the LLM only edits the text nodes it should, so structure and media stay unpolluted — eliminating hallucination damage at the source.
More from coding & agent
- GitHub Copilot App uninstall leaves MCPs, plugins and old versions behind — PaulShellDev · 2026-09-21
- Dev uses small model to triage resumes, cutting tokens so much it's given away free — draginol · 2026-09-21
- HF researcher: doing is harder than criticising — agent workflows should leverage both roles — antoine_chaffin · 2026-09-21
- The coding AI consensus has flipped: the crowd that moved to Claude Code is now on Codex — BLUECOW009 · 2026-09-21
- TypeSafe's Jev Cut Grok Build Costs 22-40% on the Same Tasks — Daniel_Farinax · 2026-09-21
- jev-skill-suggester: a lightweight pre-execution skill router stops agents picking wrong tools — udmrzn · 2026-09-21