Quick Start Guide

This guide will help you get started with Julep in just 5 minutes. You’ll learn how to create your first AI agent and execute a simple task.

Prerequisites

Step 1: Install Julep

Choose your preferred language:

pip install julep

Step 2: Initialize the Client

from julep import Julep

client = Julep(api_key="your_julep_api_key")

Step 3: Create Your First Agent

Let’s create a simple AI agent that can help with writing tasks:

agent = client.agents.create(
    name="Writing Assistant",
    model="claude-3.5-sonnet",
    about="A helpful AI assistant that specializes in writing and editing."
)

Step 4: Create a Simple Task

Let’s create a task that generates a short story based on a given topic:

task = client.tasks.create(
    agent_id=agent.id,
    name="Story Generator",
    description="Generate a short story based on a given topic",
    main=[
        {
            "prompt": [
                {
                    "role": "system",
                    "content": "You are a creative story writer."
                },
                {
                    "role": "user",
                    "content": "Write a short story about {{inputs.topic}}"
                }
            ]
        }
    ]
)

Step 5: Execute the Task

Now let’s run the task with a specific topic:

execution = client.executions.create(
    task_id=task.id,
    input={"topic": "a magical garden"}
)

# Wait for the execution to complete
while (result := client.executions.get(execution.id)).status not in ['succeeded', 'failed']:
    print(result.status)
    time.sleep(1)

if result.status == "succeeded":
    print(result.output)
else:
    print(f"Error: {result.error}")

Next Steps

Congratulations! You’ve created your first Julep agent and executed a task. Here’s what you can explore next: