The sophisticated content-aware AI system has been fully restored after fixing syntax errors.
- Multi-Slide Content-Aware AI: AI sees ALL slides and their text elements with context
- Multi-Slide Operations: AI can edit multiple slides in one request ("make whole deck about cats")
- Text Box Relationship Understanding: AI knows which elements belong to the same text box
- Smart Slide Targeting: AI automatically finds the right slide based on content
- Text Box Replacement: AI can replace entire text boxes (all bullets) or individual elements
- Markdown to PowerPoint XML: AI generates clean markdown, system converts to proper XML
- Precise Element Selection: AI chooses the right text element using slide-aware IDs (1A, 2B, 3C, etc.)
- Natural Language Commands: "Change the executive summary to something about cats"
- Surgical XML Editing: Makes precise edits to specific elements without corruption
- File Upload/Download: Drag & drop PPTX processing
- Thread-Based Chat: Multiple conversation threads with persistent history
- Syntax Errors: Resolved all missing braces and orphaned code blocks
- Content-Aware System: Fully restored the sophisticated AI processing
- Element Mapping: Restored precise element targeting and surgical edits
"Change the main heading on the first slide to 5 words about tortoises"
"Replace the title with something about giraffes"
"Update the large text to say hello world"
"Add some lorem ipsum to the slide"
- Content Extraction: System reads slide XML and extracts all text elements with context
- AI Analysis: OpenAI sees actual slide content:
[A] "Kwaku Slide One" (18pt, top-center) - Smart Selection: AI chooses the right element based on user's natural language
- Precise Edit: System makes surgical XML changes to exactly the right element
interface SlideText {
text: string; // "Welcome to Company"
fontSize: number; // 44
position: {...}; // top-center
elementId: string; // "A"
xmlPath: string; // For precise editing
}
PPTX Content:
Slide 1 text elements:
Text Box TB0 (title):
[1A] "Welcome to Company" (44pt, top-center)
Text Box TB1 (body):
[1B] "Quarterly Review" (18pt, middle-left)
Slide 2 text elements:
Text Box TB0 (title):
[2A] "Executive Summary" (36pt, top-center)
Text Box TB1 (body):
[2B] "Key findings and recommendations" (16pt, middle-left)
[2C] "First bullet point" (16pt, middle-left)
[2D] "Second bullet point" (16pt, middle-left)
User: "Change the executive summary content to 3 bullet points about cats"
AI Decision: "User wants to replace entire body content under Executive Summary"
AI Response: {
"textBoxId": "TB1",
"slideNumber": 2,
"content": "• Cats are independent animals\n• Cats love to sleep in sunny spots\n• Cats communicate through purring"
}
System: Parses markdown → Generates proper PowerPoint XML → Replaces entire text box
The system uses deep knowledge of PPTX structure to make precise edits. See README-how_pptx-works.md for complete technical details on:
- PPTX ZIP structure and relationships
- XML parsing and text extraction
- Safe editing patterns that preserve file integrity
Understanding how PowerPoint organizes content is crucial for the AI system to make intelligent editing decisions.
- Text Box =
<p:sp>element (PowerPoint shape container) - Text Elements =
<a:t>tags within the text box (individual text runs) - One text box can contain multiple paragraphs (
<a:p>) with multiple text runs (<a:t>)
<!-- Executive Summary slide has TWO text boxes: --> <!-- Text Box 1: Title --> <p:sp><p:ph type="title"/> <a:t>Executive Summary</a:t> </p:sp> <!-- Text Box 2: ALL bullets in ONE text box --> <p:sp><p:ph type="body"/> <a:p><a:buChar char="•"/><a:t>First bullet point</a:t></a:p> <a:p><a:buChar char="•"/><a:t>Second bullet point</a:t></a:p> <a:p><a:buChar char="•"/><a:t>Third bullet point</a:t></a:p> </p:sp>
- Preserves XML Structure: Each
<a:t>replacement maintains bullet formatting - Avoids Corruption: No need to reconstruct complex XML with indentation, bullet chars, etc.
- Granular Control: Can replace individual bullets or groups of bullets
- User Flexibility: "Change first bullet" vs "change all executive summary content"
<p:ph type="title"/>- Main slide titles<p:ph type="body"/>- Content areas (usually containing bullets)<p:ph type="ctrTitle"/>- Centered titles<p:ph type="subTitle"/>- Subtitles
The AI sees individual elements but understands their relationships:
Text Box 1 (title): [2A] "Executive Summary"
Text Box 2 (body): [2B] "First bullet" [2C] "Second bullet" [2D] "Third bullet"
When user says "change executive summary content" → AI targets the entire text box When user says "change executive summary title" → AI targets element 2A
The system uses a clean separation between content generation and technical implementation:
-
AI generates markdown-like content:
• First bullet point about cats • Second bullet point about dogs • Third bullet point about birds -
System parses and converts to PowerPoint XML:
<p:txBody> <a:p><a:pPr><a:buChar char="•"/></a:pPr><a:t>First bullet point about cats</a:t></a:p> <a:p><a:pPr><a:buChar char="•"/></a:pPr><a:t>Second bullet point about dogs</a:t></a:p> <a:p><a:pPr><a:buChar char="•"/></a:pPr><a:t>Third bullet point about birds</a:t></a:p> </p:txBody>
Benefits:
- ✅ AI focuses on content: No need to understand PowerPoint XML complexity
- ✅ System handles formatting: Proper bullet structure, indentation, XML escaping
- ✅ Clean separation: Content generation vs. technical implementation
- ✅ Flexible: Supports bullets, sub-bullets, plain text, mixed content
- AI sees actual slide content (not blind heuristics)
- Smart element selection based on context
- Natural language commands work reliably
- Precise XML editing without file corruption
- Clean, maintainable codebase under 500 lines per file
├── backend/
│ ├── index.ts # Routes & database (~200 lines)
│ ├── pptx.ts # Content-aware PPTX processing (~400 lines)
│ └── ai.ts # AI command parsing (~150 lines)
├── frontend/
│ └── index.html # Simple web interface
└── README.md # This file
- Content-Aware: AI sees actual slide content before making decisions
- Precise Editing: Surgical XML changes to specific elements
- Clean Code: All files under 500 lines, clear separation of concerns
- No Legacy Cruft: Removed all broken fallback code
- Maintainable: Easy to find, understand, and modify functionality
GET /- Main chat interfaceGET /health- Health checkGET /api/chat- Get chat historyPOST /api/chat- Send message (with content-aware AI)POST /api/upload- Upload PPTX fileGET /api/download/:fileId- Download processed file
- File Size Limit: Keep files under 500 lines for maintainability
- Single Responsibility: Each file has one clear purpose
- No Legacy Cruft: Remove broken code instead of keeping "fallbacks"
- Content-Aware First: AI should see actual content, not use blind heuristics
- Keep README Updated: When you make code changes, update this README to reflect the current state
- Technical Reference: See
README-how_pptx-works.mdfor detailed PPTX XML structure documentation - Document Milestones: Update status sections when major features are completed
- Remove Outdated Content: Delete old implementation details that no longer apply
- Intelligence Over Heuristics: Let AI see content and make smart decisions
- Precise Over Broad: Make surgical edits to specific elements
- Clean Over Complex: Remove unnecessary complexity and legacy code
- Working Over Perfect: Focus on functionality that actually works
- Document Over Assume: Keep documentation current with implementation
README-content-editing.md- How the AI analyzes content and converts markdown to PowerPoint XMLREADME-development.md- Development roadmap and plans for slide structural operationsREADME-how_pptx-works.md- Comprehensive guide to PPTX XML structure, relationships, and editing patterns
Monitoring: GET requests to /health return "PPTX Bot is running" for health checks.