forked from lastmile-ai/mcp-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAgent_Workflow_Patterns.json
More file actions
227 lines (227 loc) · 10.6 KB
/
Agent_Workflow_Patterns.json
File metadata and controls
227 lines (227 loc) · 10.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
{
"description": "Abstract Components Overview",
"components": [
{
"name": "LLM Augmentation Layer",
"description": "This foundational component provides a unified and augmented interface for interacting with various Large Language Models (LLMs) from different providers (e.g., Anthropic, OpenAI, Google). It abstracts away provider-specific API calls, handles structured completion, and integrates with the agent's context. It also includes a ModelSelector for choosing optimal LLMs.",
"referenced_source_code": [
{
"qualified_name": "mcp_agent.workflows.llm.augmented_llm.AugmentedLLM",
"reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm.py",
"reference_start_line": 218,
"reference_end_line": 668
},
{
"qualified_name": "mcp_agent.workflows.llm.llm_selector.ModelSelector",
"reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/llm/llm_selector.py",
"reference_start_line": 96,
"reference_end_line": 413
},
{
"qualified_name": "mcp_agent.workflows.llm.augmented_llm_anthropic.AnthropicAugmentedLLM",
"reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_anthropic.py",
"reference_start_line": 110,
"reference_end_line": 722
}
]
},
{
"name": "Embedding Models",
"description": "This component offers a standardized interface for generating and managing text embeddings using various underlying embedding models (e.g., Cohere, OpenAI). These vector representations of text are crucial for semantic search, similarity comparisons, and other vector-based operations.",
"referenced_source_code": [
{
"qualified_name": "mcp_agent.workflows.embedding.embedding_base.EmbeddingModel",
"reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/embedding/embedding_base.py",
"reference_start_line": 13,
"reference_end_line": 31
},
{
"qualified_name": "mcp_agent.workflows.embedding.embedding_cohere.CohereEmbeddingModel",
"reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/embedding/embedding_cohere.py",
"reference_start_line": 18,
"reference_end_line": 72
},
{
"qualified_name": "mcp_agent.workflows.embedding.embedding_openai.OpenAIEmbeddingModel",
"reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/embedding/embedding_openai.py",
"reference_start_line": 18,
"reference_end_line": 70
}
]
},
{
"name": "Orchestration Workflow",
"description": "Responsible for managing complex, multi-step agent behaviors. It defines how agents plan, execute, and refine sequences of actions and tasks, often involving iterative processes and dynamic task management. This enables agents to break down complex problems into manageable steps and coordinate their execution.",
"referenced_source_code": [
{
"qualified_name": "mcp_agent.workflows.orchestrator.orchestrator.Orchestrator",
"reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/orchestrator/orchestrator.py",
"reference_start_line": 45,
"reference_end_line": 585
},
{
"qualified_name": "mcp_agent.workflows.orchestrator.orchestrator_models.AgentTask",
"reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/orchestrator/orchestrator_models.py",
"reference_start_line": 26,
"reference_end_line": 31
},
{
"qualified_name": "mcp_agent.workflows.orchestrator.orchestrator_prompts",
"reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/orchestrator/orchestrator_prompts.py",
"reference_start_line": 0,
"reference_end_line": 0
}
]
},
{
"name": "Routing Workflow",
"description": "Intelligently directs incoming requests or tasks to the most appropriate agent, tool, or sub-workflow. It supports various routing strategies, including LLM-based decision-making and embedding-based similarity matching, enabling dynamic and context-aware task distribution within the agent system.",
"referenced_source_code": [
{
"qualified_name": "mcp_agent.workflows.router.router_base.Router",
"reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/router/router_base.py",
"reference_start_line": 63,
"reference_end_line": 275
},
{
"qualified_name": "mcp_agent.workflows.router.router_llm.LLMRouter",
"reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/router/router_llm.py",
"reference_start_line": 81,
"reference_end_line": 373
},
{
"qualified_name": "mcp_agent.workflows.router.router_embedding.EmbeddingRouter",
"reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/router/router_embedding.py",
"reference_start_line": 28,
"reference_end_line": 239
}
]
},
{
"name": "Intent Classification Workflow",
"description": "Dedicated to identifying the underlying intent of a user's query or system message. It leverages both LLM-based reasoning and embedding-based similarity to accurately classify intents, which then informs the agent's subsequent actions or selection of appropriate workflows.",
"referenced_source_code": [
{
"qualified_name": "mcp_agent.workflows.intent_classifier.intent_classifier_base.IntentClassifier",
"reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/intent_classifier/intent_classifier_base.py",
"reference_start_line": 42,
"reference_end_line": 85
},
{
"qualified_name": "mcp_agent.workflows.intent_classifier.intent_classifier_llm.LLMIntentClassifier",
"reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/intent_classifier/intent_classifier_llm.py",
"reference_start_line": 63,
"reference_end_line": 243
},
{
"qualified_name": "mcp_agent.workflows.intent_classifier.intent_classifier_embedding.EmbeddingIntentClassifier",
"reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/intent_classifier/intent_classifier_embedding.py",
"reference_start_line": 32,
"reference_end_line": 177
}
]
},
{
"name": "Parallel LLM Workflow",
"description": "Enables the concurrent execution of multiple LLM calls or agent actions. It implements \"fan-out\" to distribute tasks in parallel and \"fan-in\" to aggregate their results, significantly improving the efficiency and throughput of LLM-intensive operations.",
"referenced_source_code": [
{
"qualified_name": "mcp_agent.workflows.parallel.parallel_llm.ParallelLLM",
"reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/parallel/parallel_llm.py",
"reference_start_line": 23,
"reference_end_line": 279
},
{
"qualified_name": "mcp_agent.workflows.parallel.fan_in.FanIn",
"reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/parallel/fan_in.py",
"reference_start_line": 30,
"reference_end_line": 422
},
{
"qualified_name": "mcp_agent.workflows.parallel.fan_out.FanOut",
"reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/parallel/fan_out.py",
"reference_start_line": 23,
"reference_end_line": 243
}
]
},
{
"name": "Swarm Workflow",
"description": "Facilitates collaborative problem-solving among multiple agents. It enables agents to interact, share information, and collectively work towards a common goal, supporting complex, distributed agent behaviors and multi-agent systems.",
"referenced_source_code": [
{
"qualified_name": "mcp_agent.workflows.swarm.swarm.Swarm",
"reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/swarm/swarm.py",
"reference_start_line": 189,
"reference_end_line": 310
},
{
"qualified_name": "mcp_agent.workflows.swarm.swarm_anthropic.AnthropicSwarm",
"reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/swarm/swarm_anthropic.py",
"reference_start_line": 8,
"reference_end_line": 41
},
{
"qualified_name": "mcp_agent.workflows.swarm.swarm_openai.OpenAISwarm",
"reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/swarm/swarm_openai.py",
"reference_start_line": 8,
"reference_end_line": 40
}
]
},
{
"name": "Evaluation & Optimization Workflow",
"description": "Provides mechanisms for evaluating the performance, quality, and effectiveness of agent outputs or entire workflows. It can be used to assess responses, identify areas for improvement, and potentially guide the agent towards optimizing its future actions.",
"referenced_source_code": [
{
"qualified_name": "mcp_agent.workflows.evaluator_optimizer.evaluator_optimizer.EvaluatorOptimizerLLM",
"reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/evaluator_optimizer/evaluator_optimizer.py",
"reference_start_line": 47,
"reference_end_line": 475
}
]
}
],
"components_relations": [
{
"relation": "uses",
"src_name": "Orchestration Workflow",
"dst_name": "LLM Augmentation Layer"
},
{
"relation": "uses",
"src_name": "Routing Workflow",
"dst_name": "LLM Augmentation Layer"
},
{
"relation": "uses",
"src_name": "Routing Workflow",
"dst_name": "Embedding Models"
},
{
"relation": "uses",
"src_name": "Intent Classification Workflow",
"dst_name": "LLM Augmentation Layer"
},
{
"relation": "uses",
"src_name": "Intent Classification Workflow",
"dst_name": "Embedding Models"
},
{
"relation": "uses",
"src_name": "Parallel LLM Workflow",
"dst_name": "LLM Augmentation Layer"
},
{
"relation": "uses",
"src_name": "Swarm Workflow",
"dst_name": "LLM Augmentation Layer"
},
{
"relation": "uses",
"src_name": "Evaluation & Optimization Workflow",
"dst_name": "LLM Augmentation Layer"
}
]
}