Skip to content

Slide Generator Agent

The Slide Generator Agent lets you turn plain text or data into a polished slide deck with just a few clicks. You give it the information you want to present, choose a language model, and the agent creates the slides for you in the format you need.

How it Works

The agent uses a language model (LLM) to understand the content you provide. It can also call tools you supply, such as data‑fetching or formatting utilities, to enrich the slides. If the main model fails, you can enable a fallback model to keep the process running.
When you specify an Output Format, the agent runs the marp-cli tool to convert the generated markdown into a presentation file. If you provide a Structured Output Schema, the agent will follow that template exactly, ensuring consistent slide structure. The agent can stream its output so you see the slides as they are being built, and you can enable verbose logging to watch its internal decision‑making.

Inputs

  • Fallback: Backup chat model to use when the primary model fails or isn’t available.
  • Model: The language model to use for the agent. (Required)
  • Tools: A list of tools that the agent can use to perform actions.
  • State custom schema: Define additional fields for the agent’s internal state. Provide a JSON schema with the fields you want to add.
  • Enable Fallback Model: Whether to enable a fallback model. When enabled, connect a backup chat model to use in case the primary model fails or isn’t available.
  • Agent Description: Useful description when using the agent as tool or child of supervisor schema.
  • Agent Name: The name of the executor to use.
  • Input: The initial input message for the agent to start the conversation.
  • Max Execution Time: The maximum execution time in seconds for the agent.
  • Max Iterations: The maximum number of iterations to run the agent for.
  • Memory top message: The number of messages to pass to the agent as context. For all messages use -1.
  • Output Format: The output format for the presentation. Requires ‘marp-cli’ to be installed.
  • Structured Output Schema: Define the format for the agent’s response. If the agent’s response doesn’t match this format, it will fail. Provide a JSON schema for the output.
  • System Prompt: System prompt for the agent.
  • Marp Theme: The Marp theme to use for the presentation.
  • Tool Schema: Metadata schema to use for the Agent as a Tool. Defines the input arguments.
  • Use short term memory: Enable the checkpointer to save the agent’s state at each step, allowing for stateful conversations.
  • Stream: Enable streaming to receive the agent’s response as it is being generated.
  • User Prompt: User prompt for the agent.
  • Verbose: Enable verbose logging to see the agent’s thought process and actions in detail.

Outputs

  • Agent: CompiledGraph (method: build_agent)
  • Response: Message (method: message_response)
  • Tool: BaseTool (method: build_tool)

Usage Example

  1. Goal: Create a 5‑slide deck summarizing the Q2 sales report.
  2. Configure the component
    • Model: gpt-4o-mini
    • Input: Paste the Q2 sales summary text.
    • Output Format: marp
    • Marp Theme: default
    • Structured Output Schema: Provide a JSON schema that defines a slide title, bullet points, and an optional image URL.
    • Stream: Checked (so you see slides as they are generated).
  3. Run the agent – the agent processes the text, generates markdown slides, and the marp-cli tool turns them into a PDF or HTML deck.
  4. Review – the Response output shows the final slide deck, which you can then attach to a report or share directly.
  • LanggraphSlideGenBase – The base class that provides core slide‑generation logic.
  • Presentation Builder – A higher‑level component that can combine multiple slide generators into a single deck.
  • Data Fetcher Tool – Useful for pulling in charts or tables that the Slide Generator Agent can embed.

Tips and Best Practices

  • Keep the input concise – The clearer the input, the more accurate the slides.
  • Use a Structured Output Schema – This guarantees consistent slide formatting and reduces post‑processing.
  • Enable Streaming – Great for long presentations; you can see progress in real time.
  • Choose the right Marp theme – Pick a theme that matches your brand or presentation style.
  • Test with a small sample first – Verify the output format before generating a full deck.

Security Considerations

  • The agent sends your content to the chosen LLM, so ensure that sensitive data is handled according to your organization’s privacy policies.
  • If you enable a fallback model, make sure it is from a trusted provider.
  • Use the Verbose option only when you need detailed logs; it can expose internal prompts and tool calls.