Skip to main content

Skills

Introduction

Skills can be understood as "functions" or "tools" that you can add to an agent to extend its functionality. They are essentially pieces of code that help us achieve the main goal of one or more agents.

A skill can contain contextual information about the business or provide access to resources that are not available to the AI Model.

Besides, a skill can be used by many agents, and an agent can use numerous skills.

In other words, skills increase the reach of your AI capabilities without rewriting code.

What is a Skill?

Skills are essential for enhancing the capabilities of AI agents. By encapsulating your existing functionalities into skills, you enable your AI to perform tasks that would otherwise be beyond its native abilities.

Behind the scenes, skills leverage function calling, a native feature of most of the latest language models to allow them to perform planning and to invoke your APIs. With function calling, language models can request (i.e., call) a particular function. The system then marshals the request to the appropriate function and returns the results back to the language model so it can generate a final response.

Skills are valuable because they encapsulate a set of functionality that mirrors how enterprise developers already develop services and APIs.

Anatomy of a Skill

At a high level, a skill is a group of functions that can be exposed to AI apps and services. The functions within skills can then be orchestrated by an AI application to accomplish user requests. To power automatic orchestration with function calling, skills also need to provide details that semantically describe how they behave. Everything from the function's input and output need to be described in a way that the AI can understand; otherwise, the AI will not correctly call the function.

For example, a sample WriterSkill might have functions with semantic descriptions that describe what each function does. A language model can then use these descriptions to choose the best functions to call to fulfill a user's request.

The functions it could have could be: Functions:

1. Generate summary

Description: This function takes a block of text as input and returns a concise summary of the main points.

2. Correct grammar

Description: This function reviews the input text for grammatical errors and returns a corrected version.

3. Translate to french

Description: This function translates the input text from English to French.

And the user prompt:

User Prompt: "I have written a long article, but I need a summary of it and also want to ensure there are no grammatical errors. Here is the text: 'Artificial intelligence is transforming industries by automating tasks, providing insights through data analysis, and enhancing customer experiences. However, it also raises ethical concerns about job displacement and privacy.' What is the summary of the text?"

Functions to Use:

  1. Generate summary
  2. Correct grammar

Function to Ignore:

  1. Translate to french

And a proper response could be:

Output: "AI transforms industries but raises ethical concerns."

Adding Skills to your Agent

The Different Types of Skill Functions

Within a skill, you will typically have two different types of functions: those that retrieve data for retrieval augmented generation (RAG) and those that automate tasks. While each type is functionally the same, they are typically used differently within applications.

For example, with retrieval functions, you may want to use strategies to improve performance (e.g., using cheaper models for summarization with the Agent Executor Skill). Whereas with task automation functions, you'll likely want to implement human-in-the-loop approval processes to ensure that tasks are completed correctly (e.g., making an http request with the Http Request Skill).

Examples

CRM Skill

You could have a skill that connects to your CRM and retrieves information about your customers. You can use this skill in many agents to provide personalized responses to your customers.

Git Skill

You could have a skill that connects to your git repository so that your agents can perform actions on your codebase. For example, you could have an agent that can create a new branch, commit changes, and open a pull request.

Weather Skill

You could have a skill that connects to a weather API and retrieves the current weather for a given location. You can use this skill in many agents to provide contextual weather information that may be relevant to the conversation.