Marvin AI Agent

by PrefectHQ• 6.2k•• Scanned•Claim this listing•Request removal
Research & Analysisagentsaiambient aichatbotsgpt

an ambient intelligence library

Marvin is an open-source ai agent by PrefectHQ, written mainly in Python, with 6,207 GitHub stars and the Apache-2.0 license. Its code was last updated Oct 27, 2026. The latest PyPI release is marvin 3.2.10, published Oct 27, 2026, with 4,745 downloads last week.

Marvin

Marvin

Marvin is a Python library for extracting structured data and running tasks with language models. It builds on Pydantic AI for model access and adds typed tasks, tools, and conversation history. Made by Prefect.

Install

Requires Python 3.10 or later and credentials for your model provider.

uv add marvin
export OPENAI_API_KEY="your-api-key"

Marvin uses OpenAI by default. See model configuration for other providers.

Use

import marvin
from pydantic import BaseModel

class Contact(BaseModel):
    name: str
    email: str

contacts = marvin.extract("Email Ada at ada@example.com", Contact)
print(contacts)

Use cast to produce one value, extract to find a list of values, classify to choose labels, and generate to create examples. Each has an async counterpart.

For work that needs instructions, context, or tools, use a task:

import marvin

def stock_level(product: str) -> int:
    """Return the number of units in stock."""
    return {"notebook": 12, "pen": 30}[product]

count = marvin.run(
    "Check how many notebooks are in stock",
    result_type=int,
    tools=[stock_level],
)

An Agent holds model settings, instructions, and tools you want to reuse. A Thread shares conversation history across calls and stores it in a database. See the quickstart and examples for both.

Develop

uv sync
uv run pytest tests/basic
uv run pre-commit run --all-files

Tests under tests/ai make model requests and require provider credentials. Keep test data separate from your local history by setting MARVIN_HOME_PATH to a temporary directory.

Docs

The documentation lives in docs/ and is published at askmarvin.ai. See releases for changes between versions.

License

Apache 2.0.

Marvin alternatives

View more →

Similar ai agents in Research & Analysis, ranked by GitHub stars. Compare licence, recent activity and scan status before you choose.

NameStarsLicenceLast updatedScan
Marvin (this page)
PrefectHQ
6.2kApache-2.0Oct 27, 2026Scanned, no flagged issues
Hermes Agent
NousResearch
259kMITNov 1, 2026Scanned, no flagged issues
Anything LLM
Mintplex-Labs
68kMITOct 30, 2026Scanned, no flagged issues
Khazix Skills
KKKKhazix
22kMITOct 1, 2026Scanned, no flagged issues
Hermes Webui
nesquena
19kMITNov 1, 2026Scanned, no flagged issues
DocsGPT
arc53
18kMITNov 1, 2026Scanned, no flagged issues