patterns
FeaturedDesign patterns for the Langroid multi-agent LLM framework. Covers agent configuration, tools, task control, and integrations.
AI & Automation 1,997 stars
130 forks Updated 3 days ago MIT
Install
Quality Score: 93/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# 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
access to agent-level resources (connections, configs), or (d) you want
Langroid to automatically loop errors back to the LLM for self-correction.
The method name must match the `request` field of the ToolMessage. Return a
string for errors (LLM sees it and can retry), or DoneTool(content=result)
to terminate successfully.
- Reference: `./agent-tool-handler-with-state.md`
3. **Handler with Validation**
Validate tool output against ag...
Details
- Author
- pchalasani
- Repository
- pchalasani/claude-code-tools
- Created
- 1 years ago
- Last Updated
- 3 days ago
- Language
- Python
- License
- MIT
Similar Skills
Semantically similar based on skill content — not just same category
AI & Automation Listed
ai-agents-patterns
When to activate: AI agents, LLM agents, ReAct, LangChain agents, tool use, memory, multi-agent, CrewAI, AutoGen, agent orchestration
0 Updated 1 weeks ago
Mattakushi432 AI & Automation Listed
ai-agent-design
Design autonomous AI agents that reason, plan, and execute tasks
4 Updated today
fabioc-aloha AI & Automation Listed
agent-runtime-patterns
Use when optimizing agent runtime loops, card packs, MCP session lifecycle, tool-call count, or multi-agent orchestration patterns.
6 Updated 1 months ago
yeaight7