Examples Overview
Index of runnable example pages, organized by what you'd want to build.
#Examples
A working tour of the SDK, organized by what you'd actually want to build. Each page contains runnable snippets, comments on what's load-bearing, and links back to the relevant guide for deeper coverage.
If you're brand new, start with the Quickstart: typed tool → answer model → tools=[...] → invoke(..., structured_output=Model) → response.result. Continue with Basics for more registration and dependency patterns.
#Run the existing catalog
The maivn-examples project contains 50 runnable entries with per-example instructions: 12 scenarios and 38 focused feature tutorials. Open its checkout or downloaded archive and work from the folder containing pyproject.toml, .env.example, and examples/. In the platform checkout, use cd apps/maivn-examples from the platform root. A standalone checkout or archive uses its own maivn-examples folder. Python 3.12 or newer is required.
python -m venv .venv
source .venv/bin/activate
python -m pip install .
python -m examples.assistants.quickstart.demo --helpPowerShell activates with .venv\Scripts\Activate.ps1. With uv, use uv sync and prefix module commands with uv run. Installing the project includes all declared dependencies, including the examples' python-dotenv loader.
Catalog imports and help need no key. For execution, create a runtime API key in your developer portal and set MAIVN_API_KEY in your shell or copy .env.example to .env in the examples project folder. Shell values take precedence. Then run:
python -m examples.assistants.quickstart.demoExpect a status card for PK-1003, a customs hold, a delivery date five days from today, and validation: PASS - 5 checks. A missing key fails before dispatch; an incorrect result fails the demo's checks. The project README explains optional endpoint configuration and Studio installation. For Studio with uv, launch from that folder with uv run --extra studio python -m maivn_studio.main.
#Choose a starter and customize it
Each starter's README includes a “Make it yours” path. Update tools, answer models, prompts, and factual checks together. Identify live requests, file writes, and other effects as you introduce them. These demos use synthetic inputs unless their instructions identify a live source.
#Index
#How to read the examples
The snippets are condensed — boilerplate (logging setup, .env loading, argparse) is omitted so you can see the SDK surface clearly. To run them locally, all you need is:
import os
from maivn import Agent
from maivn.messages import HumanMessage
agent = Agent(
name='My Agent',
system_prompt='...',
api_key=os.environ['MAIVN_API_KEY'],
)
agent.invoke([HumanMessage(content='hello')])Most examples also work inside mAIvn Studio — if you see APP_PROMPTS = [...] in the source repo, that's the Studio prompt picker metadata.
#What's missing here
These examples cover the SDK surface. For the platform (auth, billing, projects, webhooks, IAM, analytics) — see the Developer Portal guides. For Studio-specific authoring and debugging, see mAIvn Studio guide.