Security advisory — Malicious litellm versions 1.82.7 and 1.82.8 were removed from PyPI (potential API key exfiltration). Uninstall them, rotate exposed credentials, and upgrade to a safe release (e.g. 1.82.9+ per upstream). Run pip show litellm to verify. PyPI · README

Agents API

AgenticX agents API reference.

agenticx.agents

Agent

python
1class Agent(BaseModel):
2 id: str
3 name: str
4 role: str
5 goal: str
6 backstory: str = ""
7 organization_id: str
8 max_iter: int = 10
9 verbose: bool = False

The core agent definition. Agents are stateless — all state lives in the executor context.


AgentExecutor

python
1class AgentExecutor:
2 def __init__(
3 self,
4 agent: Agent,
5 llm: BaseLLMProvider,
6 tools: list[Callable] = [],
7 memory: MemoryManager | None = None,
8 tracer: BaseTracer | None = None,
9 human_in_the_loop: HumanInTheLoop | None = None,
10 sanitizer: InputSanitizer | None = None,
11 policy: PolicyEngine | None = None,
12 ): ...
13
14 def run(self, task: Task) -> str: ...
15 async def arun(self, task: Task) -> str: ...

Task

python
1class Task(BaseModel):
2 id: str = ""
3 description: str
4 expected_output: str = ""
5 context: dict = {}

Tool decorator

python
1from agenticx.tools import tool
2
3@tool
4def my_tool(param: str) -> str:
5 """Tool description.
6
7 Args:
8 param: Parameter description
9
10 Returns:
11 Output description
12 """
13 return f"Processed: {param}"

Common patterns

Basic agent

python
1from agenticx import Agent, Task, AgentExecutor
2from agenticx.llms import OpenAIProvider
3
4agent = Agent(
5 id="my-agent",
6 name="Assistant",
7 role="Helper",
8 goal="Assist users"
9)
10
11task = Task(description="Help me with...")
12
13executor = AgentExecutor(
14 agent=agent,
15 llm=OpenAIProvider(model="gpt-4o")
16)
17
18result = executor.run(task)

With tools

python
1@tool
2def search(query: str) -> str:
3 return f"Results for: {query}"
4
5executor = AgentExecutor(
6 agent=agent,
7 llm=OpenAIProvider(model="gpt-4o"),
8 tools=[search]
9)

With memory

python
1from agenticx.memory import MemoryManager
2
3executor = AgentExecutor(
4 agent=agent,
5 llm=OpenAIProvider(model="gpt-4o"),
6 memory=MemoryManager()
7)

!!! tip "Full API Reference"

Auto-generated API docs from source code are coming soon. In the meantime, refer to the source on GitHub.