https://discord.gg/botpress logo
Skill-based architecture agent
# 📖tutorials
e
Good morning everyone, Today I want to share a way to implement an agent that uses skills in Botpress. I hope this tutorial helps you reduce token consumption, minimize hallucinations caused by overly broad context windows, and make prompt maintenance and adjustments easier without breaking multiple tool instructions. Let’s start from the beginning: what is a skill? According to Claude: https://code.claude.com/docs/es/skills Skills extend what Claude can do. You create a SKILL.md file with instructions, and Claude adds it to its toolkit. Claude uses skills when they are relevant, or you can invoke one directly using /skill-name. According to OpenAI: https://developers.openai.com/codex/skills Agent Skills Give Codex new capabilities and knowledge. Agent skills allow you to extend Codex with task-specific capabilities. A skill packages instructions, resources, and optional scripts so Codex can reliably follow a workflow. Skills can be shared across teams or with the broader community, and they are based on the open agent skills standard. In my own words Skills allow us to separate tool-specific instructions from the core agent instructions, enabling a modular architecture. This modularity means the agent does not need to hold knowledge of all tools within its context window from the start. Instead, it progressively acquires skills as needed, reducing token usage and avoiding unnecessarily large context windows.
The creation and use of skills are explained in detail in Claude’s official documentation: https://code.claude.com/docs/es/skills For this tutorial, we will use Claude’s guide as a reference to build an equivalent and functional implementation in Botpress.
Practical step-by-step example to create an agent with simple mathematical tools 1. Skill Creation - Create a workflow called CreateSkills. - The purpose of this workflow is to store our skills in an array of strings so they can be reused later.
In the code card, we store the skills we are going to use in the output variable.
Each skill includes: - Metadata: name and description. - Specific behavioral instructions written in Markdown format.
2. Skill Discovery - To allow our agent to be aware of the available skills, we will create a new workflow called DiscoverySkills. - This workflow will receive the complete list of skills and extract only their metadata, specifically the name and description of each skill. - The workflow’s output will be a JSON-formatted string containing the consolidated list of these metadata entries.
In the code card, we include the function responsible for extracting the metadata from each skill in the array and generating a JSON output with the consolidated list.
l
very nice tutorial @echoing-notebook-80704 🔥
e
Just a moment, there's more to come, haha.
I haven't finished the tutorial. 🫡
3. Skill Activation - To allow the agent to activate a skill, we create a workflow responsible for extracting the detailed instructions of a specific skill from the list. In this case, the workflow is called ActivateSkill. - This workflow receives the complete list of skills and the name of the skill to be activated. It then locates the corresponding skill, extracts its instructions, and returns them as the output.
In the code card, we include the function responsible for extracting a specific skill instruction and storing it in a conversation variable called Instruction.
4. Execution Mechanism - To allow our agent to execute workflows while being aware of only a single tool, we create a workflow called ExecuteCommand. - This workflow acts as a single execution point capable of triggering multiple different tools. To achieve this, we standardize both the input and output structures of the workflow.
For this example, the functionality of each tool was implemented directly within the code card. However, this workflow is designed to support the execution of multiple different workflows, centralizing their invocation through a single entry point.
5. Final Integration Finally, we need to connect the workflows and provide the agent with the base instructions required to operate using the skill system.
AgentPrompt:
Now we just need to test the agent, and we will see that it changes skills and executes the command from the instruction given by the skill.
This is an initial version of the skill system in Botpress. I hope you found the tutorial helpful and that it proves useful in your own implementations. If anyone identifies areas for improvement or has suggestions, I would greatly appreciate your feedback.
🫡
3 Views