agent-html
Turn structured agent output into polished, self-contained HTML artifacts.
One conversation in. One shareable HTML file out.
Why
AI conversations are great for exploration but terrible for sharing. Chat transcripts are long, unstructured, and die in the thread. agent-html gives you a one-line way to turn any structured data into a professional, self-contained HTML report that anyone can open.
Works with any agent framework: LangGraph, OpenAI Agents, Claude Code, CrewAI, or plain Python.
Install
pip install agent-html
Quick Start
from agent_html import Report, Section
report = Report(
title="Weekly Summary",
subtitle="Engineering — Aug 14-21, 2026",
metadata={"messages": 142},
)
report.add_section(Section(
title="Overview",
content="Team focused on infrastructure stability after the outage.",
style="highlight",
))
report.add_section(Section(
title="Decisions",
icon="✅",
items=["Shut down UAE region", "Migrate to EU-West by Q3"],
))
report.add_section(Section(
title="Architecture",
mermaid="graph TD\n A[Client] --> B[Gateway] --> C[Service]",
))
report.save("summary.html")
Output: a single summary.html file with all CSS/JS inlined. No external dependencies. Double-click to open.
CLI
# From JSON
agent-html render --input data.json --output report.html
# From Markdown
agent-html render --input notes.md --title "Design Review" --output report.html
# Dark theme
agent-html render --input data.json --theme dark --output report.html
# Pipe from stdin
echo '{"title":"Quick","sections":[{"title":"Note","content":"Hello"}]}' | agent-html render --stdin --output note.html
# Preview server
agent-html serve ./reports/
Features
- Single-file output — all CSS/JS inlined, no external deps
- Themes — light, dark, or auto (respects system preference)
- Mermaid diagrams — flowcharts, sequence diagrams, state machines
- Syntax highlighting — language-aware code blocks with copy button
- Table of contents — auto-generated with scroll-spy
- Collapsible sections —
<details>/<summary>for long content - Callout blocks — note, warning, danger, tip
- Tables — from structured data
- Badges/pills — for tags, participants, status
- Print-optimized — clean PDF via browser print
- Accessible — semantic HTML, ARIA labels, keyboard nav
Section Styles
Section(title="Info", content="...", style="highlight") # Accent-bordered
Section(title="Note", content="...", style="callout-note") # Blue info box
Section(title="Warn", content="...", style="callout-warning") # Yellow warning
Section(title="Error", content="...", style="callout-danger") # Red danger
Section(title="Tip", content="...", style="callout-tip") # Green tip
Section(title="Tasks", items=[...], style="checklist") # Checkbox list
Integration Examples
LangGraph / LangChain Tool
from langchain_core.tools import tool
from agent_html import Report, Section
@tool
def create_report(title: str, sections: list[dict]) -> str:
"""Generate a shareable HTML report."""
report = Report(title=title)
for s in sections:
report.add_section(Section(**s))
report.save(f"/tmp/reports/{report.id}.html")
return f"Report: http://localhost:8080/reports/{report.id}"
FastAPI
from fastapi.responses import HTMLResponse
from agent_html import Report, Section
@app.post("/reports")
async def create(data: ReportRequest):
report = Report(title=data.title)
for s in data.sections:
report.add_section(Section(**s.dict()))
return HTMLResponse(report.to_html())
JSON Input Format
{
"title": "My Report",
"subtitle": "Optional subtitle",
"metadata": {"key": "value"},
"sections": [
{"title": "Overview", "content": "Markdown content here", "style": "highlight"},
{"title": "Items", "items": ["one", "two", "three"], "icon": "📋"},
{"title": "Diagram", "mermaid": "graph TD\n A --> B"},
{"title": "Code", "code": "print('hello')", "code_language": "python"},
{"title": "Table", "table": {"headers": ["A","B"], "rows": [["1","2"]]}}
]
}
Inspiration
Built on ideas from:
- ThariqS/html-effectiveness (Apache-2.0) — demonstrating HTML as an AI output medium
- The "Unreasonable Effectiveness of HTML" thesis by Thariq Shihipar
License
Apache-2.0
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_html-0.1.1.tar.gz.
File metadata
- Download URL: agent_html-0.1.1.tar.gz
- Upload date:
- Size: 31.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3b875ea5cdb3cb1fdda45c769dafdb1b1d8c61c7f0f0ac796a1195dd0b7c808
|
|
| MD5 |
8ebbfabaa0953d9183fd8843cabd0bb1
|
|
| BLAKE2b-256 |
7c912bda5d4284d7f869a31c74bb13242df48813d88223be2956d6796651628a
|
Provenance
The following attestation bundles were made for agent_html-0.1.1.tar.gz:
Publisher:
release.yml on breathOfTech/agent-html
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_html-0.1.1.tar.gz -
Subject digest:
a3b875ea5cdb3cb1fdda45c769dafdb1b1d8c61c7f0f0ac796a1195dd0b7c808 - Sigstore transparency entry: 2556613980
- Sigstore integration time:
-
Permalink:
breathOfTech/agent-html@bd6c3b3ed0ecfba5b415a31eaec772fdcb4792e1 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/breathOfTech
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bd6c3b3ed0ecfba5b415a31eaec772fdcb4792e1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file agent_html-0.1.1-py3-none-any.whl.
File metadata
- Download URL: agent_html-0.1.1-py3-none-any.whl
- Upload date:
- Size: 24.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92ea9e6a63550e4227ede648ed60122b71be8a3a1e142c85404b02c08edb146b
|
|
| MD5 |
69a7f26aa5c9cd0a018e8973923baa28
|
|
| BLAKE2b-256 |
682e04f74ff76806617d422a575531446d842eb3f1e697195d7d29c507eaa37b
|
Provenance
The following attestation bundles were made for agent_html-0.1.1-py3-none-any.whl:
Publisher:
release.yml on breathOfTech/agent-html
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_html-0.1.1-py3-none-any.whl -
Subject digest:
92ea9e6a63550e4227ede648ed60122b71be8a3a1e142c85404b02c08edb146b - Sigstore transparency entry: 2556614016
- Sigstore integration time:
-
Permalink:
breathOfTech/agent-html@bd6c3b3ed0ecfba5b415a31eaec772fdcb4792e1 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/breathOfTech
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bd6c3b3ed0ecfba5b415a31eaec772fdcb4792e1 -
Trigger Event:
push
-
Statement type: