def parse_agent_id(agent_id: str) -> tuple[str, str]:
    """
    Parse an enterprise agent ID into project key and LLM identifier.

    Supported formats:
        - PROJECT:agent:retrieval-augmented-llm:id  -> (PROJECT, retrieval-augmented-llm:id)
        - PROJECT:agent:id                          -> (PROJECT, agent:id)
        - PROJECT:llm-type:id                       -> (PROJECT, llm-type:id)
    """
    try:
        project_key, remainder = agent_id.split(":", 1)
    except ValueError:
        raise ValueError(f"Invalid agent identifier: {agent_id}")

    if not project_key or not remainder:
        raise ValueError(f"Invalid agent identifier: {agent_id}")

    parts = remainder.split(":")

    # PROJECT:agent:retrieval-augmented-llm:ID
    if len(parts) >= 3 and parts[0] == "agent" and parts[1] == "retrieval-augmented-llm":
        model_id = ":".join(parts[1:])
    else:
        model_id = remainder

    return project_key, model_id
