Tool Integration

Julep provides a flexible system for integrating various types of tools that agents can use during interactions. These tools enable agents to perform actions, retrieve information, or interact with external systems.

Types of Tools

illustrates how to define a user-defined function and integrate it with Julep. Below is an example in YAML format:

name: fetch_user_profile
description: Retrieve user profile from the database.
parameters:
  type: object
  properties:
    user_id:
      type: string
      description: Unique identifier of the user.
    fields:
      type: array
      items:
        type: string
      description: Specific fields to retrieve from the profile.

You can use this function to call the relevant system tool for interacting with external databases or APIs.

  1. User-defined Functions

    • Function signatures that you provide to the model

    • Similar to OpenAI's function-calling feature

    • Example:

      name: send_text_message
      type: function
      function:
        name: send_text_message
        description: Send a text message to a recipient.
        parameters:
          type: object
          properties:
            to:
              type: string
              description: Phone number of recipient.
            text:
              type: string
              description: Content of the message.
          required:
            - to
            - text
  2. System Tools

    • Built-in tools for calling Julep APIs.

    • Can trigger task executions, append to metadata fields, etc.

    • Executed automatically when needed, no client-side action required.

    • Example:

      name: list_user_docs
      description: Get user docs
      type: system
      system:
        resource: user
        subresource: doc
        operation: list
  3. Built-in Integrations

    • Integrated third-party tools from providers like wikipedia, brave and cloudinary.

    • Upcoming: Support planned for other langchain toolkits (Github, Gitlab, Gmail, Jira, MultiOn, Slack).

    • Executed directly on the Julep backend.

    • Additional runtime parameters can be set in agent/session/user metadata.

    • Example:

      name: internet_search
      description: Performs an internet search using Brave
      type: integration
      integration:
        provider: brave
        method: search
        setup:
          api_key: <BRAVE_API_KEY>
  4. API Calls & Webhooks

    • Julep can build natural-language tools from OpenAPI specs.

    • Additional runtime parameters loaded from metadata fields.

    • Example:

      name: search_instagram_reels
      type: api_call
      api_call:
        method: GET
        url: https://instagram-scraper-api3.p.rapidapi.com/reels_by_keyword
        headers:
          x-rapidapi-key: <RAPID_API_KEY>
          x-rapidapi-host: <RAPID_API_HOST>
        follow_redirects: true

Partial Application of Arguments

Julep allows for partial application of arguments to tools using the x-tool-parameters field in metadata. This is useful for fixing certain parameters for a tool. Example:

{
  "metadata": {
    "x-tool-parameters": {
      "function:check_account_status": {
        "customer_id": 42
      }
    }
  }
}

Resolving Parameters with the Same Name

When multiple scopes (user, agent, session) define the same parameter, Julep follows a precedence order:

  1. Session

  2. User

  3. Agent

This allows for flexible configuration of tools across different scopes while maintaining clear rules for parameter resolution.

By providing these various tool integration options and configuration capabilities, Julep enables the creation of powerful and flexible agent-based applications that can interact with a wide range of external systems and data sources.

Last updated