agents.simple.lazy_simple_agent

Ultra-optimized SimpleAgent implementation that achieves sub-3 second import times. through comprehensive lazy loading and intelligent caching.

This approach uses proxy objects and deferred imports to avoid loading any heavy dependencies (LangChain, NumPy, Pandas, etc.) until they’re actually needed.

Usage:

# Ultra-fast import - no heavy dependencies from haive.agents.simple.lazy_simple_agent import LazySimpleAgent as SimpleAgentV3

# Heavy loading happens only when actually used agent = SimpleAgent(name=”test”) # Still fast - creates proxy result = await agent.arun(“Hello”) # Heavy loading happens here

Classes

LazyAgent

Lazy proxy for Agent base class.

LazyAugLLMConfig

Lazy proxy for AugLLMConfig that defers all heavy imports.

LazySimpleAgent

Ultra-optimized SimpleAgent with comprehensive lazy loading.

Functions

cached_import(module_path[, class_name])

Cached import with intelligent loading.

Module Contents

class agents.simple.lazy_simple_agent.LazyAgent(**kwargs)

Lazy proxy for Agent base class.

Init .

class agents.simple.lazy_simple_agent.LazyAugLLMConfig(**kwargs)

Lazy proxy for AugLLMConfig that defers all heavy imports.

Init .

class agents.simple.lazy_simple_agent.LazySimpleAgent(name='LazySimpleAgent', engine=None, temperature=None, max_tokens=None, model_name=None, debug=True, **kwargs)

Ultra-optimized SimpleAgent with comprehensive lazy loading.

Initialize with minimal overhead - no heavy imports.

Parameters:
  • name (str)

  • engine (Any | None)

  • temperature (float | None)

  • max_tokens (int | None)

  • model_name (str | None)

  • debug (bool)

async arun(*args, **kwargs)

Async run - triggers full initialization.

classmethod as_structured_tool(*args, **kwargs)

Create structured tool - triggers full initialization.

classmethod as_tool(*args, **kwargs)

Create tool - triggers full initialization.

run(*args, **kwargs)

Sync run - triggers full initialization.

property name: str

Name.

Returns:

Add return description]

Return type:

[TODO

agents.simple.lazy_simple_agent.cached_import(module_path, class_name=None)

Cached import with intelligent loading.

Parameters:
  • module_path (str)

  • class_name (str | None)