agent-orcha 0.0.1 → 0.0.3

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 (274) hide show
  1. package/README.md +792 -125
  2. package/dist/lib/agents/agent-executor.d.ts +6 -1
  3. package/dist/lib/agents/agent-executor.d.ts.map +1 -1
  4. package/dist/lib/agents/agent-executor.js +241 -45
  5. package/dist/lib/agents/agent-executor.js.map +1 -1
  6. package/dist/lib/agents/agent-loader.d.ts.map +1 -1
  7. package/dist/lib/agents/agent-loader.js +3 -1
  8. package/dist/lib/agents/agent-loader.js.map +1 -1
  9. package/dist/lib/agents/index.d.ts +2 -1
  10. package/dist/lib/agents/index.d.ts.map +1 -1
  11. package/dist/lib/agents/index.js +1 -0
  12. package/dist/lib/agents/index.js.map +1 -1
  13. package/dist/lib/agents/structured-output-wrapper.d.ts +19 -0
  14. package/dist/lib/agents/structured-output-wrapper.d.ts.map +1 -0
  15. package/dist/lib/agents/structured-output-wrapper.js +104 -0
  16. package/dist/lib/agents/structured-output-wrapper.js.map +1 -0
  17. package/dist/lib/agents/types.d.ts +17 -10
  18. package/dist/lib/agents/types.d.ts.map +1 -1
  19. package/dist/lib/agents/types.js +1 -1
  20. package/dist/lib/agents/types.js.map +1 -1
  21. package/dist/lib/index.d.ts +9 -7
  22. package/dist/lib/index.d.ts.map +1 -1
  23. package/dist/lib/index.js +7 -5
  24. package/dist/lib/index.js.map +1 -1
  25. package/dist/lib/knowledge/graph-rag/community-detector.d.ts +16 -0
  26. package/dist/lib/knowledge/graph-rag/community-detector.d.ts.map +1 -0
  27. package/dist/lib/knowledge/graph-rag/community-detector.js +81 -0
  28. package/dist/lib/knowledge/graph-rag/community-detector.js.map +1 -0
  29. package/dist/lib/knowledge/graph-rag/community-summarizer.d.ts +17 -0
  30. package/dist/lib/knowledge/graph-rag/community-summarizer.d.ts.map +1 -0
  31. package/dist/lib/knowledge/graph-rag/community-summarizer.js +87 -0
  32. package/dist/lib/knowledge/graph-rag/community-summarizer.js.map +1 -0
  33. package/dist/lib/knowledge/graph-rag/entity-extractor.d.ts +36 -0
  34. package/dist/lib/knowledge/graph-rag/entity-extractor.d.ts.map +1 -0
  35. package/dist/lib/knowledge/graph-rag/entity-extractor.js +192 -0
  36. package/dist/lib/knowledge/graph-rag/entity-extractor.js.map +1 -0
  37. package/dist/lib/knowledge/graph-rag/extraction-cache.d.ts +30 -0
  38. package/dist/lib/knowledge/graph-rag/extraction-cache.d.ts.map +1 -0
  39. package/dist/lib/knowledge/graph-rag/extraction-cache.js +88 -0
  40. package/dist/lib/knowledge/graph-rag/extraction-cache.js.map +1 -0
  41. package/dist/lib/knowledge/graph-rag/global-search.d.ts +19 -0
  42. package/dist/lib/knowledge/graph-rag/global-search.d.ts.map +1 -0
  43. package/dist/lib/knowledge/graph-rag/global-search.js +96 -0
  44. package/dist/lib/knowledge/graph-rag/global-search.js.map +1 -0
  45. package/dist/lib/knowledge/graph-rag/graph-rag-factory.d.ts +24 -0
  46. package/dist/lib/knowledge/graph-rag/graph-rag-factory.d.ts.map +1 -0
  47. package/dist/lib/knowledge/graph-rag/graph-rag-factory.js +239 -0
  48. package/dist/lib/knowledge/graph-rag/graph-rag-factory.js.map +1 -0
  49. package/dist/lib/knowledge/graph-rag/index.d.ts +14 -0
  50. package/dist/lib/knowledge/graph-rag/index.d.ts.map +1 -0
  51. package/dist/lib/knowledge/graph-rag/index.js +12 -0
  52. package/dist/lib/knowledge/graph-rag/index.js.map +1 -0
  53. package/dist/lib/knowledge/graph-rag/local-search.d.ts +20 -0
  54. package/dist/lib/knowledge/graph-rag/local-search.d.ts.map +1 -0
  55. package/dist/lib/knowledge/graph-rag/local-search.js +110 -0
  56. package/dist/lib/knowledge/graph-rag/local-search.js.map +1 -0
  57. package/dist/lib/knowledge/graph-rag/memory-graph-store.d.ts +31 -0
  58. package/dist/lib/knowledge/graph-rag/memory-graph-store.d.ts.map +1 -0
  59. package/dist/lib/knowledge/graph-rag/memory-graph-store.js +165 -0
  60. package/dist/lib/knowledge/graph-rag/memory-graph-store.js.map +1 -0
  61. package/dist/lib/knowledge/graph-rag/neo4j-graph-store.d.ts +38 -0
  62. package/dist/lib/knowledge/graph-rag/neo4j-graph-store.d.ts.map +1 -0
  63. package/dist/lib/knowledge/graph-rag/neo4j-graph-store.js +190 -0
  64. package/dist/lib/knowledge/graph-rag/neo4j-graph-store.js.map +1 -0
  65. package/dist/lib/knowledge/graph-rag/search-mode-detector.d.ts +11 -0
  66. package/dist/lib/knowledge/graph-rag/search-mode-detector.d.ts.map +1 -0
  67. package/dist/lib/knowledge/graph-rag/search-mode-detector.js +50 -0
  68. package/dist/lib/knowledge/graph-rag/search-mode-detector.js.map +1 -0
  69. package/dist/lib/knowledge/graph-rag/types.d.ts +368 -0
  70. package/dist/lib/knowledge/graph-rag/types.d.ts.map +1 -0
  71. package/dist/lib/knowledge/graph-rag/types.js +48 -0
  72. package/dist/lib/knowledge/graph-rag/types.js.map +1 -0
  73. package/dist/lib/knowledge/index.d.ts +9 -0
  74. package/dist/lib/knowledge/index.d.ts.map +1 -0
  75. package/dist/lib/knowledge/index.js +8 -0
  76. package/dist/lib/knowledge/index.js.map +1 -0
  77. package/dist/lib/knowledge/knowledge-store-factory.d.ts +16 -0
  78. package/dist/lib/knowledge/knowledge-store-factory.d.ts.map +1 -0
  79. package/dist/lib/{vectors/vector-store-factory.js → knowledge/knowledge-store-factory.js} +36 -10
  80. package/dist/lib/knowledge/knowledge-store-factory.js.map +1 -0
  81. package/dist/lib/knowledge/knowledge-store-manager.d.ts +18 -0
  82. package/dist/lib/knowledge/knowledge-store-manager.d.ts.map +1 -0
  83. package/dist/lib/knowledge/knowledge-store-manager.js +98 -0
  84. package/dist/lib/knowledge/knowledge-store-manager.js.map +1 -0
  85. package/dist/lib/knowledge/loaders/database-loader.d.ts +18 -0
  86. package/dist/lib/knowledge/loaders/database-loader.d.ts.map +1 -0
  87. package/dist/lib/knowledge/loaders/database-loader.js +115 -0
  88. package/dist/lib/knowledge/loaders/database-loader.js.map +1 -0
  89. package/dist/lib/knowledge/loaders/index.d.ts +4 -0
  90. package/dist/lib/knowledge/loaders/index.d.ts.map +1 -0
  91. package/dist/lib/knowledge/loaders/index.js +4 -0
  92. package/dist/lib/knowledge/loaders/index.js.map +1 -0
  93. package/dist/lib/knowledge/loaders/s3-loader.d.ts +17 -0
  94. package/dist/lib/knowledge/loaders/s3-loader.d.ts.map +1 -0
  95. package/dist/lib/knowledge/loaders/s3-loader.js +185 -0
  96. package/dist/lib/knowledge/loaders/s3-loader.js.map +1 -0
  97. package/dist/lib/knowledge/loaders/web-loader.d.ts +12 -0
  98. package/dist/lib/knowledge/loaders/web-loader.d.ts.map +1 -0
  99. package/dist/lib/knowledge/loaders/web-loader.js +56 -0
  100. package/dist/lib/knowledge/loaders/web-loader.js.map +1 -0
  101. package/dist/lib/knowledge/types.d.ts +1839 -0
  102. package/dist/lib/knowledge/types.d.ts.map +1 -0
  103. package/dist/lib/knowledge/types.js +111 -0
  104. package/dist/lib/knowledge/types.js.map +1 -0
  105. package/dist/lib/knowledge/utils/connection-pool.d.ts +18 -0
  106. package/dist/lib/knowledge/utils/connection-pool.d.ts.map +1 -0
  107. package/dist/lib/knowledge/utils/connection-pool.js +77 -0
  108. package/dist/lib/knowledge/utils/connection-pool.js.map +1 -0
  109. package/dist/lib/knowledge/utils/file-type-detector.d.ts +10 -0
  110. package/dist/lib/knowledge/utils/file-type-detector.d.ts.map +1 -0
  111. package/dist/lib/knowledge/utils/file-type-detector.js +32 -0
  112. package/dist/lib/knowledge/utils/file-type-detector.js.map +1 -0
  113. package/dist/lib/knowledge/utils/index.d.ts +3 -0
  114. package/dist/lib/knowledge/utils/index.d.ts.map +1 -0
  115. package/dist/lib/knowledge/utils/index.js +3 -0
  116. package/dist/lib/knowledge/utils/index.js.map +1 -0
  117. package/dist/lib/mcp/mcp-client.d.ts +9 -1
  118. package/dist/lib/mcp/mcp-client.d.ts.map +1 -1
  119. package/dist/lib/mcp/mcp-client.js +33 -0
  120. package/dist/lib/mcp/mcp-client.js.map +1 -1
  121. package/dist/lib/memory/conversation-store.d.ts +43 -0
  122. package/dist/lib/memory/conversation-store.d.ts.map +1 -0
  123. package/dist/lib/memory/conversation-store.js +109 -0
  124. package/dist/lib/memory/conversation-store.js.map +1 -0
  125. package/dist/lib/memory/index.d.ts +3 -0
  126. package/dist/lib/memory/index.d.ts.map +1 -0
  127. package/dist/lib/memory/index.js +3 -0
  128. package/dist/lib/memory/index.js.map +1 -0
  129. package/dist/lib/memory/types.d.ts +19 -0
  130. package/dist/lib/memory/types.d.ts.map +1 -0
  131. package/dist/lib/memory/types.js +6 -0
  132. package/dist/lib/memory/types.js.map +1 -0
  133. package/dist/lib/orchestrator.d.ts +56 -14
  134. package/dist/lib/orchestrator.d.ts.map +1 -1
  135. package/dist/lib/orchestrator.js +182 -25
  136. package/dist/lib/orchestrator.js.map +1 -1
  137. package/dist/lib/tools/agent-tool-wrapper.d.ts +22 -0
  138. package/dist/lib/tools/agent-tool-wrapper.d.ts.map +1 -0
  139. package/dist/lib/tools/agent-tool-wrapper.js +56 -0
  140. package/dist/lib/tools/agent-tool-wrapper.js.map +1 -0
  141. package/dist/lib/tools/built-in/ask-user.tool.d.ts +7 -0
  142. package/dist/lib/tools/built-in/ask-user.tool.d.ts.map +1 -0
  143. package/dist/lib/tools/built-in/ask-user.tool.js +23 -0
  144. package/dist/lib/tools/built-in/ask-user.tool.js.map +1 -0
  145. package/dist/lib/tools/built-in/index.d.ts +2 -1
  146. package/dist/lib/tools/built-in/index.d.ts.map +1 -1
  147. package/dist/lib/tools/built-in/index.js +2 -1
  148. package/dist/lib/tools/built-in/index.js.map +1 -1
  149. package/dist/lib/tools/built-in/knowledge-search.tool.d.ts +4 -0
  150. package/dist/lib/tools/built-in/knowledge-search.tool.d.ts.map +1 -0
  151. package/dist/lib/tools/built-in/{vector-search.tool.js → knowledge-search.tool.js} +4 -4
  152. package/dist/lib/tools/built-in/knowledge-search.tool.js.map +1 -0
  153. package/dist/lib/tools/index.d.ts +3 -1
  154. package/dist/lib/tools/index.d.ts.map +1 -1
  155. package/dist/lib/tools/index.js +3 -1
  156. package/dist/lib/tools/index.js.map +1 -1
  157. package/dist/lib/tools/tool-discovery.d.ts +50 -0
  158. package/dist/lib/tools/tool-discovery.d.ts.map +1 -0
  159. package/dist/lib/tools/tool-discovery.js +178 -0
  160. package/dist/lib/tools/tool-discovery.js.map +1 -0
  161. package/dist/lib/tools/tool-registry.d.ts +19 -3
  162. package/dist/lib/tools/tool-registry.d.ts.map +1 -1
  163. package/dist/lib/tools/tool-registry.js +63 -10
  164. package/dist/lib/tools/tool-registry.js.map +1 -1
  165. package/dist/lib/workflows/index.d.ts +4 -2
  166. package/dist/lib/workflows/index.d.ts.map +1 -1
  167. package/dist/lib/workflows/index.js +3 -1
  168. package/dist/lib/workflows/index.js.map +1 -1
  169. package/dist/lib/workflows/interrupt-manager.d.ts +42 -0
  170. package/dist/lib/workflows/interrupt-manager.d.ts.map +1 -0
  171. package/dist/lib/workflows/interrupt-manager.js +102 -0
  172. package/dist/lib/workflows/interrupt-manager.js.map +1 -0
  173. package/dist/lib/workflows/langgraph-executor.d.ts +51 -0
  174. package/dist/lib/workflows/langgraph-executor.d.ts.map +1 -0
  175. package/dist/lib/workflows/langgraph-executor.js +297 -0
  176. package/dist/lib/workflows/langgraph-executor.js.map +1 -0
  177. package/dist/lib/workflows/types.d.ts +911 -34
  178. package/dist/lib/workflows/types.d.ts.map +1 -1
  179. package/dist/lib/workflows/types.js +51 -2
  180. package/dist/lib/workflows/types.js.map +1 -1
  181. package/dist/lib/workflows/workflow-executor.d.ts.map +1 -1
  182. package/dist/lib/workflows/workflow-executor.js +4 -0
  183. package/dist/lib/workflows/workflow-executor.js.map +1 -1
  184. package/dist/lib/workflows/workflow-loader.d.ts.map +1 -1
  185. package/dist/lib/workflows/workflow-loader.js +3 -1
  186. package/dist/lib/workflows/workflow-loader.js.map +1 -1
  187. package/dist/public/index.html +133 -700
  188. package/dist/public/src/components/AgentsView.js +763 -0
  189. package/dist/public/src/components/AppRoot.js +76 -0
  190. package/dist/public/src/components/IdeView.js +330 -0
  191. package/dist/public/src/components/KnowledgeView.js +133 -0
  192. package/dist/public/src/components/LlmView.js +127 -0
  193. package/dist/public/src/components/McpView.js +387 -0
  194. package/dist/public/src/components/NavBar.js +71 -0
  195. package/dist/public/src/components/WorkflowsView.js +243 -0
  196. package/dist/public/src/main.js +9 -0
  197. package/dist/public/src/services/ApiService.js +142 -0
  198. package/dist/public/src/store.js +41 -0
  199. package/dist/public/src/utils/Component.js +23 -0
  200. package/dist/public/src/utils/markdown.js +82 -0
  201. package/dist/src/cli/commands/start.d.ts.map +1 -1
  202. package/dist/src/cli/commands/start.js +3 -2
  203. package/dist/src/cli/commands/start.js.map +1 -1
  204. package/dist/src/index.js +46 -12
  205. package/dist/src/index.js.map +1 -1
  206. package/dist/src/routes/agents.route.d.ts.map +1 -1
  207. package/dist/src/routes/agents.route.js +38 -5
  208. package/dist/src/routes/agents.route.js.map +1 -1
  209. package/dist/src/routes/files.route.d.ts +3 -0
  210. package/dist/src/routes/files.route.d.ts.map +1 -0
  211. package/dist/src/routes/files.route.js +160 -0
  212. package/dist/src/routes/files.route.js.map +1 -0
  213. package/dist/src/routes/functions.route.d.ts +3 -0
  214. package/dist/src/routes/functions.route.d.ts.map +1 -0
  215. package/dist/src/routes/functions.route.js +83 -0
  216. package/dist/src/routes/functions.route.js.map +1 -0
  217. package/dist/src/routes/knowledge.route.d.ts +3 -0
  218. package/dist/src/routes/knowledge.route.d.ts.map +1 -0
  219. package/dist/src/routes/knowledge.route.js +153 -0
  220. package/dist/src/routes/knowledge.route.js.map +1 -0
  221. package/dist/src/routes/mcp.route.d.ts +3 -0
  222. package/dist/src/routes/mcp.route.d.ts.map +1 -0
  223. package/dist/src/routes/mcp.route.js +79 -0
  224. package/dist/src/routes/mcp.route.js.map +1 -0
  225. package/dist/src/routes/workflows.route.d.ts.map +1 -1
  226. package/dist/src/routes/workflows.route.js +2 -1
  227. package/dist/src/routes/workflows.route.js.map +1 -1
  228. package/dist/src/server.d.ts.map +1 -1
  229. package/dist/src/server.js +8 -2
  230. package/dist/src/server.js.map +1 -1
  231. package/dist/templates/.env.example +21 -0
  232. package/dist/templates/README.md +43 -152
  233. package/dist/templates/agents/call-center-analyst-simple.agent.yaml +36 -0
  234. package/dist/templates/agents/math.agent.yaml +4 -14
  235. package/dist/templates/agents/sentiment-structured.agent.yaml +42 -0
  236. package/dist/templates/functions/calculator.function.js +69 -0
  237. package/dist/templates/functions/text-formatter.function.js +66 -0
  238. package/dist/templates/{vectors/example.vector.yaml → knowledge/example.knowledge.yaml} +1 -1
  239. package/dist/templates/knowledge/transcripts/call-001.txt +40 -0
  240. package/dist/templates/knowledge/transcripts/call-002.txt +36 -0
  241. package/dist/templates/knowledge/transcripts/call-003.txt +42 -0
  242. package/dist/templates/llm.md +1195 -0
  243. package/dist/templates/workflows/example.workflow.yaml +8 -19
  244. package/dist/templates/workflows/langgraph-example.workflow.yaml +84 -0
  245. package/package.json +19 -10
  246. package/dist/lib/tools/built-in/vector-search.tool.d.ts +0 -4
  247. package/dist/lib/tools/built-in/vector-search.tool.d.ts.map +0 -1
  248. package/dist/lib/tools/built-in/vector-search.tool.js.map +0 -1
  249. package/dist/lib/vectors/index.d.ts +0 -5
  250. package/dist/lib/vectors/index.d.ts.map +0 -1
  251. package/dist/lib/vectors/index.js +0 -4
  252. package/dist/lib/vectors/index.js.map +0 -1
  253. package/dist/lib/vectors/types.d.ts +0 -212
  254. package/dist/lib/vectors/types.d.ts.map +0 -1
  255. package/dist/lib/vectors/types.js +0 -39
  256. package/dist/lib/vectors/types.js.map +0 -1
  257. package/dist/lib/vectors/vector-store-factory.d.ts +0 -14
  258. package/dist/lib/vectors/vector-store-factory.d.ts.map +0 -1
  259. package/dist/lib/vectors/vector-store-factory.js.map +0 -1
  260. package/dist/lib/vectors/vector-store-manager.d.ts +0 -18
  261. package/dist/lib/vectors/vector-store-manager.d.ts.map +0 -1
  262. package/dist/lib/vectors/vector-store-manager.js +0 -79
  263. package/dist/lib/vectors/vector-store-manager.js.map +0 -1
  264. package/dist/src/routes/vectors.route.d.ts +0 -3
  265. package/dist/src/routes/vectors.route.d.ts.map +0 -1
  266. package/dist/src/routes/vectors.route.js +0 -74
  267. package/dist/src/routes/vectors.route.js.map +0 -1
  268. package/dist/templates/agents/example.agent.yaml +0 -32
  269. package/dist/templates/agents/knowledge.agent.yaml +0 -36
  270. package/dist/templates/agents/time.agent.yaml +0 -42
  271. package/dist/templates/functions/README.md +0 -195
  272. package/dist/templates/functions/fibonacci.function.js +0 -55
  273. package/dist/templates/vectors/example-chroma.vector.yaml +0 -43
  274. package/dist/templates/vectors/sample-data/example-document.txt +0 -15
@@ -0,0 +1,1195 @@
1
+ # Agent Orcha - YAML Configuration Reference
2
+
3
+ > This document is the comprehensive reference for AI assistants helping users configure Agent Orcha projects. It covers all YAML/JSON configuration files, their schemas, and usage patterns.
4
+
5
+ ## Quick Reference
6
+
7
+ | File | Location | Purpose |
8
+ |------|----------|---------|
9
+ | `llm.json` | Project root | LLM and embedding model configurations |
10
+ | `mcp.json` | Project root | MCP server configurations |
11
+ | `*.agent.yaml` | `agents/` | Agent definitions |
12
+ | `*.workflow.yaml` | `workflows/` | Workflow definitions (step-based or LangGraph) |
13
+ | `*.knowledge.yaml` | `knowledge/` | Knowledge store definitions (vector or graph-rag) |
14
+ | `*.function.js` | `functions/` | Custom function tools |
15
+ | `.env` | Project root | Environment variables |
16
+
17
+ ---
18
+
19
+ ## LLM Configuration (`llm.json`)
20
+
21
+ Central configuration for all LLM models and embedding models. Agents, workflows, and knowledge stores reference these by name.
22
+
23
+ ### Full Schema
24
+
25
+ ```json
26
+ {
27
+ "version": "1.0",
28
+ "models": {
29
+ "<name>": {
30
+ "provider": "openai | gemini | anthropic | local",
31
+ "baseUrl": "string (optional - custom API endpoint)",
32
+ "apiKey": "string (required)",
33
+ "model": "string (required - model identifier)",
34
+ "temperature": 0.7,
35
+ "maxTokens": 4096
36
+ }
37
+ },
38
+ "embeddings": {
39
+ "<name>": {
40
+ "provider": "openai | gemini | anthropic | local",
41
+ "baseUrl": "string (optional)",
42
+ "apiKey": "string (required)",
43
+ "model": "string (required)",
44
+ "dimensions": 1536,
45
+ "eosToken": "string (optional - e.g. ' ' for Nomic models)"
46
+ }
47
+ }
48
+ }
49
+ ```
50
+
51
+ ### Notes
52
+
53
+ - All providers are treated as OpenAI-compatible APIs
54
+ - The `"default"` model name is used when agents don't specify an LLM
55
+ - **Local LLMs**: Use `baseUrl: "http://localhost:1234/v1"` (LM Studio) or `baseUrl: "http://localhost:11434/v1"` (Ollama)
56
+ - **Cloud providers**: Omit `baseUrl` to use the provider's default endpoint
57
+ - `eosToken` is needed for some embedding models (e.g., Nomic) to avoid SEP token warnings
58
+
59
+ ### Example
60
+
61
+ ```json
62
+ {
63
+ "version": "1.0",
64
+ "models": {
65
+ "default": {
66
+ "baseUrl": "http://localhost:1234/v1",
67
+ "apiKey": "not-needed",
68
+ "model": "qwen/qwen3-4b-2507",
69
+ "temperature": 0.7
70
+ },
71
+ "openai": {
72
+ "apiKey": "sk-your-openai-key",
73
+ "model": "gpt-4o",
74
+ "temperature": 0.7
75
+ }
76
+ },
77
+ "embeddings": {
78
+ "default": {
79
+ "baseUrl": "http://localhost:1234/v1",
80
+ "apiKey": "not-needed",
81
+ "model": "text-embedding-nomic-embed-text-v1.5",
82
+ "eosToken": " "
83
+ },
84
+ "openai": {
85
+ "apiKey": "sk-your-openai-key",
86
+ "model": "text-embedding-3-small",
87
+ "dimensions": 1536
88
+ }
89
+ }
90
+ }
91
+ ```
92
+
93
+ ---
94
+
95
+ ## Agent Configuration (`*.agent.yaml`)
96
+
97
+ Agents are AI-powered units located in the `agents/` directory.
98
+
99
+ ### Full Schema
100
+
101
+ ```yaml
102
+ name: string # Unique identifier (required)
103
+ description: string # Human-readable description (required)
104
+ version: string # Semantic version (default: "1.0.0")
105
+
106
+ llm: string | object # LLM reference (required)
107
+ # Simple: "default"
108
+ # With override:
109
+ # name: default
110
+ # temperature: 0.3
111
+
112
+ prompt: # Prompt configuration (required)
113
+ system: string # System message/instructions
114
+ inputVariables: # Expected input field names
115
+ - string
116
+
117
+ tools: # Tools available to agent (optional)
118
+ - mcp:<server-name> # MCP server tools
119
+ - knowledge:<store-name> # Knowledge store search
120
+ - function:<function-name> # Custom function
121
+ - builtin:<tool-name> # Built-in tools (e.g., ask_user)
122
+
123
+ output: # Output configuration (optional)
124
+ format: text | json | structured # Default: text
125
+ schema: # Required when format is "structured"
126
+ type: object
127
+ properties:
128
+ <field>:
129
+ type: string | number | boolean | array | object
130
+ description: string
131
+ enum: [values] # For constrained string fields
132
+ items: # For array fields
133
+ type: string
134
+ minimum: number # For number fields
135
+ maximum: number
136
+ required:
137
+ - field1
138
+ - field2
139
+
140
+ metadata: # Custom metadata (optional)
141
+ category: string
142
+ tags: [string]
143
+ features: [string]
144
+ ```
145
+
146
+ ### Output Formats
147
+
148
+ **Text** (default) - Returns plain text:
149
+ ```yaml
150
+ output:
151
+ format: text
152
+ ```
153
+
154
+ **JSON** - Returns JSON string:
155
+ ```yaml
156
+ output:
157
+ format: json
158
+ ```
159
+
160
+ **Structured** - Returns validated JSON matching a schema:
161
+ ```yaml
162
+ output:
163
+ format: structured
164
+ schema:
165
+ type: object
166
+ properties:
167
+ sentiment:
168
+ type: string
169
+ enum: [positive, negative, neutral]
170
+ confidence:
171
+ type: number
172
+ minimum: 0
173
+ maximum: 1
174
+ required:
175
+ - sentiment
176
+ - confidence
177
+ ```
178
+
179
+ ### Conversation Memory
180
+
181
+ Agents automatically support conversation memory when a `sessionId` is provided in API calls. No agent-level configuration is required.
182
+
183
+ ```bash
184
+ # API call with sessionId
185
+ curl -X POST http://localhost:3000/api/agents/chatbot/invoke \
186
+ -H "Content-Type: application/json" \
187
+ -d '{"input": {"message": "Hello"}, "sessionId": "user-123"}'
188
+ ```
189
+
190
+ Memory settings (global, configured in orchestrator):
191
+ - `maxMessagesPerSession`: 50 (default)
192
+ - `sessionTTL`: optional, in milliseconds
193
+
194
+ ### Example Agents
195
+
196
+ **Basic agent:**
197
+ ```yaml
198
+ name: example
199
+ description: A helpful AI assistant
200
+ version: "1.0.0"
201
+
202
+ llm:
203
+ name: default
204
+ temperature: 0.7
205
+
206
+ prompt:
207
+ system: |
208
+ You are a helpful AI assistant.
209
+ inputVariables:
210
+ - query
211
+
212
+ tools: []
213
+
214
+ output:
215
+ format: text
216
+ ```
217
+
218
+ **Agent with knowledge search:**
219
+ ```yaml
220
+ name: researcher
221
+ description: Researches topics using knowledge stores
222
+ version: "1.0.0"
223
+
224
+ llm:
225
+ name: default
226
+ temperature: 0.5
227
+
228
+ prompt:
229
+ system: |
230
+ You are a researcher. Search the knowledge base and provide answers.
231
+ inputVariables:
232
+ - topic
233
+
234
+ tools:
235
+ - mcp:fetch
236
+ - knowledge:my-knowledge
237
+
238
+ output:
239
+ format: text
240
+ ```
241
+
242
+ **Agent with structured output:**
243
+ ```yaml
244
+ name: sentiment-structured
245
+ description: Sentiment analysis with structured output
246
+ version: "1.0.0"
247
+
248
+ llm:
249
+ name: default
250
+ temperature: 0
251
+
252
+ prompt:
253
+ system: |
254
+ Analyze the sentiment of the provided text.
255
+ inputVariables:
256
+ - text
257
+
258
+ output:
259
+ format: structured
260
+ schema:
261
+ type: object
262
+ properties:
263
+ sentiment:
264
+ type: string
265
+ enum: [positive, negative, neutral]
266
+ confidence:
267
+ type: number
268
+ minimum: 0
269
+ maximum: 1
270
+ keywords:
271
+ type: array
272
+ items:
273
+ type: string
274
+ required:
275
+ - sentiment
276
+ - confidence
277
+ ```
278
+
279
+ ---
280
+
281
+ ## Workflow Configuration (`*.workflow.yaml`)
282
+
283
+ Workflows orchestrate multiple agents. Located in the `workflows/` directory. Two types: `steps` (default) and `langgraph`.
284
+
285
+ ### Step-Based Workflows (`type: steps`)
286
+
287
+ Sequential/parallel agent orchestration with explicit step definitions.
288
+
289
+ #### Full Schema
290
+
291
+ ```yaml
292
+ name: string # Unique identifier (required)
293
+ description: string # Human-readable description (required)
294
+ version: string # Semantic version (default: "1.0.0")
295
+ type: steps # Explicit type (optional, "steps" is default)
296
+
297
+ input: # Input schema (required)
298
+ schema:
299
+ <field_name>:
300
+ type: string | number | boolean | array | object
301
+ required: boolean # Default: false
302
+ default: any # Default value
303
+ description: string
304
+
305
+ steps: # Workflow steps (required)
306
+ - id: string # Unique step identifier
307
+ agent: string # Agent name to execute
308
+ input: # Input mapping using templates
309
+ <key>: "{{input.field}}" # From workflow input
310
+ <key>: "{{steps.stepId.output}}" # From previous step output
311
+ <key>: "{{steps.stepId.metadata.duration}}" # From step metadata
312
+ condition: string # Optional conditional expression
313
+ retry: # Optional retry configuration
314
+ maxAttempts: number # Default: 3
315
+ delay: number # Milliseconds between retries (default: 1000)
316
+ output:
317
+ key: string # Store output under this key
318
+
319
+ # Parallel execution block
320
+ - parallel:
321
+ - id: step-a
322
+ agent: agent-a
323
+ input: { ... }
324
+ output: { key: result_a }
325
+ - id: step-b
326
+ agent: agent-b
327
+ input: { ... }
328
+ output: { key: result_b }
329
+
330
+ config: # Workflow configuration (optional)
331
+ timeout: number # Total timeout in ms (default: 300000)
332
+ onError: stop | continue | retry # Error handling (default: stop)
333
+
334
+ output: # Output mapping (required)
335
+ <key>: "{{steps.stepId.output}}"
336
+
337
+ metadata: # Custom metadata (optional)
338
+ category: string
339
+ tags: [string]
340
+ ```
341
+
342
+ #### Template Syntax
343
+
344
+ | Template | Description |
345
+ |----------|-------------|
346
+ | `{{input.fieldName}}` | Access workflow input field |
347
+ | `{{steps.stepId.output}}` | Access step output |
348
+ | `{{steps.stepId.output.nested.path}}` | Access nested output |
349
+ | `{{steps.stepId.metadata.duration}}` | Access step metadata |
350
+
351
+ #### Example
352
+
353
+ ```yaml
354
+ name: research-paper
355
+ description: Research a topic and write a paper
356
+ version: "1.0.0"
357
+
358
+ input:
359
+ schema:
360
+ topic:
361
+ type: string
362
+ required: true
363
+ style:
364
+ type: string
365
+ default: "professional"
366
+
367
+ steps:
368
+ - id: research
369
+ agent: researcher
370
+ input:
371
+ topic: "{{input.topic}}"
372
+ output:
373
+ key: findings
374
+
375
+ - id: write
376
+ agent: writer
377
+ input:
378
+ research: "{{steps.research.output}}"
379
+ style: "{{input.style}}"
380
+ output:
381
+ key: paper
382
+
383
+ config:
384
+ timeout: 600000
385
+ onError: stop
386
+
387
+ output:
388
+ paper: "{{steps.write.output}}"
389
+ findings: "{{steps.research.output}}"
390
+ ```
391
+
392
+ ---
393
+
394
+ ### LangGraph Workflows (`type: langgraph`)
395
+
396
+ Autonomous, prompt-driven workflows using LangGraph. The agent decides which tools and agents to call based on the prompt.
397
+
398
+ #### Full Schema
399
+
400
+ ```yaml
401
+ name: string # Unique identifier (required)
402
+ description: string # Human-readable description (required)
403
+ version: string # Semantic version (default: "1.0.0")
404
+ type: langgraph # Required for LangGraph workflows
405
+
406
+ input: # Input schema (required)
407
+ schema:
408
+ <field_name>:
409
+ type: string | number | boolean | array | object
410
+ required: boolean
411
+ description: string
412
+
413
+ prompt: # Prompt configuration (required)
414
+ system: string # System message with instructions
415
+ goal: string # Goal template (supports {{input.*}} interpolation)
416
+
417
+ graph: # LangGraph configuration (required)
418
+ model: string # LLM config name from llm.json
419
+
420
+ executionMode: react | single-turn # Default: react
421
+ # react: Full ReAct loop, multiple rounds of tool calls
422
+ # single-turn: Calls tools once and returns
423
+
424
+ tools: # Tool discovery config
425
+ mode: all | include | exclude | none # Default: all
426
+ sources: # Tool source types (default: all)
427
+ - mcp
428
+ - knowledge
429
+ - function
430
+ - builtin
431
+ include: [string] # Tool names to include (for mode: include)
432
+ exclude: [string] # Tool names to exclude (for mode: exclude)
433
+
434
+ agents: # Agent discovery config
435
+ mode: all | include | exclude | none # Default: all
436
+ include: [string] # Agent names to include
437
+ exclude: [string] # Agent names to exclude
438
+
439
+ maxIterations: number # Max tool-calling iterations (default: 10)
440
+ timeout: number # Timeout in ms (default: 300000)
441
+
442
+ output: # Output extraction (required)
443
+ <key>: "{{state.messages[-1].content}}" # Last message content
444
+
445
+ config: # Workflow configuration (optional)
446
+ onError: stop | continue | retry
447
+
448
+ metadata: # Custom metadata (optional)
449
+ category: string
450
+ tags: [string]
451
+ ```
452
+
453
+ #### Execution Modes
454
+
455
+ **Single-Turn** (`executionMode: single-turn`):
456
+ - Agent calls tools once, then returns
457
+ - Fast, predictable, lower token usage
458
+ - Best for: research, data gathering, straightforward tasks
459
+
460
+ **ReAct** (`executionMode: react`):
461
+ - Agent can call tools in multiple rounds
462
+ - Can analyze intermediate results and refine
463
+ - Best for: complex multi-step problems, iterative analysis
464
+ - Use `maxIterations` to prevent runaway loops
465
+
466
+ #### Tool and Agent Discovery
467
+
468
+ Tools from all configured sources (MCP, knowledge, functions, builtins) are automatically discovered and made available to the LangGraph agent. Agents are wrapped as callable tools.
469
+
470
+ ```yaml
471
+ # Discover all tools and agents
472
+ graph:
473
+ tools:
474
+ mode: all
475
+ agents:
476
+ mode: all
477
+
478
+ # Only specific tools
479
+ graph:
480
+ tools:
481
+ mode: include
482
+ include: ["vector_search_knowledge", "mcp_fetch"]
483
+ agents:
484
+ mode: include
485
+ include: [math, researcher]
486
+
487
+ # All tools except specific ones
488
+ graph:
489
+ tools:
490
+ mode: exclude
491
+ exclude: ["function_dangerous"]
492
+ agents:
493
+ mode: none # No agent discovery
494
+ ```
495
+
496
+ #### Human-in-the-Loop
497
+
498
+ LangGraph workflows support the `builtin:ask_user` tool. When called, the workflow pauses (via `NodeInterrupt`) and waits for user input.
499
+
500
+ ```yaml
501
+ prompt:
502
+ system: |
503
+ If you need clarification from the user, use the ask_user tool.
504
+ goal: "Research: {{input.topic}}"
505
+
506
+ graph:
507
+ tools:
508
+ mode: all
509
+ sources: [mcp, knowledge, function, builtin] # builtin includes ask_user
510
+ ```
511
+
512
+ #### Examples
513
+
514
+ **Single-turn research workflow:**
515
+ ```yaml
516
+ name: langgraph-research
517
+ description: Autonomous research using tool discovery
518
+ version: "1.0.0"
519
+ type: langgraph
520
+
521
+ input:
522
+ schema:
523
+ topic:
524
+ type: string
525
+ required: true
526
+
527
+ prompt:
528
+ system: |
529
+ You are a research assistant with access to tools and agents.
530
+ Identify all tools you need, call them in parallel, then synthesize results.
531
+ goal: "Research and analyze: {{input.topic}}"
532
+
533
+ graph:
534
+ model: default
535
+ executionMode: single-turn
536
+ tools:
537
+ mode: all
538
+ sources: [mcp, knowledge, function, builtin]
539
+ agents:
540
+ mode: all
541
+ maxIterations: 10
542
+ timeout: 300000
543
+
544
+ output:
545
+ analysis: "{{state.messages[-1].content}}"
546
+ ```
547
+
548
+ **Multi-turn ReAct workflow:**
549
+ ```yaml
550
+ name: langgraph-multi-turn
551
+ description: Iterative analysis with ReAct pattern
552
+ version: "1.0.0"
553
+ type: langgraph
554
+
555
+ input:
556
+ schema:
557
+ topic:
558
+ type: string
559
+ required: true
560
+
561
+ prompt:
562
+ system: |
563
+ You are an analyst that iteratively refines understanding.
564
+ 1. Gather initial information
565
+ 2. Analyze and identify gaps
566
+ 3. Call more tools to fill gaps
567
+ 4. Provide final synthesized answer
568
+ goal: "Provide a thorough analysis of: {{input.topic}}"
569
+
570
+ graph:
571
+ model: default
572
+ executionMode: react
573
+ tools:
574
+ mode: all
575
+ sources: [mcp, knowledge, function, builtin]
576
+ agents:
577
+ mode: all
578
+ maxIterations: 10
579
+ timeout: 300000
580
+
581
+ output:
582
+ analysis: "{{state.messages[-1].content}}"
583
+ ```
584
+
585
+ ---
586
+
587
+ ## Knowledge Configuration (`*.knowledge.yaml`)
588
+
589
+ Knowledge stores provide semantic search and RAG capabilities. Located in the `knowledge/` directory. Two kinds: `vector` (default) and `graph-rag`.
590
+
591
+ ### Vector Knowledge (`kind: vector`)
592
+
593
+ Traditional vector store with embeddings for semantic search.
594
+
595
+ #### Full Schema
596
+
597
+ ```yaml
598
+ name: string # Unique identifier (required)
599
+ description: string # Human-readable description (required)
600
+ kind: vector # Optional (vector is default)
601
+
602
+ source: # Data source (required)
603
+ # Directory source
604
+ type: directory
605
+ path: string # Path relative to project root
606
+ pattern: string # Glob pattern (e.g., "*.txt")
607
+ recursive: boolean # Default: true
608
+
609
+ # File source
610
+ type: file
611
+ path: string # Single file path
612
+
613
+ # Database source
614
+ type: database
615
+ connectionString: string # postgresql:// or mysql://
616
+ query: string # SQL query
617
+ contentColumn: string # Column with content (default: "content")
618
+ metadataColumns: [string] # Columns for metadata
619
+ batchSize: number # Rows per batch (default: 100)
620
+
621
+ # Web source
622
+ type: web
623
+ url: string # URL to scrape
624
+ selector: string # CSS selector (optional)
625
+ headers: # Custom headers (optional)
626
+ Authorization: "Bearer TOKEN"
627
+
628
+ # S3 source
629
+ type: s3
630
+ bucket: string # S3 bucket name
631
+ prefix: string # Folder filter (optional)
632
+ endpoint: string # Custom S3 endpoint (optional, for MinIO/Wasabi)
633
+ region: string # Default: us-east-1
634
+ accessKeyId: string # Optional (uses env vars if omitted)
635
+ secretAccessKey: string # Optional (uses env vars if omitted)
636
+ pattern: string # File glob pattern (optional)
637
+ forcePathStyle: boolean # Default: false (set true for MinIO)
638
+
639
+ loader: # Document loader (required)
640
+ type: text | pdf | csv | json | markdown
641
+ options: {} # Loader-specific options
642
+
643
+ splitter: # Text chunking (required)
644
+ type: character | recursive | token | markdown
645
+ chunkSize: number # Characters per chunk (default: 1000)
646
+ chunkOverlap: number # Overlap between chunks (default: 200)
647
+ separator: string # Custom separator (optional)
648
+
649
+ embedding: string # Embedding config name from llm.json (default: "default")
650
+
651
+ store: # Vector store backend (required)
652
+ type: memory | chroma | pinecone | qdrant
653
+ options: # Store-specific options
654
+ path: string # Storage path (for chroma)
655
+ collectionName: string # Collection name
656
+ url: string # Server URL (for chroma, qdrant)
657
+
658
+ search: # Search configuration (optional)
659
+ defaultK: number # Results per search (default: 4)
660
+ scoreThreshold: number # Minimum similarity 0-1
661
+
662
+ metadata: # Custom metadata (optional)
663
+ category: string
664
+ ```
665
+
666
+ #### Examples
667
+
668
+ **Basic directory source:**
669
+ ```yaml
670
+ name: docs
671
+ description: Documentation knowledge base
672
+
673
+ source:
674
+ type: directory
675
+ path: knowledge/sample-data
676
+ pattern: "*.txt"
677
+
678
+ loader:
679
+ type: text
680
+
681
+ splitter:
682
+ type: character
683
+ chunkSize: 1000
684
+ chunkOverlap: 200
685
+
686
+ embedding: default
687
+
688
+ store:
689
+ type: memory
690
+
691
+ search:
692
+ defaultK: 4
693
+ ```
694
+
695
+ **Database source (PostgreSQL):**
696
+ ```yaml
697
+ name: postgres-docs
698
+ description: Documentation from PostgreSQL
699
+
700
+ source:
701
+ type: database
702
+ connectionString: postgresql://user:password@localhost:5432/docs_db
703
+ query: SELECT content, title, category FROM documents WHERE published = true
704
+ contentColumn: content
705
+ metadataColumns:
706
+ - title
707
+ - category
708
+ batchSize: 100
709
+
710
+ loader:
711
+ type: text
712
+
713
+ splitter:
714
+ type: recursive
715
+ chunkSize: 1000
716
+ chunkOverlap: 200
717
+
718
+ embedding: default
719
+ store:
720
+ type: memory
721
+ ```
722
+
723
+ **S3 source (MinIO):**
724
+ ```yaml
725
+ name: s3-docs
726
+ description: Documents from MinIO S3 storage
727
+
728
+ source:
729
+ type: s3
730
+ endpoint: http://localhost:9000
731
+ bucket: knowledge-base
732
+ prefix: documentation/
733
+ region: us-east-1
734
+ accessKeyId: minioadmin
735
+ secretAccessKey: minioadmin
736
+ pattern: "*.{pdf,txt,md}"
737
+ forcePathStyle: true
738
+
739
+ loader:
740
+ type: text
741
+
742
+ splitter:
743
+ type: recursive
744
+ chunkSize: 1000
745
+ chunkOverlap: 200
746
+
747
+ embedding: default
748
+ store:
749
+ type: memory
750
+ ```
751
+
752
+ **Web scraping source:**
753
+ ```yaml
754
+ name: web-docs
755
+ description: Documentation scraped from website
756
+
757
+ source:
758
+ type: web
759
+ url: https://docs.example.com/guide/
760
+ selector: article.documentation
761
+
762
+ loader:
763
+ type: text
764
+
765
+ splitter:
766
+ type: markdown
767
+ chunkSize: 1500
768
+ chunkOverlap: 100
769
+
770
+ embedding: default
771
+ store:
772
+ type: memory
773
+ ```
774
+
775
+ ---
776
+
777
+ ### GraphRAG Knowledge (`kind: graph-rag`)
778
+
779
+ Entity extraction and knowledge graph with community detection for advanced analysis.
780
+
781
+ #### Full Schema
782
+
783
+ ```yaml
784
+ name: string # Unique identifier (required)
785
+ kind: graph-rag # Required for GraphRAG
786
+ description: string # Human-readable description (required)
787
+
788
+ source: # Same source types as vector (required)
789
+ type: directory | file | database | web | s3
790
+ # ... same fields as vector sources
791
+
792
+ loader: # Document loader (required)
793
+ type: text | pdf | csv | json | markdown
794
+
795
+ splitter: # Text chunking (required)
796
+ type: character | recursive | token | markdown
797
+ chunkSize: number
798
+ chunkOverlap: number
799
+
800
+ embedding: string # Embedding config name from llm.json
801
+
802
+ graph: # Graph configuration (required)
803
+ extraction: # Entity extraction config
804
+ llm: string # LLM name from llm.json (default: "default")
805
+ entityTypes: # Optional - omit for automatic extraction
806
+ - name: string
807
+ description: string
808
+ relationshipTypes: # Optional - omit for automatic extraction
809
+ - name: string
810
+ description: string
811
+
812
+ communities: # Community detection config
813
+ algorithm: louvain # Only supported algorithm
814
+ resolution: number # Louvain resolution (default: 1.0)
815
+ minSize: number # Min community size (default: 2)
816
+ summaryLlm: string # LLM for community summaries (default: "default")
817
+
818
+ store: # Graph store backend
819
+ type: memory | neo4j # Default: memory
820
+ options: {} # Store-specific options
821
+
822
+ cache: # Graph cache config
823
+ enabled: boolean # Default: true
824
+ directory: string # Default: ".graph-cache"
825
+
826
+ search: # Search configuration (optional)
827
+ defaultK: number # Results per search (default: 10)
828
+ localSearch: # Entity neighborhood search
829
+ maxDepth: number # Graph traversal depth (default: 2)
830
+ globalSearch: # Community-level search
831
+ topCommunities: number # Communities to consider (default: 5)
832
+ llm: string # LLM for synthesis (default: "default")
833
+
834
+ metadata: # Custom metadata (optional)
835
+ category: string
836
+ ```
837
+
838
+ #### How GraphRAG Works
839
+
840
+ 1. **Extraction**: Documents are split and an LLM extracts entities and relationships
841
+ 2. **Graph Building**: Entities become nodes, relationships become edges
842
+ 3. **Community Detection**: Louvain algorithm groups related entities into communities
843
+ 4. **Community Summaries**: An LLM generates summaries for each community
844
+ 5. **Search**:
845
+ - **Local search**: Finds specific entities and traverses their neighborhood
846
+ - **Global search**: Analyzes community-level summaries for thematic queries
847
+
848
+ #### Example
849
+
850
+ ```yaml
851
+ name: call-center-analysis
852
+ kind: graph-rag
853
+ description: GraphRAG for analyzing call center transcripts
854
+
855
+ source:
856
+ type: directory
857
+ path: knowledge/transcripts
858
+ pattern: "*.txt"
859
+ recursive: true
860
+
861
+ loader:
862
+ type: text
863
+
864
+ splitter:
865
+ type: recursive
866
+ chunkSize: 2000
867
+ chunkOverlap: 200
868
+
869
+ embedding: default
870
+
871
+ graph:
872
+ extraction:
873
+ llm: default
874
+ entityTypes:
875
+ - name: Agent
876
+ description: "Call center representative"
877
+ - name: Customer
878
+ description: "Person calling"
879
+ - name: Vehicle
880
+ description: "Car discussed"
881
+ - name: Outcome
882
+ description: "Result of the call"
883
+ relationshipTypes:
884
+ - name: HANDLED_BY
885
+ description: "Call was handled by an agent"
886
+ - name: INTERESTED_IN
887
+ description: "Customer interest in vehicle"
888
+ - name: RESULTED_IN
889
+ description: "Call resulted in outcome"
890
+
891
+ communities:
892
+ algorithm: louvain
893
+ resolution: 1.0
894
+ minSize: 2
895
+ summaryLlm: default
896
+
897
+ store:
898
+ type: memory
899
+
900
+ cache:
901
+ enabled: true
902
+ directory: .graph-cache
903
+
904
+ search:
905
+ defaultK: 10
906
+ localSearch:
907
+ maxDepth: 2
908
+ globalSearch:
909
+ topCommunities: 5
910
+ llm: default
911
+ ```
912
+
913
+ ---
914
+
915
+ ## Function Configuration (`*.function.js`)
916
+
917
+ Custom JavaScript tools located in the `functions/` directory. Each file exports a default object with the function definition.
918
+
919
+ ### Schema
920
+
921
+ ```javascript
922
+ export default {
923
+ name: 'function-name', // Unique identifier (required)
924
+ description: 'What it does', // Description for the LLM (required)
925
+
926
+ parameters: { // Input parameters (required)
927
+ paramName: {
928
+ type: 'string', // string | number | boolean | array | object | enum
929
+ description: 'Description', // Description for the LLM
930
+ required: true, // Default: true
931
+ default: 'value', // Default value (optional)
932
+ values: ['a', 'b'], // For enum type only
933
+ },
934
+ },
935
+
936
+ execute: async ({ paramName }) => {
937
+ // Your logic here (required)
938
+ return 'Result string';
939
+ },
940
+ };
941
+
942
+ // Optional metadata
943
+ export const metadata = {
944
+ name: 'function-name',
945
+ description: 'Description',
946
+ version: '1.0.0',
947
+ author: 'Author',
948
+ tags: ['category'],
949
+ };
950
+ ```
951
+
952
+ ### Parameter Types
953
+
954
+ | Type | Description | Extra Fields |
955
+ |------|-------------|-------------|
956
+ | `string` | Text value | - |
957
+ | `number` | Numeric value | - |
958
+ | `boolean` | true/false | - |
959
+ | `array` | Array of values | - |
960
+ | `object` | JSON object | - |
961
+ | `enum` | Fixed set of values | `values: ['a', 'b']` |
962
+
963
+ ### Example
964
+
965
+ ```javascript
966
+ // functions/calculator.function.js
967
+
968
+ export default {
969
+ name: 'calculator',
970
+ description: 'Performs basic arithmetic operations',
971
+
972
+ parameters: {
973
+ a: { type: 'number', description: 'First number' },
974
+ b: { type: 'number', description: 'Second number' },
975
+ operation: {
976
+ type: 'enum',
977
+ values: ['add', 'subtract', 'multiply', 'divide'],
978
+ description: 'Operation to perform',
979
+ },
980
+ },
981
+
982
+ execute: async ({ a, b, operation }) => {
983
+ switch (operation) {
984
+ case 'add': return `${a} + ${b} = ${a + b}`;
985
+ case 'subtract': return `${a} - ${b} = ${a - b}`;
986
+ case 'multiply': return `${a} * ${b} = ${a * b}`;
987
+ case 'divide': return `${a} / ${b} = ${a / b}`;
988
+ }
989
+ },
990
+ };
991
+ ```
992
+
993
+ ### Using in Agents
994
+
995
+ ```yaml
996
+ tools:
997
+ - function:calculator # References calculator.function.js
998
+ - function:fibonacci # References fibonacci.function.js
999
+ ```
1000
+
1001
+ ---
1002
+
1003
+ ## MCP Configuration (`mcp.json`)
1004
+
1005
+ Model Context Protocol server configuration at the project root.
1006
+
1007
+ ### Full Schema
1008
+
1009
+ ```json
1010
+ {
1011
+ "version": "1.0.0",
1012
+ "servers": {
1013
+ "<server-name>": {
1014
+ "transport": "stdio | streamable-http | sse | sse-only",
1015
+ "url": "string (for remote transports)",
1016
+ "headers": { "key": "value" },
1017
+ "command": "string (for stdio transport)",
1018
+ "args": ["string"],
1019
+ "env": { "KEY": "VALUE" },
1020
+ "description": "string",
1021
+ "timeout": 30000,
1022
+ "enabled": true
1023
+ }
1024
+ },
1025
+ "globalOptions": {
1026
+ "throwOnLoadError": false,
1027
+ "prefixToolNameWithServerName": true,
1028
+ "additionalToolNamePrefix": "",
1029
+ "defaultToolTimeout": 30000
1030
+ }
1031
+ }
1032
+ ```
1033
+
1034
+ ### Transport Types
1035
+
1036
+ | Transport | Use Case | Required Fields |
1037
+ |-----------|----------|----------------|
1038
+ | `stdio` | Local CLI tools | `command`, `args` |
1039
+ | `streamable-http` | Remote HTTP servers | `url` |
1040
+ | `sse` | Server-Sent Events | `url` |
1041
+ | `sse-only` | SSE without HTTP fallback | `url` |
1042
+
1043
+ ### Example
1044
+
1045
+ ```json
1046
+ {
1047
+ "version": "1.0.0",
1048
+ "servers": {
1049
+ "fetch": {
1050
+ "transport": "streamable-http",
1051
+ "url": "https://remote.mcpservers.org/fetch/mcp",
1052
+ "description": "Web fetch capabilities",
1053
+ "timeout": 30000,
1054
+ "enabled": true
1055
+ },
1056
+ "filesystem": {
1057
+ "transport": "stdio",
1058
+ "command": "npx",
1059
+ "args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"],
1060
+ "description": "File system access"
1061
+ }
1062
+ },
1063
+ "globalOptions": {
1064
+ "throwOnLoadError": false,
1065
+ "prefixToolNameWithServerName": true
1066
+ }
1067
+ }
1068
+ ```
1069
+
1070
+ ### Using in Agents
1071
+
1072
+ ```yaml
1073
+ tools:
1074
+ - mcp:fetch # All tools from "fetch" server
1075
+ - mcp:filesystem # All tools from "filesystem" server
1076
+ ```
1077
+
1078
+ ---
1079
+
1080
+ ## Tool Reference
1081
+
1082
+ All tool types and their prefixes for use in agent `tools` lists and LangGraph discovery:
1083
+
1084
+ | Prefix | Source | Example |
1085
+ |--------|--------|---------|
1086
+ | `mcp:<server>` | MCP server tools | `mcp:fetch` |
1087
+ | `knowledge:<store>` | Knowledge store search | `knowledge:docs` |
1088
+ | `function:<name>` | Custom JavaScript functions | `function:calculator` |
1089
+ | `builtin:<name>` | Framework built-in tools | `builtin:ask_user` |
1090
+
1091
+ ### Built-in Tools
1092
+
1093
+ | Tool | Description |
1094
+ |------|-------------|
1095
+ | `builtin:ask_user` | Pause execution and request user input (LangGraph only) |
1096
+
1097
+ ---
1098
+
1099
+ ## Environment Variables
1100
+
1101
+ | Variable | Default | Description |
1102
+ |----------|---------|-------------|
1103
+ | `PORT` | `3000` | HTTP server port |
1104
+ | `HOST` | `0.0.0.0` | Server bind address |
1105
+ | `ORCHA_BASE_DIR` | Current directory | Base directory for all config files |
1106
+ | `CORS_ORIGIN` | `true` | CORS origin policy |
1107
+ | `NODE_ENV` | - | Node.js environment |
1108
+
1109
+ For S3 knowledge sources (when not specified in YAML):
1110
+ | Variable | Description |
1111
+ |----------|-------------|
1112
+ | `AWS_ACCESS_KEY_ID` | AWS access key |
1113
+ | `AWS_SECRET_ACCESS_KEY` | AWS secret key |
1114
+ | `AWS_REGION` | AWS region |
1115
+ | `S3_ENDPOINT` | Custom S3 endpoint |
1116
+
1117
+ ---
1118
+
1119
+ ## Tips
1120
+
1121
+ ### Choosing an Execution Mode for LangGraph
1122
+
1123
+ | Your Task | Recommended Mode |
1124
+ |-----------|-----------------|
1125
+ | Simple research/data gathering | `single-turn` |
1126
+ | Gather and summarize | `single-turn` |
1127
+ | Call specific agents | `single-turn` |
1128
+ | Multi-step problem solving | `react` |
1129
+ | Iterative refinement | `react` |
1130
+ | Unknown complexity | Start with `single-turn` |
1131
+
1132
+ ### When to Use GraphRAG vs Vector
1133
+
1134
+ | Use Case | Recommendation |
1135
+ |----------|---------------|
1136
+ | Simple document search | Vector |
1137
+ | FAQ/knowledge base lookup | Vector |
1138
+ | Entity relationship analysis | GraphRAG |
1139
+ | Thematic/pattern analysis | GraphRAG |
1140
+ | Small dataset (<100 docs) | Vector |
1141
+ | Complex interconnected data | GraphRAG |
1142
+
1143
+ ### Common Patterns
1144
+
1145
+ **Agent with memory + tools:**
1146
+ ```yaml
1147
+ name: smart-chatbot
1148
+ llm: { name: default, temperature: 0.7 }
1149
+ prompt:
1150
+ system: |
1151
+ You are a helpful assistant with access to tools.
1152
+ Use conversation context to provide relevant responses.
1153
+ inputVariables:
1154
+ - message
1155
+ tools:
1156
+ - mcp:fetch
1157
+ - knowledge:docs
1158
+ - function:calculator
1159
+ output:
1160
+ format: text
1161
+ ```
1162
+
1163
+ **Workflow with parallel steps:**
1164
+ ```yaml
1165
+ steps:
1166
+ - parallel:
1167
+ - id: research
1168
+ agent: researcher
1169
+ input: { topic: "{{input.topic}}" }
1170
+ output: { key: research }
1171
+ - id: data
1172
+ agent: data-analyst
1173
+ input: { query: "{{input.topic}}" }
1174
+ output: { key: data }
1175
+ - id: synthesize
1176
+ agent: writer
1177
+ input:
1178
+ research: "{{steps.research.output}}"
1179
+ data: "{{steps.data.output}}"
1180
+ output: { key: final }
1181
+ ```
1182
+
1183
+ **LangGraph with filtered tools:**
1184
+ ```yaml
1185
+ type: langgraph
1186
+ graph:
1187
+ model: default
1188
+ executionMode: single-turn
1189
+ tools:
1190
+ mode: include
1191
+ include: ["vector_search_docs", "mcp_fetch"]
1192
+ agents:
1193
+ mode: none
1194
+ maxIterations: 5
1195
+ ```