This is an early release preview. You may encounter bugs.
Marvin logo
Unclaimed

Framework coding connectors

Marvin

Python framework from the Prefect team for building agentic AI workflows with structured, task-oriented LLM calls.

B 77/100 GitHub score ? This grade is derived from GitHub signals, not user votes. Open for the full breakdown.
Discussion

01 / Summary

About Marvin.

Marvin is a Python framework for two related jobs: getting structured, typed output from large language models (LLMs), and orchestrating agentic workflows around those calls. The two layers sit in one package, so a single typed extraction and a multi-step agent run share the same API.

The structured-output layer is a handful of top-level functions. marvin.extract pulls native types out of unstructured text, marvin.cast converts input into a target type such as a TypedDict, marvin.classify maps input onto the members of an enum, marvin.generate produces a requested number of structured objects from a description, and marvin.summarize condenses text. Each takes the Python type as the target and returns a validated value of it.

The agentic layer is built from tasks, agents, and threads. A Task carries instructions, a result_type, optional tools, and context, and returns a type-safe result. An Agent is a portable configuration of model, instructions, and tools that can be assigned to any task and reused across workflows. A Thread is a context manager that shares message history and context across several runs. marvin.plan breaks an objective into dependent tasks, which marvin.run_tasks then executes.

Tool use is plain Python: a function passed in the tools list becomes callable by the agent, and each call and its output print as a discrete step during the run. All Marvin functions have thread management built in, so they compose into chains of tasks that share context.

Version 3.0 combines the earlier Marvin interface with the agentic engine from ControlFlow, which it supersedes, and renames ControlFlow’s Flow to Thread. Model calls go through Pydantic AI, so the full range of providers Pydantic AI supports is available, with OpenAI as the default. Thread and message history is stored in SQLite, and no database migrations are available yet, so data may need resetting between updates.

  • Structured extraction: extract, cast, classify, and generate turn unstructured text into native Python types, TypedDicts, and enums
  • Type-safe results: a task declares a result_type and returns a validated value of it, including Pydantic models
  • Tool use: ordinary Python functions passed to a task or agent become callable tools
  • Reusable agents: an agent bundles a model, instructions, and tools, and can be assigned to any task
  • Multi-agent workflows: more than one agent can be coordinated within a single workflow or task
  • Threads: a context manager shares message history and context across several runs, with an optional id for recovery
  • Planning: marvin.plan splits an objective into discrete dependent tasks for marvin.run_tasks
  • Observable runs: each tool call, input, status, and output prints as an inspectable step
  • Provider range: model calls go through Pydantic AI, so any provider it supports can be configured

02 / Discussion CREDIBILITY-GATED

Discussion

Reading is open to everyone. Posting and voting need a verified identity or a GitHub grade of B or higher.

  • No discussions yet.

04 / Build

Build with Marvin.

Browse the catalog for frameworks, tools, and harnesses, each scored on real GitHub credibility.

Get Marvin →

Browse the catalog