Auto Tool Inventory
How `–auto` picks the tools it shows the planner
The --auto planner sees whatever the ToolResolver sees — install more tools and they show up automatically.
from praisonaiagents import Agent
# The --auto planner sees whatever the ToolResolver sees. Install more
# tools and they show up automatically — no config change.
agent = Agent(name="planner", instructions="Plan an --auto run.")
agent.start("Research current AI trends and write a summary.")Quick Start
- Run auto mode
Run
--autowith your OpenAI key set:bash export OPENAI_API_KEY=sk-... praisonai --auto "research AI trends and write a summary"The planner’s
Available Tools:list reflects whatever is installed right now. - Install a tools package
Add more tools and the planner sees them next run — no config change:
bash pip install "praisonai-tools" - Rerun and watch the list grow
Run the same command again — the planner now advertises the newly installed tools:
bash praisonai --auto "research AI trends and write a summary"Confirm what the resolver can see with:
bash praisonai tools list
How It Works
The planner prompt’s Available Tools: line is filled from the canonical ToolResolver, so it always matches what your agents can call at run time.
The recommended set drawn from this inventory is also the task-scoped allow-list the server-side gate enforces on the LLM’s output — any tool the LLM invents outside that set is dropped from the saved YAML with a WARNING. See Auto-Generator Safety.
If the resolver is unavailable (import failure or air-gapped environment), the planner falls back to a frozen list so --auto still produces a working plan.
| Step | What happens |
|---|---|
| 1. Ask the resolver | get_available_tools() calls ToolResolver.list_available() |
| 2. Build the prompt | The real installed tools fill the Available Tools: line |
| 3. Plan | The LLM plans agents that reference tools that actually exist |
| 4. Fallback | If the resolver can’t load, a frozen list keeps --auto working |
Configuration Options
The inventory is driven by the resolver — configure it through the ToolResolver API rather than a separate setting.
How PraisonAI discovers and resolves every tool source
Auto Module SDK ReferenceFull API reference for AutoGenerator and BaseAutoGenerator
Common Patterns
Local tools.py picked up by the planner:
export PRAISONAI_ALLOW_LOCAL_TOOLS=true
# Drop a tools.py in your working directory, then:
praisonai --auto "summarise today's news"Register a wrapper ToolRegistry function so the planner sees it:
from praisonai import PraisonAI
def my_search(query: str) -> str:
"""Custom search function."""
return f"results for {query}"
praison = PraisonAI(agent_file="agents.yaml")
praison.agents_generator.tool_registry.register_function("my_search", my_search)
praison.run()Inject an explicit resolver for tests or multi-tenant runtimes:
from praisonai.agents_generator import AgentsGenerator
from praisonai.tool_resolver import ToolResolver
my_resolver = ToolResolver(tools_py_path="tools.py")
gen = AgentsGenerator(
agent_file="agents.yaml",
framework="praisonai",
config_list=[{"model": "gpt-4o", "api_key": "sk-..."}],
tool_resolver=my_resolver,
)Best Practices
Prefer the resolver over the frozen fallback
The frozen list exists only for offline / broken-import scenarios. In a normal install, let the resolver drive the inventory so the planner and your agents never drift apart.
Install praisonai-tools for CrewAI-style tools by name
When you want CrewAI-style tools referenced by name in --auto plans, install the package:
pip install "praisonai-tools"Pass tool_resolver= in tests to isolate
Inject your own resolver into AgentsGenerator(tool_resolver=...) so tests don’t share the process-wide default.
from praisonai.tool_resolver import ToolResolver
resolver = ToolResolver(tools_py_path="tools.py")Call reset_default_resolver() between tenants
In multi-tenant runtimes switching working directories, reset the context-local default before each tenant:
from praisonai.tool_resolver import reset_default_resolver
reset_default_resolver()