Slide generation agent development

Introduction
Hello, I'm Cao from the JAPAN AI Official Agent team. JAPAN AI Inc. released the "Slide Creation Assistant v2" in April 2025.
This agent analyzes company-specific PowerPoint templates and automatically generates content that matches slide masters. Traditional presentation creation was time-consuming work for many business professionals, but this agent solved the following challenges:
・Using customized templates
・Supporting additional editing instructions
・Inserting graphs and images
・Integration with other agent plugins
The "Slide Creation Assistant v2" is a specialized agent that can process, generate, and edit PPTX files, performing everything from template analysis to slide generation and editing in an integrated manner. This article explains the technical aspects of this agent.

Architecture Overview
The slide generation agent primarily uses two tools
1. Slide generation tool:Integrates template analysis and slide generation functions
2. Slide editing tool:Integrates existing slide content extraction and editing functions
These tools inherit from a common base class, providing consistent error handling and functionality. This integration significantly improved user experience and code maintainability.
System Architecture Diagram
The following is a conceptual system architecture diagram of the slide generation agent v2.

Workflow
The following sequence diagram shows how each tool collaborates to realize slide creation and editing functionality.

This simplified workflow enables users to execute complex slide creation and editing tasks using only natural language instructions.
Core System Implementation
Basic Design of Integrated Tools
The tool design aggregates common functionality into a base class, with each tool implementing only its unique functions.
Adoption of Asynchronous Processing
Since slide processing is computationally intensive, we implemented asynchronous processing to avoid blocking the event loop.
Robust Error Handling
We implemented an advanced error handling mechanism that tolerates partial success scenarios. Here's a conceptual implementation example:
# Conceptual sample code - differs from actual implementation
class ErrorCollector:
def __init__(self):
self.errors = []
def add_error(self, location, error_type, message):
self.errors.append({
"location": location,
"type": error_type,
"message": message
})
async def process_slides(slide_contents):
error_collector = ErrorCollector()
results = []
for idx, slide in enumerate(slide_contents):
try:
results.append(await process_single_slide(slide)) # Slide processing
except ImageError as e:
error_collector.add_error(f"slide {idx}, image", "image_error", str(e)) # Collect errors if any
# Continue processing even with errors
return results, error_collectorThe key points of this error handling approach are
Tolerating partial failures
Design that doesn't interrupt overall processing due to failure of one slide or element
Collecting structured error information
Collecting errors with their location and reason in a structured way
Feedback to LLM
Organizing collected error information and providing it to the LLM to promote self-correction
Transparency to users
Mechanism to clearly and securely communicate processing issues
Techniques for improving LLM accuracy
To improve slide generation accuracy, we implemented the following enhancements for information provision to the LLM:
Accurate Context Provision
- Provide accurate template structure information (layout types, placeholder positions, etc.)
- Focus on essential information to reduce noise
Data Structure Unification
- Adopt consistent naming conventions and structures throughout the system
- Ensure API interface consistency
Utilization of Structured Data
- Unify complex data in JSON format, maintaining formats that are easy for LLMs to process
- Clearly express data with hierarchical structures like chart data
Content Generation Mechanism
We perform slide content generation and application through the following flow.

Chart content, in particular, is expressed in a concise and understandable JSON structure, making it easier for LLMs to generate appropriate charts.
Prompt Design Enhancements
We also enhanced prompt design to make collaboration with LLMs more efficient.
Specifically
Task-specific Structuring
Divide prompts into sections, with each section having a specific role
Clear Constraint Presentation
Clearly communicate template constraints and output format requirements
Guidance through Examples
Present concrete examples of expected output formats and content
For example, in prompt design for chart data generation, we present guidelines like
Chart Generation Guidelines:
- Use only numerical data (strings not allowed)
- Select appropriate chart types (e.g., line charts for time series data)
- Charts must have meaningful titles
- Use clear and understandable names for categories and series
[Example] Sales Data Chart
{
"chart": {
"type": "column",
"title": "Sales by Department (Q1 2025)",
"categories": ["January", "February", "March"],
"series": [
{"name": "Sales Department", "values": [120, 150, 180]},
{"name": "Marketing Department", "values": [90, 110, 130]}
]
}
}This format enables LLMs to generate more accurate chart data.
Actual Generation Examples
Let's try having a conversation with the agent to generate slides. When we upload a template and request the agent to create sales materials for our company:

The agent proceeds to research information from websites and the internet before moving on to slide creation.

Generated slide samples:


How does it look? There may still be room for improvement, but it appears to be properly utilizing various layouts while being conscious of variation.
If more users could use this, it would be great to contribute to improved work efficiency and reduced man-hours!
Lessons Learned from This Feature Release
Optimization of Complex Workflows
Through implementing this agent, we gained the following important insights.
1.Value of feature integration: Properly integrating highly related functions improves both user experience and development efficiency
2.Clear interface design: Consistent APIs and data structures are crucial for simplifying inter-tool collaboration
3.Flexible error handling: Tolerating partial success significantly improves user experience
Technical Challenges and Solutions
During development, we faced the following technical challenges:
1.Performance optimization: PPTX file processing is computationally intensive, so we optimized performance through asynchronous processing
2.Placeholder management: Layout and placeholder management was a complex challenge, but we overcame it with structured template information
3.Improving LLM response quality: We improved LLM generation quality through more detailed context provision and clear guidelines
4. Error recovery mechanisms: We improved automatic correction capabilities by providing structured error information as feedback to the LLM
Future Prospects
The future development directions for the slide generation agent include.
1.Template diversity: Providing varied templates to meet user needs
2.Insertion of graphic recordings, etc.: In addition to generated images and user-uploaded images, preparing free materials like images and illustrations in advance for insertion as graphic recordings
3. Interactive editing: Displaying generated slides on the agent UI so users can visually confirm and give editing instructions or manually edit while viewing
In the future, we plan to develop AI agents specialized for specific use cases, such as those that perform everything from analysis to PowerPoint file generation based on advertising operation data.
Summary
Through implementing the slide generation agent, we learned how AI agents can more efficiently support complex tasks. Through feature integration, asynchronous processing optimization, sophisticated error handling, and detailed prompt design, we were able to create a tool that enables users to easily create high-quality presentations.
We will continue making improvements to create a slide generation agent that can meet even more user needs.
Reference Materials
[JAPAN AI releases additional AI agent "Slide Creation Assistant v2"]
⭐️JAPAN AI is looking for people to work with us!
株式会社ジーニー JAPAN AI の求人一覧hrmos.co