WorkflowAI
  • Welcome
  • Getting Started
    • For Product Managers
    • For Developers
    • Creating and Managing Organizations
  • AI Features Playbook
    • Introduction
    • What is an AI Feature?
    • Defining your AI Feature
    • Testing your AI Feature
    • Evaluating your AI Feature
    • Adding your AI Feature to your Product (and Beyond)
    • Improving your AI Feature
  • Use Cases
    • Image Generation (NEW!)
  • Concepts
    • Schemas
    • Versions
    • Runs
    • Tools
  • Features
    • Playground
    • Reviews
    • Side by Side
    • Benchmarks
    • Code
    • Deployments
    • User Feedback
    • Monitoring
    • Limitations
    • Change Log
  • WorkflowAI Cloud
    • Introduction
    • Pricing
    • Reliability
    • Compliance
  • Developers
    • For Developers
  • Python SDK
    • Get started
    • @workflowai.agent
    • Schemas
    • Versions
    • Deployments
    • Multimodality
    • Tools
    • Errors
    • Examples
    • Workflows
  • Integrations
    • Instructor
  • Support
    • Email
    • GitHub Discussions
    • Discord
Powered by GitBook

Support

  • Slack
  • Github

Company

  • workflowai.com
  • Join
On this page
  • Major Versions
  • Versions from code, version id, or a deployment
  • Versions from code
  • Versions from version id
  • Versions from a deployment

Was this helpful?

Edit on GitHub
  1. Python SDK

Versions

WorkflowAI agents are versioned automatically.

To show how versions work, let's create a new agent that can triage a customer question into different categories.

from typing import Literal
from pydantic import BaseModel
import workflowai

class Input(BaseModel):
    question: str

class Output(BaseModel):
    category: Literal["billing", "technical", "account", "other"]

@workflowai.agent(id="triage-agent")
async def triage_question(input: Input) -> Output:
    """
    Triage a customer question into different categories.
    """
    ...

await triage_question.run(Input(question="How do I change my billing information?"))

Running this agent for the first time will automatically create a new version of the agent on WorkflowAI.

A version is a specific configuration of an agent.

WorkflowAI defines two types of (agent) versions:

Version Type
Example
Description

Major Versions

1, 2, 3, ...

A major version represents a specific configuration of a agent, including its instructions, temperature, descriptions/examples, and tools.

Minor Versions

1.1, 1.2, 1.3, ...

A minor version represents a major version associated with a specific model (e.g., OpenAI's GPT-4o-mini).

Now let's create another version of the agent, but this time we'll use a different model.

@workflowai.agent(
    id="triage-agent",
    model=Model.CLAUDE_3_5_HAIKU_LATEST
)
async def triage_question(input: Input) -> Output:
    """
    Triage a customer question into different categories.
    """
    ...

await triage_question.run(Input(question="How do I change my billing information?"))

This will create a new minor version of the agent associated with the CLAUDE_3_5_HAIKU_LATEST model.

Major Versions

Major versions are created when you change the instructions, temperature, descriptions/examples, or tools of an agent.

For example, let's change the instructions of the agent.

async def triage_question(input: Input) -> Output:
    """
    Triage a customer question into different categories.

    Categories:
    - billing: Questions about payments, invoices, pricing, or subscription changes
    - technical: Questions about API usage, SDK implementation, or technical issues
    - account: Questions about account access, settings, or profile management
    - other: Questions that don't fit into the above categories
    """
    ...

Changelog between major versions will be generated automatically.

Versions from code, version id, or a deployment

WorkflowAI allows you to refer to a version of an agent from your code, a minor version id, or a deployment.

Versions from code

Setting a docstring or a model in the @workflowai.agent decorator signals the client that the agent parameters are fixed and configured via code.

Versions from version id

Since WorkflowAI automatically saves all versions, you can refer to a minor version by its id.

# this agent will use the version 2.1
@workflowai.agent(id="triage-agent", version="2.1")

Versions from a deployment

Deployments allow you to refer to a version of an agent's parameters from your code that's managed from WorkflowAI dashboard, allowing you to update the agent's parameters without changing your code.

# production
@workflowai.agent(id="triage-agent", deployment="production") # or simply @workflowai.agent()

# development
@workflowai.agent(id="triage-agent", deployment="development")

# staging
@workflowai.agent(id="triage-agent", deployment="staging")
PreviousSchemasNextDeployments

Last updated 3 months ago

Was this helpful?

You can test this agent yourself on .

You can also go to the section on WorkflowAI to view the generated code for a specific version.

To learn more about deployments, read the section first.

WorkflowAI
Code
Deployments
Versions
Versions that have the same parameters are grouped together
Version 2 with new instructions