chat-auto-exporter

Public

Forked from promptpirate/chat-auto-exporter

Плагин LM Studio, который автоматически экспортирует ваши разговоры в чате в файлы .md (Markdown) - идеально подходит для создания архива с возможностью поиска, подачи в конвейеры RAG или просто ведения аккуратной записи ваших чатов LLM.

32 Downloads

2 stars

1 fork

README

📝 Chat Auto-Exporter

An LM Studio plugin that automatically exports your chat conversations to .md (Markdown) files — perfect for building a searchable archive, feeding into RAG pipelines, or just keeping a tidy record of your LLM chats.

How It Works

The plugin quietly watches your conversations in the background. Every time the total message count hits a threshold (default: 10 messages), it writes the entire chat to a Markdown file in a folder you choose.

  • User + Assistant messages both count toward the threshold
  • Same chat = same file — re-exports overwrite the previous version, so you always have the latest snapshot without duplicates
  • Different chats get separate files, each stamped with the date/time the conversation started
  • System prompts and tool calls are excluded to keep exports clean and readable

Installation

Install directly from the LM Studio Hub:

Run in LM Studio

Or install via the CLI:

lms install local/chat-auto-exporter

Setup

  • Open LM Studio and go to the Plugins tab
  • Find chat-auto-exporter and enable it
  • Open the plugin settings and configure:
    • Export Folder — the full path where .md files will be saved (e.g. D:\My Chat Exports)
    • Message Threshold — how many messages trigger an export (default: 10)

That's it! Start chatting and your conversations will be exported automatically.

Exported File Format

Files are named with a sortable date prefix and a unique chat fingerprint:

2026-05-03_1430_chat-a3f9b2c1.md
2026-05-03_1502_chat-f7e2d019.md
2026-05-04_0900_chat-a3f9b2c1.md  ← same chat, updated content

Sorting by filename = chronological order. The fingerprint is derived from the first message in each chat, so the same conversation always maps to the same file.

Each exported file looks like:

# Chat Export

*Exported on: 2026-05-03 14:30:00*
*Messages: 10*

---

### 🧑 User

What is the meaning of life?

---

### 🤖 Assistant

That's a profound question...

---

Great For

  • RAG pipelines — point your retrieval system at the export folder for searchable chat history
  • Obsidian / note-taking — export directly into your vault
  • Archiving — keep a clean record of every significant conversation
  • Training data — collect structured conversation logs

Development

Clone and run in dev mode:

cd chat-auto-exporter
npm install
lms dev

The dev server watches for code changes and hot-reloads the plugin automatically.

Project Structure

chat-auto-exporter/
├── manifest.json              ← plugin metadata
├── package.json               ← dependencies
├── tsconfig.json              ← TypeScript config
└── src/
    ├── index.ts               ← entry point (wires everything up)
    ├── config.ts              ← settings UI schema (export folder + threshold)
    └── promptPreprocessor.ts  ← core logic (count, format, export)

License

UNLICENSED