Patterns
Design patterns for the Langroid multi-agent LLM framework.
Safety check
- Not rated by Claude yet. We only sell skills Claude has read and rated 7 out of 10 or higher, so this one is a free link to its author.
An automated scan lowers risk but cannot promise zero risk. How we check skills
Preview
The first lines of SKILL.md
---
name: patterns
description: Design patterns for the Langroid multi-agent LLM framework. Covers
agent configuration, tools, task control, and integrations.
---
# Langroid Patterns
## Instructions
Below is an INDEX of design patterns organized by category. Each item describes
WHAT you might want to implement, followed by a REFERENCE to a document with
a complete code example.
Scan this index to find patterns matching your needs, then consult the
corresponding document.
---
## Agent & Task Basics
1. **Task Returns Tool Directly**
Create a Langroid Agent equipped with a single Tool (a ToolMessage), and wrap
it in a Task so that running the task returns that ToolMessage directly. Use
this pattern when you want a simple LLM agent that returns a structured
response.
- Reference: `./task-return-tool.md`
---
## Tool Handlers
2. **Stateful Handler on Agent**
Define a STATEFUL tool handler as a METHOD on the agent (not inside the
ToolMessage). Use this pattern when: (a) the tool handler needs to execute
external operations (API calls, database queries, file I/O), (b) you need to
track state across retries (e.g., failure counter), (c) the handler needs
...From pchalasani's repository, MIT licence.