1
0
Fork
You've already forked Summarizer
0
No description
  • Python 91.4%
  • TypeScript 4.8%
  • CSS 3.4%
  • HTML 0.4%
2026年05月07日 19:57:15 +02:00
converter_linux Remove prints() (esp inline updates), replace with logs 2026年04月20日 09:49:46 +02:00
converter_macos Remove prints() (esp inline updates), replace with logs 2026年04月20日 09:49:46 +02:00
migration fix 2026年04月12日 19:17:36 +02:00
summarizer_core cln 2026年04月20日 13:43:41 +02:00
summarizer_gc_gemma4_31b backoff strat fix 2026年04月21日 10:03:28 +02:00
summarizer_linux description fix 2026年05月07日 19:57:15 +02:00
summarizer_macos description fix 2026年05月07日 19:57:15 +02:00
tests Major refact by claude opus 4.6 2026年04月12日 19:10:03 +02:00
web-interface Fix security issues 2026年04月05日 18:34:03 +02:00
.gitignore ong refact 2026年04月09日 16:32:17 +02:00
.python-version Initial 2026年04月03日 10:07:17 +02:00
calibre_sync.py rem gem's broken sigs 2026年04月16日 12:37:50 +02:00
naming.py fix 2026年04月12日 19:17:36 +02:00
OldSummarizerAgent.py ong refact 2026年04月09日 16:32:17 +02:00
pyproject.toml Shutdown handling fixed 2026年04月18日 15:34:50 +02:00
README.md docs: update README to focus on calibre_sync and summarizer_sync 2026年04月23日 09:01:01 +02:00
summarizer_sync.py Shutdown handling fixed 2026年04月18日 15:34:50 +02:00
uv.lock Shutdown handling fixed 2026年04月18日 15:34:50 +02:00
wiki_naming_and_synchronisation.md draft 2026年04月12日 08:36:17 +02:00

📚 Document Summarizer

A powerful, distributed document processing and summarization pipeline optimized for high-quality AI-generated summaries. This system synchronizes a Calibre library with a Markdown-based knowledge base and generates comprehensive summaries using Gemma 4 models.

Features

  • 🔄 Two-Phase Synchronization: Robust "Plan then Execute" architecture ensuring data integrity and reliable state management.
  • 🏗️ Distributed Architecture: Separates document conversion from summarization, allowing for parallel processing and platform-specific optimizations.
  • 🧠 Gemma 4 Summarization: Uses state-of-the-art Gemma 4 models with support for "Thinking Mode" and Map-Reduce strategies for large documents.
  • 🛠️ Multi-Format Support:
    • Docling: High-fidelity conversion for PDFs (including math/ArXiv), DOCX, PPTX, and XLSX.
    • Pandoc: Clean EPUB-to-Markdown conversion.
  • Parallel Processing: Built-in concurrency support for both conversion and summarization phases.
  • 🔗 Wiki-Ready Naming: Automatic generation of deterministic, 80-character capped filenames compatible with modern wikis (e.g., Obsidian).
  • 💾 Work Caching: Persistent hash-based caching to prevent redundant work and allow resuming interrupted tasks.

🚀 Getting Started

Prerequisites

  • Python 3.10+ (recommended with uv)
  • Pandoc (for EPUB support)
  • macOS (Apple Silicon) or Linux for summarization engines.

Installation

git clone https://codeberg.org/domschl/Summarizer.git
cd Summarizer
uv sync

🛠️ Core Components

1. Calibre Sync (calibre_sync.py)

Orchestrates the conversion of books from your Calibre library into a Markdown-based repository. It extracts metadata, preserves covers (as icons), and converts documents using the best available tool for each format.

Usage:

uv run calibre_sync.py [--concurrency N] [--dry-run]
  • --concurrency: Number of parallel conversion processes.
  • --dry-run: Scans the library and shows the sync plan without making changes.

2. Summarizer Sync (summarizer_sync.py)

Orchestrates the summarization of the Markdown repository. It compares the current state of summaries with the source Markdown files and dispatches summarization tasks to the configured AI engine.

Usage:

uv run summarizer_sync.py [--concurrency N] [--dry-run]
  • --concurrency: Number of parallel summarization processes.
  • --dry-run: Scans source Markdown files and shows the summarization plan.

⚙️ Configuration

Both scripts use JSON configuration files located in ~/.config/summarizer/.

Converter Configuration (converter_config.json)

Controls how books are pulled from Calibre.

{
 "calibre_path": "~/ReferenceLibrary/Calibre Library",
 "markdown_path": "~/AINotes/MarkdownBooks",
 "target_series": ["anthropology", "music", "history"]
}

Summarizer Configuration (summarizer_config.json)

Controls how Markdown files are summarized.

{
 "markdown_path": "~/AINotes/MarkdownBooks",
 "summaries_path": "~/AINotes/BookSummaries",
 "target_series": ["anthropology", "music", "history"],
 "summarizer_name": "summarizer_macos"
}

Available summarizer_name options:

  • summarizer_macos: Optimized for Apple Silicon (MLX).
  • summarizer_linux: Standard Linux implementation.
  • summarizer_gc_gemma4_31b: Google Cloud hosted Gemma 4 implementation.

🛡️ Data Integrity

  • SHA-256 Hashing: Tracks source file changes to automatically trigger reconversions or re-summarizations only when content actually changes.
  • UUID Tracking: Uses Calibre UUIDs to track documents even if titles or authors change in metadata.
  • Atomic Writes: Ensures files are never left in a corrupted state during interruptions.