Skip to content

feat: Add Manim toolkit and AgentOS examples#7554

Open
VirusDumb wants to merge 13 commits intomainfrom
manim-toolkit
Open

feat: Add Manim toolkit and AgentOS examples#7554
VirusDumb wants to merge 13 commits intomainfrom
manim-toolkit

Conversation

@VirusDumb
Copy link
Copy Markdown
Contributor

@VirusDumb VirusDumb commented Apr 16, 2026

Summary

Introduce a Manim toolkit and example agents for rendering Manim CE scenes and attaching MP4s to run responses. Adds libs/agno/agno/tools/manim.py (ManimTools with render_scene/arender_scene, quality presets, error handling, and list_rendered_videos), a CLI demo cookbook/91_tools/manim_tools/manim_tools.py, an AgentOS wrapper cookbook/91_tools/manim_tools/manim_agentos.py, plus README and TEST_LOG. Videos are read into memory as agno.media.Video (base64-inlined at serialization); on-disk artifacts are placed under tmp/ for easy cleanup.

TLDR: allow agents to make 3blue1brown videos

(If applicable, issue number: #____)

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Improvement
  • Model update
  • Other:

Checklist

  • Code complies with style guidelines
  • Ran format/validation scripts (./scripts/format.sh and ./scripts/validate.sh)
  • Self-review completed
  • Documentation updated (comments, docstrings)
  • Examples and guides: Relevant cookbook examples have been included or updated (if applicable)
  • Tested in clean environment
  • Tests added/updated (if applicable)

Duplicate and AI-Generated PR Check

  • I have searched existing open pull requests and confirmed that no other PR already addresses this issue
  • If a similar PR exists, I have explained below why this PR is a better approach
  • Check if this PR was entirely AI-generated (by Copilot, Claude Code, Cursor, etc.)

Additional Notes

Add any important context (deployment instructions, screenshots, security considerations, etc.)

Introduce a Manim toolkit and example agents for rendering Manim CE scenes and attaching MP4s to run responses. Adds libs/agno/agno/tools/manim.py (ManimTools with render_scene/arender_scene, quality presets, error handling, and list_rendered_videos), a CLI demo cookbook/91_tools/manim_tools/manim_tools.py, an AgentOS wrapper cookbook/91_tools/manim_tools/manim_agentos.py, plus README and TEST_LOG. Videos are read into memory as agno.media.Video (base64-inlined at serialization); on-disk artifacts are placed under tmp/ for easy cleanup.
@VirusDumb VirusDumb requested a review from a team as a code owner April 16, 2026 16:48
@VirusDumb VirusDumb changed the title feat:Add Manim toolkit and AgentOS examples feat: Add Manim toolkit and AgentOS examples Apr 16, 2026
)


def save_base64_video_to_disk(video: Video, dest_dir: Path) -> Path:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should rather be a util function within the sdk.

@ysolanky
Copy link
Copy Markdown
Member

Please add some tests and link a docs PR

VirusDumb and others added 8 commits April 17, 2026 13:33
Add size and duration safety bounds for Manim renders: introduce max_inline_bytes (25 MB default) and max_duration_seconds (120s default), increase default timeout to 900s, and validate their values. Use ffprobe to probe output duration and reject overlong renders; inline small mp4s as Video(content=...) and persist/return large renders as Video(filepath=...). Quiet manim subprocess output by adding -v WARNING and --progress_bar none. Update README to document delivery and safety bounds, adjust example script, and add comprehensive unit tests (libs/agno/tests/unit/tools/test_manim.py) covering success, errors, delivery modes, and probes.
Add robust video persistence and update test log.

- Implement save_video_to_disk that handles Video(content), Video(filepath) and remote content (via get_content_bytes), copying or decoding as appropriate; add backwards-compatible alias save_base64_video_to_disk. Import shutil for file copies.
- Update CLI/agent scripts to detect delivery mode (inline/filepath/url), print delivery info and saved file sizes, and switch to the new save_video_to_disk API.
- Remove hardcoded timeout_seconds=180 from Agent tool instantiations to rely on defaults.
- Expand TEST_LOG.md with unit test results (16/16 pass) and mark end-to-end / voice / AgentOS checks as pending.

These changes ensure large renders that are returned as filepaths are handled correctly, preserve backward compatibility, and improve developer visibility into test and run outputs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants