Agents
Understanding Julep Agents and their capabilities
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:
Option | Type | Description | Default |
---|---|---|---|
name | string | The name of your agent | Required |
canonical_name | string | A unique identifier for your agent | null |
about | string | A description of your agent’s purpose and capabilities | "" |
model | string | The language model to use (e.g., “claude-3.5-sonnet”, “gpt-4”) | "" |
instructions | string or list[string] | Instructions for the agent to follow | [] |
metadata | object | Additional metadata for your agent | null |
default_settings | object | Model configuration settings. Checkout the de settings for more details. | null |
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:
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:
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