๐จ A4: Document Generator¶
Primary Feature: Office Artifact Creation (Word, Excel, PowerPoint) Status: โ Built (Corp) โ Excel and template scenarios strongest Built in: Corp โ 2026-04-08 | Lab โฌ
๐ฏ Problem It Solves¶
"I spend hours every week formatting reports, building trackers, and creating presentations from scratch."
This agent generates polished Office documents from:
- Text input โ structured Word/Excel/PPT
- Raw data upload โ clean formatted output
- Templates โ filled-in professional documents
Why This Agent?¶
This is our Office Artifact Creation showcase. It's the first agent where we turn ON the "Generate documents, charts, and code" capability โ the agent doesn't just answer questions, it creates downloadable files.
Key Contrast with Previous Agents¶
| Agent | What It Does | Creates Files? |
|---|---|---|
| A01 | Answers from web | โ Chat only |
| A02 | Answers from docs | โ Chat only |
| A03 | Rewrites text | โ Chat only |
| A04 | Generates documents | โ Word, Excel, PowerPoint |
๐๏ธ Architecture¶
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Three Input Scenarios โ
โ โ
โ ๐ Scenario 1: Text in chat โ
โ ๐ Scenario 2: Template in knowledge + user data โ
โ ๐ค Scenario 3: Raw data file uploaded in chat โ
โโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Document Generator Agent โ
โ โ
โ ๐ Instructions (multi-scenario handling) โ
โ ๐ Knowledge: weekly-report-TEMPLATE.docx โ
โ โก Capability: Generate documents, charts, and code = ON โ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Code Interpreter / Document Engine โ โ
โ โ โข Reads uploaded files โ โ
โ โ โข Generates Word (.docx) โ โ
โ โ โข Generates Excel (.xlsx) โ STRONGEST โ โ
โ โ โข Generates PowerPoint (.pptx) โ WEAKEST โ โ
โ โ โข Creates charts and summaries โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ฅ Downloadable Office Document โ
โ (User clicks to download Word/Excel/PPT file) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Capabilities Used¶
| Capability | Used? | Details |
|---|---|---|
| SharePoint Knowledge | โ | Not used |
| Web Grounding | โ | Not used |
| File Uploads (knowledge) | โ | Template file uploaded as knowledge reference |
| Graph Connectors | โ | Not used |
| Office Artifacts | โ | THE star feature โ "Generate documents, charts, and code" = ON |
| Tool Groups | โ | Not used |
| Copilot Actions | โ | Not used |
| Instructions | โ | Multi-scenario document generation with 3 input modes |
| Starter Prompts | โ | 5 working (Word, Excel, PPT, raw data, template) + 1 boundary |
๐ Instructions Used¶
Copy-paste these instructions when building the agent:
You are the Document Generator โ a professional business document creator. You turn rough notes, raw data, and verbal summaries into polished Office documents (Word, Excel, PowerPoint).
## Three Ways to Generate Documents
### Scenario 1: Text to Document
User provides text information in the chat. You generate a polished document from it.
- For reports and written content โ generate Word (.docx)
- For data, tables, and trackers โ generate Excel (.xlsx)
- For presentations and pitches โ generate PowerPoint (.pptx)
### Scenario 2: Template-Based Generation
A template file exists in your knowledge sources. When the user says "use the template" or asks for a report in "our format":
1. Reference the template file to understand the required structure and sections
2. Fill in the template sections with the data the user provides
3. Match the section headings, order, and table formats from the template
4. Mark any sections without data as "[TO BE COMPLETED]"
### Scenario 3: Raw Data to Clean Output
User uploads a messy or raw data file (Excel, CSV). You:
1. Read and analyse the uploaded data
2. Clean and structure it
3. Generate a polished output document (Word summary report, clean Excel, or presentation with charts)
## Rules You MUST Follow
1. ALWAYS ask clarifying questions if the user's request is vague โ do not assume
2. ALWAYS generate the document as a downloadable Office file
3. Use professional formatting: clear headings, consistent fonts, bullet points, tables
4. Use NZ English spelling (colour, organise, centre)
5. Include the current date on all documents
6. Keep language professional but warm โ not stiff or corporate
7. NEVER fabricate data, statistics, or facts โ ONLY use what the user provides
8. If information is missing for a section, mark it as "[TO BE COMPLETED]"
9. When a template exists in knowledge, ALWAYS follow its structure unless the user says otherwise
10. After generating, ALWAYS offer to adjust: format, sections, tone, or file type
## What You Do NOT Do
- NEVER create legal contracts, financial statements, or compliance documents. If asked, respond: "I can create business documents like reports, trackers, and presentations, but legal and financial documents should be prepared by qualified professionals."
- NEVER make up content that the user has not provided
- NEVER change the meaning of user-provided data
๐ ๏ธ Quick Build Guide (Copy-Paste Ready)¶
Follow these steps to recreate this agent in any tenant:
| Step | Action |
|---|---|
| 1 | Go to microsoft365.com/chat โ Agents โ Create Agent โ Skip to configure |
| 2 | Name: A04: Document Generator |
| 3 | Description: Generates polished Word reports, Excel trackers, and PowerPoint decks โ from text, raw data uploads, or using templates |
| 4 | Instructions: Paste the full instruction block from above |
| 5 | Knowledge โ Files: Upload weekly-report-TEMPLATE.docx from C:\ssClawy\agent-builder-demo-content\a04-document-generator\ |
| 6 | Knowledge โ Web content: None |
| 7 | Search all websites: OFF |
| 8 | Generate documents, charts, and code: โ ON (critical โ this is the star feature!) |
| 9 | Starter Prompts: Add all prompts from the table below |
| 10 | Create and test with T2 (Excel) first โ it's the most reliable |
Demo Files to Have Ready (attach during demo, NOT uploaded as knowledge)¶
| File | Location | Used In |
|---|---|---|
raw-team-performance-data.xlsx |
a04-document-generator/ |
T4 prompt (attach in chat) |
๐จ Gotchas & Design Decisions¶
๐ Gotcha 1: Excel Is the Strongest, PowerPoint Is the Weakest¶
โ ๏ธ Honest Assessment from Testing
Not all artifact types are equal. Here's what we found:
| Artifact Type | Reliability | Formatting Quality | Demo Safe? |
|---|---|---|---|
| Excel (.xlsx) | โญโญโญ Excellent | Clean tables, headers, formatting | โ Lead with this |
| Word with template | โญโญ Good | Follows template structure well | โ Use template approach |
| Word freeform | โญ Basic | Alignment and styling often messy | โ ๏ธ Manage expectations |
| PowerPoint (.pptx) | โ Unreliable | Often fails to generate the file | โ Skip in live demos |
Why: The Code Interpreter engine excels at structured data (Excel) and can follow templates (Word). But freeform Word formatting and PowerPoint slide generation are weaker capabilities โ the engine struggles with complex layouts and visual design.
Customer positioning: "Document generation is strongest with structured data and templates. For presentations, we recommend using Copilot in PowerPoint directly โ it has dedicated slide generation AI that's much better than the general Code Interpreter."
๐ Gotcha 2: Templates Dramatically Improve Word Output¶
Our T1 test (freeform Word) produced messy formatting. But T5 (template-based Word) produced clean, well-structured output. The template gives the agent a reference to follow.
Lesson: ALWAYS provide templates for Word document generation. Upload them as knowledge files and reference them in instructions.
๐ค Gotcha 3: Raw Data Upload Is the Biggest Wow Factor¶
T4 (upload messy Excel โ get clean executive summary) was the most impressive demo moment. The agent:
- Read the raw performance data
- Calculated averages and identified top performers
- Generated a clean Word report with tables and recommendations
Demo tip: Lead with T2 (Excel) for quick win, then T4 (raw data) for the wow factor, then T5 (template) to show sophistication.
๐ฌ Starter Prompts¶
| # | Title | Scenario | Output | Reliability |
|---|---|---|---|---|
| T1 | ๐ Word from Text | Text โ Word freeform | Word (.docx) | โญ Basic formatting |
| T2 | ๐ Excel from Text | Text โ Excel tracker | Excel (.xlsx) | โญโญโญ Excellent |
| T3 | ๐ฅ๏ธ PPT from Text | Text โ PowerPoint deck | PPT (.pptx) | โ Often fails |
| T4 | ๐ Raw Data โ Clean | Upload raw file โ clean report | Word + data | โญโญโญ Best demo moment |
| T5 | ๐ Template โ Filled | Template + data โ formatted doc | Word (.docx) | โญโญ Good with template |
| B1 | ๐ซ Legal Contract | Boundary test | Decline | โ Works |
Recommended Demo Order¶
- T2 (Excel) โ quick win, always works
- T4 (raw data upload) โ biggest wow
- T5 (template-based) โ shows sophistication
- Skip T3 (PPT) in live demos โ or mention as "still maturing"
๐ Demo Files¶
| File | Location | Purpose |
|---|---|---|
weekly-report-TEMPLATE.docx |
a04-document-generator/ | Template for T5 (uploaded as knowledge) |
raw-team-performance-data.xlsx |
a04-document-generator/ | Raw data for T4 (attached in chat during demo) |
๐งช Test Results¶
| # | Test | Result | Notes |
|---|---|---|---|
| T1 | Word from text | โ ๏ธ Works but messy formatting | Alignment issues, basic styling |
| T2 | Excel from text | โ Excellent | Clean table with headers, proper formatting |
| T3 | PPT from text | โ Failed | Could not generate .pptx file |
| T4 | Raw data โ report | โ Excellent | Analysed data, calculated averages, clean output |
| T5 | Template โ filled | โ Good | Followed template structure, filled sections correctly |
| B1 | Legal contract | โ Declined | CAPS boundary technique working |
๐ Pros & Cons¶
| Pros | Cons |
|---|---|
| โ Creates actual downloadable Office files | โ PowerPoint generation unreliable |
| โ Excel output is excellent quality | โ Freeform Word formatting often messy |
| โ Raw data processing is genuinely impressive | โ Can't perfectly replicate complex templates pixel-for-pixel |
| โ Template-based generation works well | โ Requires "Generate docs" capability ON (can't keep it off) |
| โ Three input modes (text, template, raw data) | โ Large files may hit processing limits |
๐ฎ Future Enhancements¶
| Enhancement | Impact |
|---|---|
| Better PPT generation | Would complete the Office trifecta |
| Brand-specific formatting (colours, fonts, logos) | More professional output |
| Multi-document generation in one request | "Generate the report AND the tracker AND the deck" |
| Combine with SharePoint knowledge | Pull real project data and generate reports automatically |
| Scheduled generation via Copilot Actions | Auto-generate weekly reports every Friday |
๐ค Demo Talking Points¶
- "Three input modes" โ Type text, use a template, or upload raw data. Three ways to generate documents.
- "Excel is incredible" โ Show T2 and T4. Structured data is where this shines.
- "Templates change everything" โ Compare T1 (messy) vs T5 (clean). Templates are the key to consistent output.
- "Raw data magic" โ Drop a messy spreadsheet in, get an executive summary out. That's the wow moment.
- "Be honest about PPT" โ PowerPoint generation is still maturing. For best results, use Copilot in PowerPoint directly.
- "This is just the beginning" โ Imagine combining this with SharePoint data and scheduled automation.