Toolsets and progressive tool search
Group related tools with register_toolset
As your project grows beyond a handful of tools, stuffing 50 tool schemas into every prompt wastes tokens and confuses the model. PraisonAI solves this with named toolsets and progressive tool_search=True.
Running this example registers a reusable toolset and lists available toolsets cleanly.
Example
from praisonai import Agent, register_toolset, list_toolsets
register_toolset(
name='math_basics',
tools=['add', 'multiply'],
description='Simple arithmetic helpers',
overwrite=True,
)
print('Registered toolsets:', list_toolsets())Example explained
- register_toolset(…) — Groups related tool names under one reusable label.
- list_toolsets() — Lists all registered toolset names available to your agents.
Load tools on demand with tool_search=True
Setting tool_search=True on an Agent enables progressive disclosure: the agent discovers only the tool schemas it actually needs for the current turn, keeping token usage lean.
Expected output: the agent initializes with tool search enabled and prints its reply.
Example
from praisonai import Agent
agent = Agent(
instructions='Answer concisely.',
tool_search=True,
)
print(agent.start('Why does progressive tool discovery save tokens?'))Example explained
- tool_search=True — Enables on-demand tool discovery instead of sending every tool schema on every turn.
Reference: documentation