Custom LLM agents with decorators, tools, and advanced orchestration.
Agent
class is a task-oriented agent system that executes language model-based tasks in a customizable way. It works with LangChain compatible LLMs and has a customizable structure to plan your tasks and interact with tools when needed.
The main objective of this system:
Agent
to be task-orientedcustom_start
) functions when neededAgent
is a modular, task-focused abstraction for building intelligent LLM-powered units. It supports decorators, dynamic prompts, custom execution logic, and integration with tools โ enabling developers to compose flexible and reusable agent-based systems.
Agent
acts like a focused, autonomous LLM task handler.
Key principles:
Parameter | Type | Description |
---|---|---|
name | str | Unique identifier for the agent |
llm | BaseChatModel | LangChain-compatible LLM instance |
tools (opt) | list[Tool] | Optional tools the agent can use |
system_prompt (opt) | str | Initial system instruction |
custom_start (opt) | Callable | Override logic using a custom function |
custom_start
custom_start
method receives the following arguments:
input
tools
llm
system_prompt
Tool
includes a name, description, and a callable. Tools are directly usable in the agent flow.
start(input, verbose=False, **kwargs)
custom_start
is provided.
system_prompt
valuescustom_start
logicTaskFlow
:
Tool
for defining custom toolsTaskFlow
for full orchestration capabilitieschainless.Agent
helps you build modular AI logic, encapsulating capabilities into reusable and composable intelligent agents.