Overview

Agents in Julep are AI-powered entities that can execute tasks and interact with users. This guide will walk you through the process of creating and configuring agents.

Creating an Agent

You can create an agent using either the Python or Node.js SDK:

from julep import Julep

client = Julep(api_key="your_api_key")

agent = client.agents.create(
    name="My Agent",
    model="claude-3.5-sonnet",
    about="A helpful AI assistant that specializes in data analysis"
)

Agent Configuration Options

When creating an agent, you can specify several configuration options:

OptionTypeDescription
namestringThe name of your agent
modelstringThe language model to use (e.g., “claude-3.5-sonnet”, “gpt-4”)
aboutstringA description of your agent’s purpose and capabilities
metadataobjectAdditional metadata for your agent
toolsarrayList of tools the agent can use

Supported Models

Julep supports various language models:

  • Anthropic Models
    • claude-3.5-sonnet
    • claude-3.5-opus
    • claude-2.1
    • claude-2.0
  • OpenAI Models
    • gpt-4
    • gpt-4-turbo
    • gpt-3.5-turbo

Best Practices

  1. Clear Purpose: Give your agent a clear, specific purpose through the about field
  2. Appropriate Model: Choose a model that matches your needs in terms of capability and cost
  3. Descriptive Name: Use a name that reflects the agent’s purpose
  4. Metadata: Use metadata to store configuration that might need to change

Example: Creating a Specialized Agent

Here’s an example of creating a more specialized agent with metadata and tools:

agent = client.agents.create(
    name="Research Assistant",
    model="claude-3.5-sonnet",
    about="An AI assistant specialized in academic research and paper analysis",
    metadata={
        "expertise": ["academic research", "paper analysis"],
        "language": "en",
        "max_papers_per_session": 5
    }
)

# Add tools to the agent
client.agents.tools.create(
    agent_id=agent.id,
    name="arxiv_search",
    description="Search for academic papers on arXiv",
    integration={
        "provider": "arxiv",
        "method": "search"
    }
)

Managing Agents

Once created, you can manage your agents:

# List all agents
agents = client.agents.list()

# Get a specific agent
agent = client.agents.get(agent_id="agent_id")

# Update an agent
agent = client.agents.update(
    agent_id="agent_id",
    metadata={"new_config": "value"}
)

# Delete an agent
client.agents.delete(agent_id="agent_id")

Next Steps

After creating your agent, you might want to:

  1. Add tools to your agent
  2. Configure agent memory
  3. Create tasks for your agent