> ## Documentation Index
> Fetch the complete documentation index at: https://askmarvin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Migration Guide

> Move Marvin 2.x or ControlFlow code to the task API

Marvin 3 combines Marvin's structured-output helpers with a task engine derived from ControlFlow. Model access is provided by Pydantic AI.

## Marvin 2.x

The `cast`, `classify`, `extract`, `generate`, and `fn` entry points remain available. Check their current signatures; do not assume every model, image, or audio integration from 2.x is present.

For a general task, use `marvin.run` with a `result_type`:

```python theme={null}
import marvin

answer = marvin.run("What is 23 + 19?", result_type=int)
```

`generate` returns a list even when requesting one value. Helpers such as `extract` accept `agent=...`; `run` and `Task` accept `agents=[...]`.

## ControlFlow

Replace model identifiers with Pydantic AI's `provider:model-name` format. Replace `Flow` contexts with `Thread` contexts:

```python theme={null}
import marvin

with marvin.Thread(id="migration-example"):
    marvin.say("My project is called Marvin.")
    name = marvin.run("What is my project's name?", result_type=str)
```

Use ordinary Python functions in place of a `@flow` decorator. For work with dependencies, construct [tasks](https://askmarvin.ai/concepts/tasks.md) and call `run_tasks`.

## Storage and teams

Thread/message history is stored in a database, SQLite by default. Vector memory is separate and depends on a provider; see [memory](https://askmarvin.ai/concepts/memory.md). Setting `MARVIN_DATABASE_URL` does not configure vector memory.

All [team classes are deprecated](https://askmarvin.ai/concepts/teams). Coordinate individual agents explicitly rather than porting team or swarm orchestration.

See [model configuration](https://askmarvin.ai/guides/configure-llms.md), [database migrations](https://askmarvin.ai/guides/database-migrations.md), and the [examples](https://github.com/PrefectHQ/marvin/tree/main/examples) for current usage.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.