coaiajs 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/KINSHIP.md +1 -1
  2. package/README.md +191 -75
  3. package/dist/mcp/config.d.ts.map +1 -0
  4. package/dist/mcp/config.js +0 -2
  5. package/dist/mcp/config.js.map +1 -0
  6. package/dist/mcp/prompts.d.ts.map +1 -0
  7. package/dist/mcp/prompts.js.map +1 -0
  8. package/dist/mcp/resources.d.ts.map +1 -0
  9. package/dist/mcp/resources.js.map +1 -0
  10. package/dist/mcp/server.d.ts.map +1 -0
  11. package/dist/mcp/server.js +1 -1
  12. package/dist/mcp/server.js.map +1 -0
  13. package/dist/mcp/tools/coaiapy-tools.d.ts.map +1 -0
  14. package/dist/mcp/tools/coaiapy-tools.js.map +1 -0
  15. package/dist/mcp/tools/index.d.ts.map +1 -0
  16. package/dist/mcp/tools/index.js.map +1 -0
  17. package/dist/src/audio.d.ts.map +1 -0
  18. package/dist/src/audio.js.map +1 -0
  19. package/dist/src/cli-helpers.d.ts.map +1 -0
  20. package/dist/src/cli-helpers.js.map +1 -0
  21. package/dist/src/cli.d.ts.map +1 -0
  22. package/dist/src/cli.js +1 -0
  23. package/dist/src/cli.js.map +1 -0
  24. package/dist/src/config.d.ts.map +1 -0
  25. package/dist/src/config.js.map +1 -0
  26. package/dist/src/environment.d.ts.map +1 -0
  27. package/dist/src/environment.js.map +1 -0
  28. package/dist/src/github.d.ts.map +1 -0
  29. package/dist/src/github.js.map +1 -0
  30. package/dist/src/index.d.ts +1 -0
  31. package/dist/src/index.d.ts.map +1 -0
  32. package/dist/src/index.js +1 -0
  33. package/dist/src/index.js.map +1 -0
  34. package/dist/src/langfuse/client.d.ts.map +1 -0
  35. package/dist/src/langfuse/client.js.map +1 -0
  36. package/dist/src/langfuse/comments.d.ts.map +1 -0
  37. package/dist/src/langfuse/comments.js.map +1 -0
  38. package/dist/src/langfuse/datasets.d.ts.map +1 -0
  39. package/dist/src/langfuse/datasets.js.map +1 -0
  40. package/dist/src/langfuse/index.d.ts +1 -0
  41. package/dist/src/langfuse/index.d.ts.map +1 -0
  42. package/dist/src/langfuse/index.js.map +1 -0
  43. package/dist/src/langfuse/media.d.ts.map +1 -0
  44. package/dist/src/langfuse/media.js.map +1 -0
  45. package/dist/src/langfuse/observations.d.ts.map +1 -0
  46. package/dist/src/langfuse/observations.js.map +1 -0
  47. package/dist/src/langfuse/prompts.d.ts +5 -1
  48. package/dist/src/langfuse/prompts.d.ts.map +1 -0
  49. package/dist/src/langfuse/prompts.js +16 -3
  50. package/dist/src/langfuse/prompts.js.map +1 -0
  51. package/dist/src/langfuse/scores.d.ts.map +1 -0
  52. package/dist/src/langfuse/scores.js.map +1 -0
  53. package/dist/src/langfuse/traces.d.ts.map +1 -0
  54. package/dist/src/langfuse/traces.js.map +1 -0
  55. package/dist/src/llm.d.ts.map +1 -0
  56. package/dist/src/llm.js.map +1 -0
  57. package/dist/src/narrative/graph-manager.d.ts.map +1 -0
  58. package/dist/src/narrative/graph-manager.js.map +1 -0
  59. package/dist/src/narrative/index.d.ts.map +1 -0
  60. package/dist/src/narrative/index.js.map +1 -0
  61. package/dist/src/narrative/markdown-export.d.ts.map +1 -0
  62. package/dist/src/narrative/markdown-export.js.map +1 -0
  63. package/dist/src/narrative/tool-definitions.d.ts.map +1 -0
  64. package/dist/src/narrative/tool-definitions.js.map +1 -0
  65. package/dist/src/narrative/tool-handlers.d.ts.map +1 -0
  66. package/dist/src/narrative/tool-handlers.js.map +1 -0
  67. package/dist/src/narrative/types.d.ts.map +1 -0
  68. package/dist/src/narrative/types.js.map +1 -0
  69. package/dist/src/narrative/validation.d.ts.map +1 -0
  70. package/dist/src/narrative/validation.js.map +1 -0
  71. package/dist/src/pde/index.d.ts.map +1 -0
  72. package/dist/src/pde/index.js.map +1 -0
  73. package/dist/src/pde/mcp-handlers.d.ts.map +1 -0
  74. package/dist/src/pde/mcp-handlers.js.map +1 -0
  75. package/dist/src/pde/mcp-tools.d.ts.map +1 -0
  76. package/dist/src/pde/mcp-tools.js.map +1 -0
  77. package/dist/src/pde/session-manager.d.ts.map +1 -0
  78. package/dist/src/pde/session-manager.js.map +1 -0
  79. package/dist/src/pde/stc-mapper.d.ts.map +1 -0
  80. package/dist/src/pde/stc-mapper.js.map +1 -0
  81. package/dist/src/pipeline/index.d.ts.map +1 -0
  82. package/dist/src/pipeline/index.js.map +1 -0
  83. package/dist/src/pipeline/template-engine.d.ts.map +1 -0
  84. package/dist/src/pipeline/template-engine.js.map +1 -0
  85. package/dist/src/planning/index.d.ts.map +1 -0
  86. package/dist/src/planning/index.js.map +1 -0
  87. package/dist/src/planning/mcp-handlers.d.ts.map +1 -0
  88. package/dist/src/planning/mcp-handlers.js.map +1 -0
  89. package/dist/src/planning/mcp-tools.d.ts.map +1 -0
  90. package/dist/src/planning/mcp-tools.js.map +1 -0
  91. package/dist/src/planning/plan-parser.d.ts.map +1 -0
  92. package/dist/src/planning/plan-parser.js.map +1 -0
  93. package/dist/src/redis.d.ts.map +1 -0
  94. package/dist/src/redis.js.map +1 -0
  95. package/dist/src/types.d.ts.map +1 -0
  96. package/dist/src/types.js.map +1 -0
  97. package/dist/src/version.d.ts.map +1 -0
  98. package/dist/src/version.js.map +1 -0
  99. package/llms-full.txt +361 -0
  100. package/llms.txt +43 -0
  101. package/package.json +79 -12
  102. package/.claude/settings.local.json +0 -17
  103. package/.claude-plugin/marketplace.json +0 -26
  104. package/articles/academic/NOTES.md +0 -1
  105. package/articles/academic/README.md +0 -1
  106. package/articles/academic/creative-orientation-vs-problem-solving.md +0 -177
  107. package/articles/academic/jsonl-knowledge-graphs-agent-memory.md +0 -142
  108. package/articles/academic/langfuse-observability-llm-pipelines.md +0 -144
  109. package/articles/academic/medicine-wheel-software-architecture.md +0 -163
  110. package/articles/academic/mmot-autonomous-agents.md +0 -156
  111. package/articles/academic/model-context-protocol-interagent.md +0 -161
  112. package/articles/academic/pde-prompt-decomposition.md +0 -186
  113. package/articles/academic/structural-tension-in-ai-agents.md +0 -134
  114. package/articles/reviews/mcp-protocol-design-review.md +0 -170
  115. package/articles/reviews/observability-ai-systems-review.md +0 -176
  116. package/articles/reviews/prompt-engineering-decomposition-review.md +0 -184
  117. package/articles/surveys/agent-orchestration-survey.md +0 -186
  118. package/articles/surveys/knowledge-graph-storage-survey.md +0 -204
  119. package/articles/surveys/structural-tension-methodology-survey.md +0 -154
  120. package/articles/technical/aws-sdk-v3-polly.md +0 -270
  121. package/articles/technical/commander-cli-framework.md +0 -262
  122. package/articles/technical/dotenv-config-patterns.md +0 -360
  123. package/articles/technical/ioredis-vs-redis.md +0 -142
  124. package/articles/technical/langfuse-js-sdk-vs-rest.md +0 -191
  125. package/articles/technical/mcp-sdk-typescript.md +0 -291
  126. package/articles/technical/octokit-github-api.md +0 -293
  127. package/articles/technical/openai-sdk-modern.md +0 -231
  128. package/articles/technical/yaml-parsing-node.md +0 -266
  129. package/articles/technical/zod-runtime-validation.md +0 -212
  130. package/coaiajs-langfuse-claude-plugin/.claude-plugin/marketplace.json +0 -16
  131. package/coaiajs-langfuse-claude-plugin/.claude-plugin/plugin.json +0 -10
  132. package/coaiajs-langfuse-claude-plugin/.mcp.json +0 -8
  133. package/coaiajs-langfuse-claude-plugin/README.md +0 -60
  134. package/mcp/config.ts +0 -225
  135. package/mcp/prompts.ts +0 -131
  136. package/mcp/resources.ts +0 -84
  137. package/mcp/server.ts +0 -519
  138. package/mcp/tools/coaiapy-tools.ts +0 -366
  139. package/mcp/tools/index.ts +0 -4
  140. package/src/audio.ts +0 -76
  141. package/src/cli-helpers.ts +0 -86
  142. package/src/cli.ts +0 -1261
  143. package/src/config.ts +0 -207
  144. package/src/environment.ts +0 -171
  145. package/src/github.ts +0 -143
  146. package/src/index.ts +0 -82
  147. package/src/langfuse/client.ts +0 -105
  148. package/src/langfuse/comments.ts +0 -52
  149. package/src/langfuse/datasets.ts +0 -178
  150. package/src/langfuse/index.ts +0 -37
  151. package/src/langfuse/media.ts +0 -193
  152. package/src/langfuse/observations.ts +0 -155
  153. package/src/langfuse/prompts.ts +0 -157
  154. package/src/langfuse/scores.ts +0 -456
  155. package/src/langfuse/traces.ts +0 -353
  156. package/src/llm.ts +0 -106
  157. package/src/narrative/graph-manager.ts +0 -1358
  158. package/src/narrative/index.ts +0 -188
  159. package/src/narrative/markdown-export.ts +0 -535
  160. package/src/narrative/tool-definitions.ts +0 -635
  161. package/src/narrative/tool-handlers.ts +0 -528
  162. package/src/narrative/types.ts +0 -9
  163. package/src/narrative/validation.ts +0 -179
  164. package/src/pde/index.ts +0 -34
  165. package/src/pde/mcp-handlers.ts +0 -359
  166. package/src/pde/mcp-tools.ts +0 -201
  167. package/src/pde/session-manager.ts +0 -248
  168. package/src/pde/stc-mapper.ts +0 -298
  169. package/src/pipeline/index.ts +0 -7
  170. package/src/pipeline/template-engine.ts +0 -398
  171. package/src/planning/index.ts +0 -32
  172. package/src/planning/mcp-handlers.ts +0 -369
  173. package/src/planning/mcp-tools.ts +0 -155
  174. package/src/planning/plan-parser.ts +0 -587
  175. package/src/redis.ts +0 -111
  176. package/src/types.ts +0 -281
  177. package/src/version.ts +0 -39
  178. package/test/config.test.mjs +0 -93
  179. package/tsconfig.json +0 -26
@@ -1,176 +0,0 @@
1
- # Literature Review: Observability in AI Systems
2
-
3
- > Literature review for the CoAiA.js project — OpenTelemetry for LLMs, Langfuse, LangSmith, and Weights & Biases examined through the trace/span/generation model for AI application monitoring.
4
-
5
- ## Abstract
6
-
7
- Observability for AI systems—particularly LLM-powered applications—has evolved rapidly from ad-hoc logging to structured tracing frameworks that capture the full lifecycle of model interactions. This literature review examines the current state of AI observability through four lenses: OpenTelemetry as the emerging standard for vendor-neutral instrumentation, Langfuse as the leading open-source LLM observability platform, LangSmith as the LangChain-native monitoring solution, and Weights & Biases (W&B Weave) as the experiment-tracking platform extending into production monitoring. We analyze the convergence on a trace/span/generation data model, evaluate each platform's approach to evaluation and scoring, and identify the gap that structural tension methodology fills: transforming observability from a problem-detection tool into a creative advancement instrument.
8
-
9
- ## Introduction
10
-
11
- Traditional software observability rests on three pillars: logs (event records), metrics (aggregated measurements), and traces (request-scoped execution paths). These pillars, standardized through OpenTelemetry, have proven sufficient for deterministic systems where identical inputs produce identical outputs and where "correct behavior" is well-defined [1][2].
12
-
13
- LLM-powered applications violate both assumptions. Identical prompts can produce different outputs across invocations (non-determinism), and "correct behavior" is often subjective—dependent on context, user intent, and quality standards that resist formal specification. This fundamental shift requires observability approaches that capture not just operational health but **semantic quality**: what was generated, whether it was helpful, and how it compares to desired standards [3].
14
-
15
- The 2024–2025 period has seen the rapid emergence of LLM-specific observability platforms that extend the traditional three pillars with a fourth: **evaluation**—structured assessment of output quality through automated scoring, human annotation, and LLM-as-judge techniques.
16
-
17
- ## Review
18
-
19
- ### OpenTelemetry: The Foundation Layer
20
-
21
- **Overview:** OpenTelemetry (OTel) is a CNCF (Cloud Native Computing Foundation) project that provides vendor-neutral APIs, SDKs, and tools for generating and collecting telemetry data. It has become the de facto standard for observability instrumentation in cloud-native applications [1][4].
22
-
23
- **LLM Extensions:** The OpenTelemetry community has developed semantic conventions for LLM operations, defining standard attribute names for:
24
- - Model name and version
25
- - Token counts (input, output, total)
26
- - Prompt and completion content (with optional redaction)
27
- - Temperature and other generation parameters
28
- - Cost attribution
29
-
30
- These conventions enable LLM telemetry to flow through existing OTel infrastructure (collectors, exporters, backends) without requiring LLM-specific tooling for data transport [4][5].
31
-
32
- **Strengths:**
33
- - Vendor-neutral: data can be routed to any compatible backend
34
- - Mature ecosystem: collectors, exporters, and instrumentation libraries for all major languages
35
- - Standards-based: semantic conventions ensure consistent data representation
36
- - Composable: LLM traces can be correlated with infrastructure traces for full-stack visibility
37
-
38
- **Limitations:**
39
- - Generic by design: LLM-specific concepts (prompt management, evaluation workflows, cost optimization) are not addressed
40
- - No built-in evaluation: OTel collects data but does not analyze quality
41
- - Configuration complexity: setting up collectors, exporters, and backends requires significant infrastructure knowledge [6]
42
-
43
- **Literature Position:** OTel is best understood as a foundation layer—it provides the instrumentation and transport upon which LLM-specific platforms build. Several LLM observability platforms (Langfuse, LangSmith) now support OTel data ingestion, enabling teams to use standard OTel instrumentation while routing LLM-specific data to specialized analysis platforms.
44
-
45
- ### Langfuse: Open-Source LLM Observability
46
-
47
- **Overview:** Langfuse is an open-source (MIT-licensed) LLM observability platform providing trace-based monitoring, prompt management, evaluation workflows, and cost analytics. It can be self-hosted as a single Docker container or accessed through managed cloud hosting [7][8].
48
-
49
- **Data Model:** Langfuse implements a hierarchical trace model:
50
- - **Traces** represent end-to-end executions (user request → final response)
51
- - **Spans** represent logical subdivisions (retrieval, prompt construction, generation)
52
- - **Generations** represent specific LLM completions with full prompt/completion capture
53
- - **Scores** represent quality assessments attached at any level of the hierarchy
54
-
55
- **Evaluation Capabilities:**
56
- - LLM-as-Judge: automated quality scoring using a judge model
57
- - Annotation Queues: human review workflows with structured scoring
58
- - Dataset Management: curated evaluation sets for regression testing
59
- - Prompt Experimentation: A/B testing with tracked performance metrics [9]
60
-
61
- **Literature Assessment:** Langfuse occupies a unique position in the observability landscape: open-source, self-hostable, and increasingly feature-complete. Its MIT license addresses the data sovereignty concerns that prevent many organizations from using cloud-only platforms. As of 2025, all major features (including formerly "Pro" capabilities like LLM-as-judge) are fully open source [10].
62
-
63
- **Key Publication:** Langfuse's blog post on OpenTelemetry integration (October 2024) is a significant technical document, demonstrating how LLM-specific observability can be built on standardized instrumentation rather than proprietary data collection [4].
64
-
65
- ### LangSmith: LangChain-Native Monitoring
66
-
67
- **Overview:** LangSmith is the observability platform developed by LangChain Inc., designed for deep integration with LangChain and LangGraph applications. It provides tracing, evaluation, dataset management, and prompt monitoring with tight coupling to the LangChain execution model [11].
68
-
69
- **Key Features:**
70
- - Automatic tracing of LangChain chains, agents, and tools
71
- - End-to-end OpenTelemetry support (announced 2025)
72
- - Evaluation workflows with human annotation and automated scoring
73
- - Prompt hub for versioning and sharing prompt templates
74
- - Regression detection through dataset-based testing
75
-
76
- **Strengths:**
77
- - Deepest integration with LangChain/LangGraph ecosystem
78
- - Most comprehensive evaluation workflow (A/B testing, regression gating, win-rate analysis)
79
- - Strong enterprise features (access control, compliance, audit trails)
80
- - OTel bridge enables integration with broader observability infrastructure [11]
81
-
82
- **Limitations:**
83
- - Primarily a cloud service (limited self-hosting options)
84
- - Tightly coupled to LangChain ecosystem
85
- - Proprietary—dependency on LangChain Inc.'s business model
86
-
87
- **Literature Assessment:** LangSmith is the most feature-rich LLM observability platform, particularly for teams already invested in the LangChain ecosystem. Its adoption of OpenTelemetry standards signals a convergence in the industry toward standardized instrumentation. However, its cloud-first model and ecosystem coupling create vendor lock-in concerns.
88
-
89
- ### Weights & Biases (W&B Weave): Experiment Tracking to Production
90
-
91
- **Overview:** Weights & Biases, originally an experiment tracking platform for ML research, has extended into LLM application monitoring through its Weave product. Weave provides tracing, evaluation, and comparison capabilities specifically for LLM applications [12][13].
92
-
93
- **Key Features:**
94
- - Side-by-side experiment comparison (prompts, models, parameters)
95
- - Automatic token and cost tracking
96
- - Trace-based debugging with full input/output capture
97
- - Integration with research workflows (MLflow compatibility)
98
- - Real-time dashboards with custom metrics
99
-
100
- **Strengths:**
101
- - Research-to-production continuity: teams using W&B for ML research can extend to LLM monitoring
102
- - Deep experiment comparison capabilities
103
- - Strong visualization tools
104
- - Broad model and framework support
105
-
106
- **Limitations:**
107
- - Primarily cloud-hosted
108
- - Research-oriented UX may not suit operations teams
109
- - Less LLM-specific than Langfuse or LangSmith
110
- - Pricing can be significant for high-volume production use [13]
111
-
112
- **Literature Assessment:** W&B Weave is best suited for teams that bridge research and production—organizations that experiment with different models, prompts, and architectures and need to carry insights from experimentation into production monitoring.
113
-
114
- ### Emerging Platforms
115
-
116
- Beyond the four primary platforms, the literature notes several emerging tools:
117
-
118
- - **Arize Phoenix:** Focus on drift detection and production monitoring with strong visualization
119
- - **Helicone:** No-code observability with particular strength in cost analytics and caching optimization
120
- - **Maxim AI:** Agent-specific tracing with support for diverse agent architectures
121
- - **VictoriaMetrics + OTel:** Infrastructure-first approach integrating AI agent observability into existing monitoring stacks [14][15]
122
-
123
- ### Convergence Patterns
124
-
125
- The literature reveals several convergent trends:
126
-
127
- 1. **Trace/span/generation as standard model.** All platforms have converged on this hierarchical data model, whether they call it "traces" (Langfuse, LangSmith) or "runs" (W&B).
128
-
129
- 2. **OpenTelemetry as foundation.** Langfuse, LangSmith, and emerging platforms increasingly support OTel data ingestion, suggesting convergence on standardized instrumentation.
130
-
131
- 3. **Evaluation as core capability.** All platforms have moved beyond passive observation to active evaluation—automated scoring, human annotation, and regression testing.
132
-
133
- 4. **Cost attribution as first-class concern.** LLM applications have direct, per-request costs that traditional applications lack. All platforms now track and attribute costs.
134
-
135
- 5. **Self-hosting demand.** Data sovereignty requirements are driving open-source and self-hostable solutions, with Langfuse leading this trend.
136
-
137
- ### The Structural Tension Observability Gap
138
-
139
- The literature reveals a gap in current observability thinking: all platforms treat observability as **problem-detection**—finding errors, identifying bottlenecks, detecting drift. None frame observability as **creative advancement**—measuring progress toward a desired quality standard while maintaining honest current reality assessment.
140
-
141
- This gap is precisely where structural tension methodology contributes. By mapping:
142
- - Traces → STC progressions (how is the agent advancing toward its creative goal?)
143
- - Scores → MMOT evaluations (honest assessment of output quality against Elements of Performance)
144
- - Reality updates → observation data (what does the observability data tell us about current reality?)
145
-
146
- ...observability transforms from defensive monitoring into a creative instrument that drives purposeful advancement.
147
-
148
- ## Implications for CoAiA.js
149
-
150
- 1. **Langfuse as primary observability backend.** Open-source, self-hostable, and MIT-licensed—aligned with CoAiA.js's zero-dependency philosophy.
151
- 2. **OpenTelemetry instrumentation.** Standard OTel spans for all agent operations, enabling routing to any compatible backend.
152
- 3. **MMOT-as-score integration.** Self-evaluation scores flow to Langfuse as structured quality signals.
153
- 4. **Cost-aware agents.** Token and cost data from Langfuse informs agent decision-making (model selection, context management).
154
- 5. **Creative-orientation observability.** Dashboards frame metrics as tension indicators (how far is current reality from desired outcome?) rather than problem indicators (what's broken?).
155
-
156
- ## Conclusion
157
-
158
- AI observability has matured rapidly from ad-hoc logging to structured, platform-supported monitoring with evaluation capabilities. The convergence on the trace/span/generation model, OpenTelemetry standardization, and active evaluation workflows provides a solid foundation. The remaining gap—transforming observability from problem-detection to creative advancement—is addressed by integrating structural tension methodology with the observability data model, a contribution that CoAiA.js implements through MMOT-as-score and creative-orientation dashboards.
159
-
160
- ## References
161
-
162
- 1. OpenTelemetry. "What is OpenTelemetry?" https://opentelemetry.io/docs/what-is-opentelemetry/
163
- 2. Glukhov.org. (2024). "Observability for LLM Systems." https://www.glukhov.org/observability/observability-for-llm-systems/
164
- 3. Elysiate. (2025). "LLM Observability: Monitoring, Tracing, and Cost Control." https://www.elysiate.com/blog/llm-observability-monitoring-langsmith-helicone-2025
165
- 4. Langfuse. (2024). "OpenTelemetry for LLM Observability." https://langfuse.com/blog/2024-10-opentelemetry-for-llm-observability
166
- 5. Grafana. (2024). "LLM Observability with OpenTelemetry and Grafana Cloud." https://grafana.com/blog/a-complete-guide-to-llm-observability-with-opentelemetry-and-grafana-cloud/
167
- 6. Spanora AI. (2025). "OpenTelemetry LLM Monitoring." https://spanora.ai/blog/opentelemetry-llm-monitoring
168
- 7. Langfuse GitHub. https://github.com/langfuse/langfuse
169
- 8. Mayol, M. (2025). "Langfuse: The Definitive LLM Observability Platform." https://marcmayol.com/blog/en/langfuse_the_definitive_observability_platform_for_llms_in_2025/
170
- 9. Pondhouse Data. "Langfuse: The Open Source Observability Platform." https://www.pondhouse-data.com/blog/langfuse-observability-platform
171
- 10. It's FOSS. (2025). "LLM Analytics Platform Langfuse Goes Open Source." https://itsfoss.com/news/langfuse-open-source/
172
- 11. LangChain Blog. (2025). "End-to-End OpenTelemetry Support in LangSmith." https://blog.langchain.com/end-to-end-opentelemetry-langsmith/
173
- 12. AI Multiple Research. (2024). "LLM Observability Tools: Weights & Biases, LangSmith." https://research.aimultiple.com/llm-observability/
174
- 13. GetMaxim. (2025). "Top AI Observability Tools in 2025." https://www.getmaxim.ai/articles/top-ai-observability-tools-in-2025-the-ultimate-guide/
175
- 14. VictoriaMetrics. (2025). "AI Agents Observability with OpenTelemetry." https://victoriametrics.com/blog/ai-agents-observability/
176
- 15. DEV Community. (2025). "LLM Observability with OpenTelemetry: A Practical Guide." https://dev.to/kartikdudeja21/llm-observability-with-opentelemetry-a-practical-guide-3clo
@@ -1,184 +0,0 @@
1
- # Literature Review: Prompt Engineering and Decomposition Methodologies
2
-
3
- > Literature review for the CoAiA.js project — From Chain-of-Thought to Tree-of-Thought, Self-Consistency, and PDE: a review of how prompt decomposition strategies address complexity in LLM applications.
4
-
5
- ## Abstract
6
-
7
- Prompt engineering has evolved from simple instruction formatting to a sophisticated discipline encompassing reasoning strategies, decomposition techniques, and quality-assurance methodologies. This literature review examines the major prompt decomposition approaches—Chain-of-Thought (CoT), Tree-of-Thought (ToT), Self-Consistency, Decomposed Prompting (DecomP), Plan-and-Solve, and Prompt Decomposition Engineering (PDE)—analyzing their theoretical foundations, empirical effectiveness, and complementary relationships. We identify a critical distinction in the literature between strategies that improve *reasoning quality* (CoT, ToT, Self-Consistency) and strategies that improve *input completeness* (DecomP, PDE), arguing that both categories are necessary for robust AI agent systems. The review situates PDE's unique contribution—extracting implicit intents from hedging language and organizing actions into Four Directions stacks—within this broader landscape.
8
-
9
- ## Introduction
10
-
11
- The quality of LLM output is profoundly shaped by input construction. A well-structured prompt can transform a mediocre model into an effective problem-solver, while a poorly structured prompt can cause a capable model to miss critical requirements, hallucinate details, or produce superficially correct but substantively incomplete results [1][2].
12
-
13
- The prompt engineering community has responded with an expanding toolkit of strategies, each addressing different aspects of the prompting challenge. This review organizes these strategies into a taxonomy based on what they optimize, examines their empirical support, and identifies the gaps that remain.
14
-
15
- ## Review
16
-
17
- ### Category 1: Reasoning Enhancement Strategies
18
-
19
- These strategies improve the quality of the model's reasoning process on a well-specified input.
20
-
21
- #### Chain-of-Thought Prompting (CoT)
22
-
23
- **Foundational Work:** Wei et al. (2022) demonstrated that prompting LLMs to show intermediate reasoning steps ("Let's think step by step") dramatically improves performance on multi-step problems, achieving state-of-the-art results on arithmetic, commonsense, and symbolic reasoning benchmarks [3].
24
-
25
- **Variants:**
26
- - **Zero-Shot CoT:** Simply adding "Let's think step by step" to any prompt (Kojima et al., 2022)
27
- - **Few-Shot CoT:** Providing examples with explicit reasoning chains
28
- - **Auto-CoT:** Automatically generating diverse reasoning demonstrations (Zhang et al., 2022)
29
-
30
- **Mechanism:** CoT works by encouraging the model to allocate computation to intermediate steps rather than jumping directly to an answer. The intermediate steps serve as a "scratchpad" that keeps the model's reasoning on track [4].
31
-
32
- **Empirical Support:** Strong and consistent. CoT improves performance on virtually all multi-step reasoning tasks, with gains proportional to task complexity. The technique is most effective for models above ~100B parameters.
33
-
34
- **Limitations:** CoT improves reasoning fidelity but does not address input completeness. If the prompt contains multiple intents, CoT may reason carefully about a subset while ignoring others. The model's selection of which intents to address remains uncontrolled [5].
35
-
36
- #### Tree-of-Thought (ToT)
37
-
38
- **Foundational Work:** Yao et al. (2023) extended CoT from linear reasoning to branching exploration, modeling the reasoning process as a tree where each node represents a partial solution and branches represent alternative reasoning paths [6].
39
-
40
- **Mechanism:** ToT prompts the model to:
41
- 1. Generate multiple possible next steps at each reasoning node
42
- 2. Evaluate each possibility using a value function (often the model itself)
43
- 3. Prune unpromising branches
44
- 4. Continue exploration along promising paths
45
-
46
- **Empirical Support:** ToT significantly outperforms CoT on problems requiring exploration—creative tasks, strategic planning, and scenarios with multiple valid approaches. The Game of 24 benchmark showed ToT solving 74% of problems vs. CoT's 4% [6].
47
-
48
- **Limitations:** ToT is computationally expensive (multiple model calls per reasoning step), introduces additional latency, and is most beneficial for problems where exploration is genuinely valuable. For straightforward sequential tasks, CoT is sufficient and more efficient.
49
-
50
- **Literature Context:** ToT represents a shift from prompt engineering as input formatting to prompt engineering as search algorithm design. The model becomes a component in a larger reasoning architecture rather than a standalone solution.
51
-
52
- #### Self-Consistency
53
-
54
- **Foundational Work:** Wang et al. (2022) proposed sampling multiple independent reasoning paths and selecting the most consistent answer—a technique analogous to ensemble methods in traditional ML [7].
55
-
56
- **Mechanism:** The model generates N different reasoning chains for the same prompt, each potentially following a different path. The final answer is determined by majority vote across the N chains.
57
-
58
- **Empirical Support:** Self-Consistency consistently improves upon single-chain CoT, particularly on problems where the reasoning path is ambiguous or where the model's initial reasoning may be led astray by surface-level patterns.
59
-
60
- **Limitations:** Computational cost scales linearly with N (number of sampled chains). The technique addresses reasoning reliability but not input completeness—all N chains reason about the same (potentially incomplete) interpretation of the input.
61
-
62
- ### Category 2: Task Structure Strategies
63
-
64
- These strategies address the organization and decomposition of the task itself.
65
-
66
- #### Decomposed Prompting (DecomP)
67
-
68
- **Foundational Work:** Khot et al. (2022) proposed decomposing complex questions into simpler sub-questions, each handled by specialized sub-prompts. The key innovation is that different sub-questions can be routed to different models or tools based on their requirements [8].
69
-
70
- **Mechanism:**
71
- 1. A decomposer module breaks the complex question into sub-questions
72
- 2. Each sub-question is routed to an appropriate handler (LLM, calculator, retriever)
73
- 3. Sub-answers are composed into a final answer
74
-
75
- **Empirical Support:** DecomP improves performance on multi-hop reasoning, compositional generalization, and long-context tasks by reducing the complexity that any single model call must handle.
76
-
77
- **Limitations:** DecomP assumes the input question is well-specified—it decomposes the *answer strategy*, not the *question itself*. If the original question contains implicit or hedged intents, DecomP will miss them.
78
-
79
- #### Plan-and-Solve (PS)
80
-
81
- **Foundational Work:** Wang et al. (2023) proposed a two-stage approach: first devise a plan for solving the problem, then execute the plan step by step [9].
82
-
83
- **Mechanism:**
84
- 1. The model generates a plan: "To solve this, I need to: (1) extract data, (2) calculate totals, (3) compare results"
85
- 2. The model executes each plan step sequentially
86
-
87
- **Empirical Support:** PS improves performance on math word problems and multi-step reasoning tasks by making the execution strategy explicit before execution begins.
88
-
89
- **Limitations:** The plan is only as good as the model's understanding of the input. If the input contains multiple intents, the plan may address only the salient ones.
90
-
91
- #### Skeleton-of-Thought (SoT)
92
-
93
- **Foundational Work:** Ning et al. (2023) proposed generating a "skeleton" answer structure first, then filling in each section in parallel, dramatically reducing latency for long-form generation.
94
-
95
- **Mechanism:**
96
- 1. Generate a skeleton: section headers or key points
97
- 2. Fill each section independently (can be parallelized)
98
- 3. Compose the final answer
99
-
100
- **Empirical Support:** SoT reduces latency by 2-3x with comparable or improved quality for long-form outputs.
101
-
102
- **Relevance to Decomposition:** SoT is relevant because it demonstrates that explicit structural decomposition before generation improves both speed and quality—a principle that PDE extends from output structure to input analysis.
103
-
104
- ### Category 3: Input Completeness Strategies
105
-
106
- This category, which PDE anchors, addresses the fidelity of intent extraction from complex inputs.
107
-
108
- #### Prompt Decomposition Engineering (PDE)
109
-
110
- **Foundational Context:** PDE emerges from the observation that Categories 1 and 2 both assume the model correctly identifies all intents in the input—an assumption that fails for complex, multi-intent, hedging-rich prompts.
111
-
112
- **Mechanism:**
113
- 1. **Intent Extraction:** The complex prompt is analyzed for primary intents (explicit, unhedged), secondary intents (hedged, conditional), and implicit intents (logically entailed but unstated)
114
- 2. **Dependency Mapping:** Extracted intents are analyzed for prerequisite relationships
115
- 3. **Four Directions Organization:** Intents are organized into East (vision), South (analysis), West (implementation), North (evaluation) stacks
116
-
117
- **Key Innovation:** PDE's treatment of hedging language as intent signal rather than uncertainty noise. When a user says "maybe also add Husky," PDE captures this as a secondary intent with medium confidence—ensuring it is not dropped during execution.
118
-
119
- **Theoretical Foundation:** PDE draws from speech act theory (Austin, 1962; Searle, 1969) in treating utterances as actions with varying illocutionary force. "Maybe also configure X" is an indirect speech act—its surface form (suggestion) differs from its underlying intent (request). PDE's hedging detection operationalizes this insight [10].
120
-
121
- **Empirical Support:** While PDE is newer and less empirically studied than CoT or ToT, its value proposition is validated by the well-documented phenomenon of "prompt drift"—the tendency for LLMs to lose track of secondary intents in complex prompts, a finding consistently reproduced in agent evaluation benchmarks.
122
-
123
- ### Comparative Analysis
124
-
125
- | Strategy | Optimizes | Input Requirements | Computational Cost | Maturity |
126
- |----------|-----------|-------------------|-------------------|----------|
127
- | CoT | Reasoning accuracy | Well-specified question | Low (1 extra pass) | High |
128
- | ToT | Solution exploration | Well-specified problem | High (N branches × M steps) | Medium |
129
- | Self-Consistency | Reasoning reliability | Well-specified question | Medium (N samples) | High |
130
- | DecomP | Complexity management | Well-specified question | Medium (sub-prompts) | Medium |
131
- | Plan-and-Solve | Execution strategy | Well-specified problem | Low (plan + execute) | Medium |
132
- | SoT | Generation speed | Clear output structure | Low (skeleton + fill) | Medium |
133
- | **PDE** | **Input completeness** | **Any complexity** | **Low (one analysis pass)** | **Early** |
134
-
135
- ### Complementary Relationships
136
-
137
- The strategies are not competing but complementary, addressing different stages of the prompt-to-output pipeline:
138
-
139
- ```
140
- User Input → [PDE: ensure completeness] → [PS: plan strategy] →
141
- [CoT/ToT: reason carefully] → [Self-Consistency: verify] → Output
142
- ```
143
-
144
- PDE operates at the earliest stage—ensuring that all intents are captured before any reasoning strategy is applied. Its output feeds into Plan-and-Solve (which creates execution plans for each extracted intent), Chain-of-Thought (which reasons carefully about each step), and Self-Consistency (which verifies the reasoning).
145
-
146
- ### Reflexion and Self-Improvement
147
-
148
- Shinn et al. (2023) introduced Reflexion—prompting agents to reflect on their own outputs and identify errors for correction. This is relevant to the decomposition landscape because it addresses a failure mode that all prior strategies share: what happens when the model executes correctly but misinterpreted the input?
149
-
150
- Reflexion operates as a post-hoc correction mechanism. PDE operates as a pre-hoc prevention mechanism. Both are valuable; their combination provides the strongest completeness guarantee [11].
151
-
152
- ### Meta-Prompting and Prompt Chaining
153
-
154
- The literature also notes the importance of prompt chaining—linking multiple prompt responses into explicit multi-stage workflows. This pattern is the operational foundation for PDE: the decomposition analysis is one prompt, and each extracted intent is executed through subsequent prompts, potentially with different reasoning strategies applied to each.
155
-
156
- ## Implications for CoAiA.js
157
-
158
- 1. **PDE as session entry point.** Every CoAiA.js session begins with PDE decomposition, ensuring completeness before reasoning begins.
159
- 2. **Strategy composition.** After PDE extracts intents, each intent can use the appropriate reasoning strategy (CoT for sequential tasks, ToT for creative tasks).
160
- 3. **Four Directions alignment.** PDE's Four Directions output stack maps directly to CoAiA.js's directional agent orchestration.
161
- 4. **MMOT as Reflexion.** The MMOT evaluation cycle serves as the post-hoc completeness verification that Reflexion provides, checking whether all PDE-extracted intents were addressed.
162
- 5. **Hedging-aware agents.** CoAiA.js agents treat hedged requests as real requests with reduced confidence, preventing the intent loss that plagues naive prompt processing.
163
-
164
- ## Conclusion
165
-
166
- The prompt decomposition literature reveals a rich but incomplete landscape. Reasoning enhancement strategies (CoT, ToT, Self-Consistency) and task structure strategies (DecomP, PS, SoT) have achieved significant advances in the quality and organization of LLM outputs. However, they share a common blind spot: the assumption that the input prompt has been correctly and completely understood. PDE addresses this blind spot by operating on the input itself—extracting all intents (including implicit and hedged ones), mapping dependencies, and organizing them for systematic execution. The combination of input completeness (PDE) with reasoning quality (CoT/ToT) and post-hoc verification (Reflexion/MMOT) provides the most robust foundation for complex AI agent operations.
167
-
168
- ## References
169
-
170
- 1. LearnPrompting.org. (2024). "Advanced Decomposition Techniques for Improved Prompting." https://learnprompting.org/docs/advanced/decomposition/introduction
171
- 2. Coupler.io. (2024). "Advanced Prompting Techniques for Complex AI Reasoning." https://blog.coupler.io/advanced-prompting-techniques/
172
- 3. Wei, J., et al. (2022). "Chain-of-Thought Prompting Elicits Reasoning in Large Language Models." *NeurIPS 2022*.
173
- 4. Toward Data Science. (2024). "Advanced Prompt Engineering: Chain of Thought." https://towardsdatascience.com/advanced-prompt-engineering-chain-of-thought-cot-8d8b090bf699/
174
- 5. CalmOps. (2024). "Prompt Engineering Patterns: CoT, ReAct, and ToT." https://calmops.com/ai/prompt-engineering-patterns-cot-react-tot/
175
- 6. Yao, S., et al. (2023). "Tree of Thoughts: Deliberate Problem Solving with Large Language Models." *NeurIPS 2023*.
176
- 7. Wang, X., et al. (2022). "Self-Consistency Improves Chain of Thought Reasoning in Language Models." *ICLR 2023*.
177
- 8. Khot, T., et al. (2022). "Decomposed Prompting: A Modular Approach for Solving Complex Tasks." *ICLR 2023*.
178
- 9. Wang, L., et al. (2023). "Plan-and-Solve Prompting: Improving Zero-Shot Chain-of-Thought Reasoning." *ACL 2023*.
179
- 10. Searle, J. R. (1969). *Speech Acts: An Essay in the Philosophy of Language*. Cambridge University Press.
180
- 11. Shinn, N., et al. (2023). "Reflexion: Language Agents with Verbal Reinforcement Learning." *NeurIPS 2023*.
181
- 12. Oxen.ai. (2024). "The Prompt Report Part 2." https://ghost.oxen.ai/the-prompt-report-part-2-thought-generation-tree-of-thought-and-decomposition-prompting/
182
- 13. Exploratio Journal. (2024). "Zooming-in On Prompting: A Comparative Study." https://exploratiojournal.com/zooming-in-on-prompting/
183
- 14. Metric Coders. (2024). "Complex Reasoning with Chain-of-Thought, Tree-of-Thought, and More." https://www.metriccoders.com/post/beyond-the-basics-unleashing-complex-reasoning-with-chain-of-thought-tree-of-thought-and-more
184
- 15. Fedotov, I. (2024). "Advanced Prompt Engineering Techniques: From Tree of Thoughts to Multimodal AI." https://ilyafedotov.com/advanced-prompt-engineering-techniques-from-tree-of-thoughts-to-multimodal-ai/
@@ -1,186 +0,0 @@
1
- # Survey of Multi-Agent Orchestration Patterns: AutoGen, CrewAI, LangGraph, and MCP
2
-
3
- > Academic survey for the CoAiA.js project — How AI agents coordinate, delegate, and share context across leading orchestration frameworks and the emergent role of MCP as a universal interoperability layer.
4
-
5
- ## Abstract
6
-
7
- The multi-agent AI ecosystem has fragmented into distinct orchestration paradigms: role-based teams (CrewAI), graph-based state machines (LangGraph), conversation-driven negotiation (AutoGen/AG2), and protocol-standardized tool invocation (MCP). This survey examines the architectural patterns, coordination mechanisms, and operational trade-offs of these four approaches to multi-agent orchestration. We analyze each framework's model for agent specialization, inter-agent communication, context sharing, and error recovery. Our findings reveal a convergence toward hybrid architectures where MCP provides the universal tool interface, while framework-specific patterns handle agent coordination logic. The survey situates CoAiA.js's Four Directions orchestration model within this landscape, demonstrating how structural tension methodology provides an alternative to both role-based and graph-based coordination that naturally prevents the oscillatory patterns common in complex multi-agent workflows.
8
-
9
- ## Introduction
10
-
11
- The transition from single-agent to multi-agent AI systems introduces coordination challenges that mirror those in distributed computing and organizational management: how do agents divide labor, share context, handle failures, and maintain coherent progress toward shared goals? [1]
12
-
13
- The 2024–2025 period has seen rapid proliferation of orchestration frameworks, each embodying different assumptions about how agents should interact. This survey examines the four dominant paradigms, identifies their structural properties, and evaluates their implications for the design of CoAiA.js's multi-agent capabilities.
14
-
15
- ## Survey of Orchestration Patterns
16
-
17
- ### 1. Role-Based Team Orchestration: CrewAI
18
-
19
- **Architecture:** Agents are defined as team members with explicit roles (Researcher, Writer, Reviewer), goals, tools, and behavioral constraints. A "crew" is assembled from these role-defined agents and given a task sequence to execute [2][3].
20
-
21
- **Coordination Model:**
22
- ```python
23
- researcher = Agent(role="Senior Researcher", goal="Find comprehensive information", tools=[search, scrape])
24
- writer = Agent(role="Technical Writer", goal="Create clear documentation", tools=[write, format])
25
- crew = Crew(agents=[researcher, writer], tasks=[research_task, writing_task], process=Process.sequential)
26
- ```
27
-
28
- **Communication Pattern:** Primarily sequential task handoff—the output of one agent becomes the input of the next. Limited support for parallel execution and inter-agent negotiation.
29
-
30
- **Strengths:**
31
- - Intuitive mental model (mirrors human team organization)
32
- - Fastest prototyping and lowest learning curve
33
- - Effective for linear business workflows
34
- - Clean separation of concerns through role specialization
35
-
36
- **Weaknesses:**
37
- - Limited control flow: branching, looping, and conditional logic are constrained
38
- - Susceptible to "agent loops" where agents repeatedly invoke each other without progress
39
- - Low determinism: identical inputs can produce different execution paths
40
- - Debugging is challenging: agent decisions are opaque [4][5]
41
-
42
- **Structural Tension Analysis:** CrewAI operates without explicit structural tension. Goals are stated but current reality is not formally tracked. This makes CrewAI susceptible to the oscillation pattern: agents work toward goals, partially achieve them, lose momentum, and re-engage when prompted.
43
-
44
- ### 2. Graph-Based State Machine Orchestration: LangGraph
45
-
46
- **Architecture:** Workflows are modeled as directed graphs where nodes represent processing steps (which may involve agents) and edges represent transitions between steps. State is explicitly managed and passed between nodes [6][7].
47
-
48
- **Coordination Model:**
49
- ```python
50
- graph = StateGraph(AgentState)
51
- graph.add_node("research", research_node)
52
- graph.add_node("write", write_node)
53
- graph.add_node("review", review_node)
54
- graph.add_edge("research", "write")
55
- graph.add_conditional_edges("review", should_revise, {"revise": "write", "approve": END})
56
- ```
57
-
58
- **Communication Pattern:** State-passing through a shared state object. Each node reads from and writes to the state, enabling complex branching, looping, and conditional logic.
59
-
60
- **Strengths:**
61
- - Highest control and determinism among frameworks
62
- - Explicit branching, looping, error recovery, and conditional logic
63
- - Production-grade reliability (~94% accuracy in benchmarks)
64
- - Full visibility into execution state at every point
65
- - Natural fit for complex, multi-step workflows with failure recovery [8]
66
-
67
- **Weaknesses:**
68
- - Steepest learning curve: requires understanding of state machines and graph theory
69
- - Most verbose code for simple workflows
70
- - Tightly coupled to LangChain ecosystem
71
- - Over-engineering risk for straightforward sequential tasks
72
-
73
- **Structural Tension Analysis:** LangGraph's state machine model can encode structural tension: the state object can carry desired outcome and current reality, and conditional edges can check tension resolution. However, this requires explicit implementation—it is not a native feature.
74
-
75
- ### 3. Conversation-Driven Orchestration: AutoGen (AG2)
76
-
77
- **Architecture:** Agents communicate through structured conversations—rounds of messages where each agent contributes based on its perspective. Coordination emerges from the conversation rather than being imposed by a workflow graph [9][10].
78
-
79
- **Coordination Model:**
80
- ```python
81
- assistant = AssistantAgent("assistant", llm_config=llm_config)
82
- critic = AssistantAgent("critic", system_message="Critique code quality")
83
- user_proxy = UserProxyAgent("user", code_execution_config={"work_dir": "coding"})
84
- groupchat = GroupChat(agents=[user_proxy, assistant, critic], messages=[], max_round=12)
85
- ```
86
-
87
- **Communication Pattern:** Round-robin or dynamic turn-taking in group chats. Agents see the full conversation history and contribute based on their system messages and observed context.
88
-
89
- **Strengths:**
90
- - Most natural model for collaborative reasoning and negotiation
91
- - Flexible: agent composition can change dynamically
92
- - Strong for human-in-the-loop workflows
93
- - Effective for research, brainstorming, and iterative refinement
94
- - AG2 (successor) adds enterprise reliability features [11]
95
-
96
- **Weaknesses:**
97
- - Least deterministic: conversation dynamics are inherently unpredictable
98
- - Context overflow risk: long conversations exceed context windows
99
- - Debugging difficulty: tracing which conversational turn caused which outcome
100
- - Performance unpredictability: conversation length varies significantly
101
-
102
- **Structural Tension Analysis:** AutoGen's conversational model naturally surfaces tension—critics identify gaps between desired and actual output. However, this tension is implicit in conversation rather than explicitly tracked, making it difficult to measure advancement vs. oscillation.
103
-
104
- ### 4. Protocol-Standardized Tool Invocation: MCP
105
-
106
- **Architecture:** MCP is not an orchestration framework but a **communication protocol** that standardizes how agents invoke tools. Unlike CrewAI, LangGraph, and AutoGen, MCP does not prescribe coordination patterns—it provides the infrastructure layer upon which coordination is built [12][13].
107
-
108
- **Coordination Model:** MCP defines tool discovery (tools/list), tool invocation (tools/call), resource access (resources/read), and prompt provision (prompts/get) through JSON-RPC 2.0 messages over stdio or HTTP transport.
109
-
110
- **Strengths:**
111
- - Universal: any framework can use MCP for tool invocation
112
- - Dynamic tool discovery: agents learn available capabilities at runtime
113
- - Human-in-the-loop: built-in approval gates for sensitive operations
114
- - Framework-agnostic: works with CrewAI, LangGraph, AutoGen, or custom systems
115
-
116
- **Weaknesses:**
117
- - Not an orchestration framework: does not handle agent coordination, context sharing, or workflow management
118
- - Young ecosystem: tooling and community still developing
119
- - Potential overhead: JSON-RPC adds latency compared to direct function calls
120
-
121
- **Structural Tension Analysis:** MCP provides the tool interface through which structural tension charts can be created, read, and updated. MCP servers can expose STC operations as tools, making structural tension accessible to any MCP-compliant agent.
122
-
123
- ### Comparative Analysis
124
-
125
- | Dimension | CrewAI | LangGraph | AutoGen/AG2 | MCP |
126
- |-----------|--------|-----------|-------------|-----|
127
- | **Paradigm** | Role-based teams | Graph state machine | Conversation | Protocol |
128
- | **Control** | Low–Medium | Very High | Medium | N/A (infra) |
129
- | **Determinism** | Low | High | Low | N/A |
130
- | **Learning Curve** | Low | High | Medium | Low |
131
- | **Best For** | Prototyping, business | Production, complex | Research, negotiation | Tool interop |
132
- | **STC Support** | None native | Possible via state | Implicit in conversation | Tool interface |
133
- | **Oscillation Risk** | High | Low (explicit control) | Medium | N/A |
134
-
135
- ### Emerging Pattern: Hybrid Architectures
136
-
137
- The most effective multi-agent systems in 2025 combine multiple paradigms:
138
-
139
- 1. **MCP as universal tool layer.** All external tool invocations go through MCP, providing standardized access, observability, and security.
140
- 2. **LangGraph for critical workflows.** Mission-critical, multi-step processes use graph-based orchestration for determinism and error recovery.
141
- 3. **CrewAI for team simulation.** Business workflows with clear role divisions use role-based orchestration for intuitive design.
142
- 4. **AutoGen for collaborative reasoning.** Research, brainstorming, and negotiation tasks use conversational orchestration for emergent insights.
143
-
144
- ### The Four Directions Alternative
145
-
146
- CoAiA.js proposes a fifth paradigm: **directional orchestration** based on the Medicine Wheel framework:
147
-
148
- - **East Agent:** Vision articulation and creative ideation
149
- - **South Agent:** Analysis, research, and prompt decomposition (PDE)
150
- - **West Agent:** Implementation and iterative building
151
- - **North Agent:** Evaluation (MMOT), documentation, and wisdom synthesis
152
-
153
- This model is structurally distinct from role-based, graph-based, or conversation-based orchestration:
154
-
155
- - Unlike CrewAI roles, directional agents represent **phases of creative process**, not job descriptions
156
- - Unlike LangGraph graphs, the Four Directions form a **cycle**, not a directed acyclic graph
157
- - Unlike AutoGen conversations, handoffs between directions are **structurally motivated** by the completion of each phase's contribution
158
- - Structural tension charts provide the coordination mechanism: each direction advances the chart, and the tension between desired outcome and current reality drives the cycle forward
159
-
160
- ## Implications for CoAiA.js
161
-
162
- 1. **MCP as tool layer.** CoAiA.js uses MCP for all external tool invocations, ensuring framework-agnostic tool access.
163
- 2. **Four Directions as orchestration.** Agent coordination follows the directional cycle, not role-based teams or conversation rounds.
164
- 3. **Structural tension as coordination.** The STC's tension measurement drives agent scheduling—the direction with the highest contribution potential receives attention.
165
- 4. **Hybrid compatibility.** CoAiA.js's directional agents can operate within LangGraph workflows, CrewAI teams, or AutoGen conversations when integration with external frameworks is needed.
166
- 5. **Oscillation prevention.** The structural tension chart's advancing structure prevents the oscillation that plagues role-based and conversation-based systems.
167
-
168
- ## Conclusion
169
-
170
- Multi-agent orchestration in 2025 is characterized by framework proliferation and emerging hybridization. Each paradigm—role-based, graph-based, conversational, and protocol-based—offers distinct trade-offs in control, determinism, and expressiveness. CoAiA.js's Four Directions orchestration model adds a fifth paradigm rooted in structural tension methodology, providing cyclical, balanced coordination that naturally resists oscillation. The convergence on MCP as a universal tool interface layer suggests that orchestration frameworks will increasingly specialize in coordination logic while delegating tool invocation to the protocol layer.
171
-
172
- ## References
173
-
174
- 1. DataCamp. (2024). "CrewAI vs LangGraph vs AutoGen: Choosing the Right Multi-Agent Framework." https://www.datacamp.com/tutorial/crewai-vs-langgraph-vs-autogen
175
- 2. TutorialQ. (2025). "CrewAI vs LangGraph vs AutoGen." https://tutorialq.com/agents/frameworks/crewai-vs-langgraph-vs-autogen
176
- 3. Youngju.dev. (2026). "Comparing LLM Agent Frameworks." https://www.youngju.dev/blog/llm/2026-03-09-llm-agent-framework-autogen-crewai-langgraph-comparison.en
177
- 4. Amplework. (2025). "LangGraph vs AutoGen vs CrewAI." https://www.amplework.com/blog/langgraph-vs-autogen-vs-crewai-multi-agent-framework/
178
- 5. Braincuber. (2025). "CrewAI vs AutoGen vs LangGraph: Framework Comparison." https://www.braincuber.com/blog/crewai-vs-autogen-vs-langgraph-multi-agent-framework-comparison
179
- 6. Meta Intelligence. (2025). "The Complete Guide to AI Agent Development." https://www.meta-intelligence.tech/en/insight-ai-agent-frameworks
180
- 7. SoftwareSeni. (2025). "Navigating the Multi-Agent Framework Landscape." https://www.softwareseni.com/navigating-the-multi-agent-framework-landscape-from-crewai-to-langgraph-to-autogen-and-beyond/
181
- 8. Infinite Lambda. (2025). "CrewAI, AutoGen, Vertex AI, and LangGraph Comparison." https://infinitelambda.com/compare-crewai-autogen-vertexai-langgraph/
182
- 9. Datagrom. (2025). "Top 3 Trending Agentic AI Frameworks." https://www.datagrom.com/data-science-machine-learning-ai-blog/langgraph-vs-autogen-vs-crewai-comparison-agentic-ai-frameworks
183
- 10. Tagline Infotech. (2025). "Choosing the Right AI Agent Framework." https://taglineinfotech.com/blog/langgraph-vs-crewai-vs-autogen/
184
- 11. AG2 (AutoGen successor). https://github.com/ag2ai/ag2
185
- 12. Anthropic. (2024). "Introducing the Model Context Protocol." https://www.anthropic.com/news/model-context-protocol
186
- 13. Model Context Protocol Specification. (2025). https://modelcontextprotocol.io/specification/2025-03-26