Skip to content

guyjames/a0-chat-export

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chat Export Plugin

Export full Agent Zero chat conversations in multiple formats.

Supported Formats

Format Extension Description
Markdown .md Clean markdown with metadata header
Plain Text .txt Stripped of markdown formatting
PDF .pdf Via pandoc + XeLaTeX
Word .docx Microsoft Word format
HTML .html Standalone HTML
EPUB .epub E-book format
LaTeX .tex LaTeX source
reStructuredText .rst Sphinx/RST format
OpenDocument .odt LibreOffice Writer
Rich Text .rtf Rich Text Format

Features

Full / Clean Mode

The export dropdown includes a Full / Clean toggle:

  • Full — exports everything: user messages, assistant responses, agent thinking, code execution, system messages
  • Clean — exports only User and Assistant messages, stripping out all internal processing details

Smart Content Formatting

  • User and assistant messages rendered naturally
  • Agent entries show headline, thoughts summary, and tool calls
  • Code execution entries wrapped in code blocks with cleaned headings
  • System/utility progress messages filtered out
  • Metadata header with chat name, creation date, and export date

Graceful Fallback

  • Markdown (.md) and Plain Text (.txt) work without pandoc
  • If pandoc is missing, other formats automatically fall back to .md

Usage

  1. Open a chat in the Agent Zero web UI
  2. Click the Export button in the bottom action bar (next to Pause Agent / Nudge)
  3. Choose Full or Clean mode
  4. Select your desired format
  5. The file downloads automatically

Requirements

  • pandoc must be installed for PDF, DOCX, EPUB, LaTeX, RST, ODT, RTF export
  • texlive-xetex is needed for PDF output
  • Markdown (.md) and Plain Text (.txt) work without pandoc

Installation

The plugin installs automatically when placed in /a0/usr/plugins/chat_export/. If pandoc is not installed:

apt-get install -y pandoc texlive-xetex texlive-fonts-recommended

Architecture

chat_export/
├── plugin.yaml              # Plugin metadata
├── README.md                # This file
├── webui/
│   └── thumbnail.png        # Plugin icon
├── api/
│   └── export_chat.py       # Backend API handler
└── extensions/
    └── webui/
        └── chat-input-bottom-actions-start/
            └── export-button.html  # Frontend button + dropdown
  • api/export_chat.py — Backend API handler that reads chat.json, converts to Markdown, then uses pandoc for format conversion
  • extensions/webui/chat-input-bottom-actions-start/export-button.html — Frontend button with format dropdown, placed in the chat bottom action bar
  • plugin.yaml — Plugin metadata

API Endpoint

POST /plugins/chat_export/export_chat

Parameters:

  • context (string, required) — Chat ID
  • format (string, required) — One of: md, txt, pdf, docx, html, epub, tex, rst, odt, rtf
  • clean (boolean, optional) — If true, export only user and assistant messages (default: false)

Response: File download with appropriate Content-Type and Content-Disposition headers.

Export File Naming

Exported files are named: <chat-name>-<date>.<ext>

  • Chat name is sanitized for filesystem compatibility
  • Date is in YYYYMMDD format (UTC)

About

Agent Zero plugin: Export chat conversations to multiple document formats via pandoc

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors