# Projects and Versions

## Projects

In MixedVoices, your work is organized into projects and versions. A project typically represents a single voice agent application (like a receptionist or customer service bot), while versions allow tracking different iterations of your agent's behavior.

#### Creating a Project

To start using MixedVoices, first create a project. The project id should be a unique identifier for your voice agent application. This creates a new project directory where all related data will be stored.

While creating a project, the metrics to be evaluated and the success criteria for the agent can also be specified. Metrics will be analyzed for all recordings added to the project and for evaluations.

Success criteria, should return True or False, depending on whether a call is successful. This is also analyzed for all recordings and evaluations. This is an optional argument.

Both success criteria and metrics can be updated later too.

For now, we will use the default metrics, check out the Metrics section to see how custom metrics can be defined.&#x20;

```python
import mixedvoices as mv
from mixedvoices.metrics import get_all_default_metrics

metrics = get_all_default_metrics()
success_criteria = "The call is successful if an appointment is scheduled"

project = mv.create_project(
    "receptionist_bot",
    metrics=metrics,
    success_criteria=success_criteria,
)
```

#### Load an Existing Project

If you already have a project, load it.

```python
project = mv.load_project("receptionist_bot")
```

## Versions

Each project can have multiple versions, representing different iterations of your voice agent.

#### Creating a Version

```python
# Create a new version, metadata is an Optional argument
version = project.create_version(
    version_id="v1",
    prompt="You are a friendly receptionist who specializes in appointment scheduling...",
    metadata={
        "model": "gpt-4",
        "temperature": 0.7,
        "deployment_date": "2024-01-15"
    }
)
```

#### Loading an existing version

```python
version = project.load_version("v1")
```

#### Tips

1. **Version Naming**
   * Use consistent naming conventions
   * Consider including dates or features in names. Example: "v1\_1203" or "scheduling\_update\_v2"
2. **Success Criteria**
   * Make criteria specific and measurable
   * Consider edge cases and partial successes
   * Update criteria as your agent evolves

#### Example: Complete Version Management

```python
# Create project for a medical receptionist bot
project = mv.create_project(
    "medical_receptionist",
    metrics=get_all_default_metrics(),
    success_criteria="Call is successful if: 1) appointment scheduled OR 2) medical query forwarded to nurse OR 3) emergency redirected to 911",
)

# Create initial test version
test_version = project.create_version(
    version_id="test_v1",
    prompt="You are a medical receptionist helping with appointments...",
    metadata={
        "status": "testing",
        "model": "gpt-4o-mini",
    },
)

# Create production version
prod_version = project.create_version(
    version_id="prod_v1",
    prompt="You are an experienced medical receptionist...",
    metadata={
        "status": "production",
        "model": "gpt-4o",
        "deployment_date": "2024-01-15",
        "approved_by": "Dr. Smith",
        "compliance_verified": True,
    },
)

```

#### Next Steps

After creating your project and version:

* [Add recordings to analyze calls](recording-analysis)
* [Set up evaluation to test your agent](agent-evaluation)
* Use the dashboard to visualize results
