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.

python
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.")
Diagram

Auto Tool Inventory

yes

no

🤖 –auto planner

ToolResolver
available?

📚 ToolResolver.list_available

🗂️ Frozen fallback list

✅ Prompt: Available Tools = live inventory

Quick Start

  1. Run auto mode

    Run --auto with 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.

  2. Install a tools package

    Add more tools and the planner sees them next run — no config change:

    bash
    pip install "praisonai-tools"
  3. 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.

Diagram
LLMToolResolverAutoGeneratorpraisonai –autoLLMToolResolverAutoGeneratorpraisonai –autogenerate(topic)list_available(){tool_name: source, …}prompt(topic, Available Tools=…)agents.yaml (with real tool names)agents.yaml

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.

StepWhat happens
1. Ask the resolverget_available_tools() calls ToolResolver.list_available()
2. Build the promptThe real installed tools fill the Available Tools: line
3. PlanThe LLM plans agents that reference tools that actually exist
4. FallbackIf 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.

Tool Resolver

How PraisonAI discovers and resolves every tool source

Auto Module SDK Reference

Full API reference for AutoGenerator and BaseAutoGenerator


Common Patterns

Local tools.py picked up by the planner:

bash
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:

python
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:

python
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:

bash
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.

python
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:

python
from praisonai.tool_resolver import reset_default_resolver

reset_default_resolver()

Related