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

Orchestration

Orchestration engine in AgenticX.

Orchestration

Overview

AgenticX provides two complementary orchestration approaches:

  • Graph-based Workflows — explicit DAG with nodes and edges, full control
  • Flow Decorators — lightweight pipeline definition with Python decorators

Graph-based Workflow

python
1from agenticx.flow import Workflow, Node, Edge
2
3workflow = Workflow(id="research-pipeline")
4
5# Define nodes (each node is an agent task)
6fetch = Node(id="fetch", agent=fetch_agent, task=fetch_task)
7analyze = Node(id="analyze", agent=analyze_agent, task=analyze_task)
8report = Node(id="report", agent=report_agent, task=report_task)
9
10# Define edges (data flow)
11workflow.add_edge(Edge(source="fetch", target="analyze"))
12workflow.add_edge(Edge(source="analyze", target="report"))
13
14result = workflow.run()

Conditional Routing

python
1from agenticx.flow import ConditionalEdge
2
3def route_based_on_result(output):
4 if output.confidence > 0.8:
5 return "publish"
6 else:
7 return "review"
8
9workflow.add_edge(
10 ConditionalEdge(
11 source="analyze",
12 condition=route_based_on_result,
13 targets={"publish": publish_node, "review": review_node}
14 )
15)

Parallel Execution

python
1from agenticx.flow import ParallelNode
2
3# Run multiple agents concurrently
4parallel = ParallelNode(
5 id="parallel-research",
6 nodes=[fetch_news, fetch_papers, fetch_code],
7 merge_strategy="concat"
8)
9workflow.add_node(parallel)

Flow Decorators

For simpler pipelines, use the @flow decorator system:

python
1from agenticx.flow import flow, step
2
3@flow
4class ResearchPipeline:
5
6 @step
7 def fetch_data(self, query: str) -> str:
8 return self.fetch_agent.run(query)
9
10 @step
11 def analyze(self, data: str) -> dict:
12 return self.analyze_agent.run(data)
13
14 @step
15 def generate_report(self, analysis: dict) -> str:
16 return self.report_agent.run(analysis)
17
18pipeline = ResearchPipeline()
19result = pipeline.run(query="Latest AI research")

Execution Plans

For complex multi-step tasks, use execution plans:

python
1from agenticx.planner import ExecutionPlan, PlanStep
2
3plan = ExecutionPlan(
4 steps=[
5 PlanStep(id="1", description="Gather requirements", agent=analyst),
6 PlanStep(id="2", description="Design architecture", agent=architect, depends_on=["1"]),
7 PlanStep(id="3", description="Implement features", agent=developer, depends_on=["2"]),
8 PlanStep(id="4", description="Write tests", agent=tester, depends_on=["3"]),
9 ]
10)
11
12results = plan.execute()