Overview

Agents are conceptual entities that encapsulate all the configurations and settings of an LLM, enabling it to adopt unique personas and execute distinct tasks within an application.

Components

Agents are made up of several components. Think of components as the building blocks of an agent required to perform a task. Here are the key components associated with an agent:

  • Instructions - Agent configuration that can be provided as either a single string or an array of strings.
  • Metadata - Key-value pair that can be used to categorize and filter agents.
  • Tools - Functions that can be used by an agent to perform tasks. Julep supports a wide range of tools, including custom tools, which are functions that can be used by an agent to perform tasks.
  • Docs - A collection of documents that can be used by an agent to retrieve information. Docs can be associated with an agent and can be used to retrieve or search information from the agent’s context.

Agent Configuration Options

When creating an agent, you can leverage the following configuration options:

OptionTypeDescriptionDefault
namestringThe name of your agentRequired
canonical_namestringA unique identifier for your agentnull
aboutstringA description of your agent’s purpose and capabilities""
modelstringThe language model to use (e.g., “claude-3.5-sonnet”, “gpt-4”)""
instructionsstring or list[string]Instructions for the agent to follow[]
metadataobjectAdditional metadata for your agentnull
default_settingsobjectModel configuration settings. Checkout the de settings for more details.null

You can find supported models here and supported tools here

Check out the API reference here or SDK reference (Python here or JavaScript here for more details on different operations you can perform on agents.

How to Use Agents

In Julep, how you use agents is very important. The YAML below shows the anatomy of an agent.

Creating an Agent

To create an agent, you can use the create method in the Python or Node.js SDK.

Relationship To Other Concepts

This section will help you understand how agents relate to other concepts in Julep.

Tools

Agents can be associated with different types of tools available in Julep to enable them to perform operations. These tools associated with an agent can also be leveraged by a task associated with the agent.

For example:

# Create an agent
agent = client.agents.create(name="My Agent")

# Associate a tool with the agent
client.agents.tools.create(
        agent_id=AGENT_UUID,
        **{
            "name": "computer",
            "type": "computer_20241022",
            "computer_20241022": {
                "display_height_px": 768,
                "display_width_px": 1024,
                "display_number": 1,
            },
        }
    )

Sessions

Agents can be used in sessions to enable real-time, interactive conversations. While tasks are designed for automated workflows, sessions provide a way to have stateful, continuous interactions with an agent. You can create multiple sessions with the same agent or multiple agents in a session, each session maintaining its own conversation history and context. This makes sessions ideal for scenarios requiring ongoing dialogue or human-in-the-loop interactions.

For example:

# Create an agent
agent = client.agents.create(name="My Agent")

# Create a session with the agent
session = client.sessions.create(agent=agent.id)

Best Practices

Agent Design

  • 1. Give agents clear, focused purposes rather than making them generalists
  • 2. Use descriptive names that reflect the agent’s primary function
  • 3. Keep instructions concise but specific
  • 4. Break complex tasks into multiple specialized agents rather than one complex agent

Configuration Management

  • 1. Start with conservative model settings (temperature, top_p) and adjust as needed
  • 2. Use metadata effectively for organization and filtering
  • 3. Document any custom tools thoroughly
  • 4. Version your agent configurations for tracking changes

Resource Management

  • 1. Reuse agents across similar tasks instead of creating new ones
  • 2. Clean up unused agents and their associated resources
  • 3. Monitor token usage and adjust context windows appropriately

Avoid giving agents more capabilities than they need. Each additional tool or permission increases the complexity and potential security surface area.

Next Steps

  • Agent Tools - Learn about tools and how to use them with agents
  • Agent Tasks - Learn about tasks and how to use them with agents
  • Agent Sessions - Learn about sessions and how to use them with agents
  • Agent Docs - Learn about docs and how to use them with agents