A robust Python-based conversion pipeline designed to liberate your AI conversations from proprietary "walled gardens" and transform them into future-proof, searchable Markdown files for your Obsidian PKM system.
Most AI platforms treat your data as a secondary concern. This tool allows you to:
- Own your data: Move from proprietary JSON/HTML to local Markdown.
- Centralize Research: Search across ChatGPT, Claude, and Gemini in a single Obsidian vault.
- Maintain Context: Preserve complex elements like ChatGPT’s branching trees, Claude’s "extended thinking," and Gemini’s image assets.
| Provider | Export Method | Notes |
|---|---|---|
| ChatGPT | Native JSON | Export Handles complex tree-traversal and local asset mapping. |
| Claude | Native JSON | Export Supports "thinking" blocks, tool use, and embedded Base64 images. |
| Gemini | Manual WebArchive | Extracts HTML from .webarchive files and downloads high-res CDN images. |
The system is built on an extensible, object-oriented architecture:
bin/providers/base.py: Abstract base class for all converters.bin/providers/: Specific implementations for parsing and data cleaning.- Schema Fingerprinting: Automatically detects changes in provider export formats to prevent data loss.
- Python 3.10+
pip install beautifulsoup4 python-magic
- Clone the repository: git clone https://github.com/[your-username]/ai-chat-obsidian.git
- Place your raw exports in the providers/ directory following the structure defined in the blog post.
- Run the master converter:
python main.py --allFiles are formatted for immediate use in Obsidian with:
- YAML Frontmatter: Includes provider tags and
relatedTofields. In my PKM, a modification of the PARA method, I use this to link this specific file toAreaorProjector other organizational items (e.g.,Resources/PeopleorResrouces/OrganizationsorTeaching/ClassXYZ. - Visual Distinction: User messages are formatted as blockquotes.
- Asset Integration: Images are automatically saved to
attachments/and linked via Wiki-links. In my Obsidian vault, I keep all my attachments in theResources/Attachmentsfolder.
As AI providers frequently change their export schemas, contributions are welcome! Please refer to CLAUDE.md for coding standards and guide-rails for adding new providers. This was vibecoded with Claude Code.