Skip to content

anas-aqeel/bookpack_agents

Repository files navigation

OneHourBook: Agentic Book Summarization System

Transform any book into a precisely timed 58-60 minute reading experience using the Groq API without losing essential value.

🤖 Agent Team

ChronosReader (Master) orchestrates 14 specialized agents:

  • BookKeeper: Rights & intake management
  • ContextWeaver: Author & work context
  • MapMaker: Chapter mapping & budgeting
  • SummarySwarmer: Parallel chapter processing
  • QuoteGuardian: Copyright-compliant quote extraction
  • InsightFusion: Cross-chapter synthesis
  • ArgumentAnalyzer: Arguments & counterpoints
  • ConclusionSprinter: Fast-paced conclusions
  • FlashReviewer: Rapid review creation
  • ReceptionRadar: Reception & testimonials
  • FactChecker: Citation validation
  • PaceMaster: Length & pacing control
  • FormatForge: Multi-format export
  • QualityGate: Final QA validation

🚀 Quick Start

# Setup
pip install -r requirements.txt
cp .env.example .env
# Add your GROQ_API_KEY to .env

# Run with a public domain book
python src/main.py --book-title "The Art of War" --author "Sun Tzu" --wpm 230

# Run with user-provided text
python src/main.py --book-title "Your Book" --author "Author Name" --user-text path/to/book.txt

📊 Output Structure

  1. Overview & Background (author context, importance)
  2. Chapter-by-Chapter Analysis (details, arguments, learnings, summaries)
  3. Fast-Paced Conclusion
  4. Rapid Review (superficial recap)
  5. Quotations (copyright-compliant)
  6. Key Learnings, Arguments, Criticisms
  7. References & Uncertainty Log
  8. Pacing Report (word counts & timing)

🔐 Copyright Compliance

  • Public Domain (≤1929): Full passages allowed
  • Protected Content: ≤25 words per excerpt (≤10 for lyrics)
  • User-Provided: Full access within scope
  • Always includes page/location references

📈 Pacing Algorithm

  • Target: reading_speed_wpm * 60 words (default: 13,800 @ 230 WPM)
  • Acceptable range: ±2 minutes (13,340-14,260 words)
  • Per-chapter budgets allocated by page weight
  • Iterative compression/expansion to hit target

🏗️ Technical Stack

  • Framework: LangGraph (deterministic orchestration)
  • LLM: Groq API with rate limiting
  • Output: Markdown → HTML → PDF
  • Validation: Multi-layer QA gates
  • Processing: Parallel chapter handling

📁 Project Structure

/onehourbook/
  src/main.py              # Entry point
  src/orchestrator.py      # ChronosReader master
  src/agents/             # All 14 specialized agents
  src/utils/              # Utilities (pacing, citations, etc.)
  src/frameworks/         # LangGraph + Groq integration
  configs/prompts/        # Agent-specific prompts
  templates/             # Jinja2 output templates
  outputs/<book_slug>/   # Generated summaries & reports

🎯 Success Criteria

Timing: 58-60 minutes reading time
Coverage: Every chapter analyzed
Structure: Complete format compliance
Legal: Copyright-compliant quotations
Citations: All claims sourced
Parallel: Concurrent chapter processing
Validation: Multi-layer QA gates
Export: Markdown + HTML + PDF + CSV/JSON artifacts

🧪 Demo

Includes end-to-end demo with "The Art of War" (public domain) showing the complete 58-60 minute output structure.

🔧 Environment Variables

# Required: Groq API Key from https://console.groq.com/
GROQ_API_KEY=your_groq_api_key_here

🚀 Available Groq Models

The system supports multiple Groq models with intelligent switching:

  • llama-3.3-70b-versatile (default) - Best for complex reasoning
  • llama-3.1-70b-versatile - Great balance of speed & capability
  • llama-3.1-8b-instant - Fastest for simple tasks
  • mixtral-8x7b-32768 - Excellent for creative writing
  • gemma2-9b-it - Efficient processing
  • gemma-7b-it - Lightweight option

Use --model flag to override:

python src/main.py --book-title "Your Book" --model "llama-3.1-8b-instant"

Built with LangGraph • Powered by Groq API • Copyright Compliant • Precisely Timed

About

OneHourBook compresses any book into a 58–60 minute reading experience without losing key insights. A master agent coordinates 14 specialized agents for summarization, pacing, citations, and multi-format export. Built with LangGraph and the Groq API for parallel processing and QA-validated outputs.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages