agent-orcha 0.0.5 → 0.0.7
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.
- package/README.md +194 -1277
- package/dist/lib/agents/agent-executor.d.ts +4 -2
- package/dist/lib/agents/agent-executor.d.ts.map +1 -1
- package/dist/lib/agents/agent-executor.js +68 -52
- package/dist/lib/agents/agent-executor.js.map +1 -1
- package/dist/lib/agents/agent-loader.d.ts +3 -0
- package/dist/lib/agents/agent-loader.d.ts.map +1 -1
- package/dist/lib/agents/agent-loader.js +10 -1
- package/dist/lib/agents/agent-loader.js.map +1 -1
- package/dist/lib/agents/react-loop.d.ts.map +1 -1
- package/dist/lib/agents/react-loop.js +180 -142
- package/dist/lib/agents/react-loop.js.map +1 -1
- package/dist/lib/agents/types.d.ts +181 -18
- package/dist/lib/agents/types.d.ts.map +1 -1
- package/dist/lib/agents/types.js +18 -2
- package/dist/lib/agents/types.js.map +1 -1
- package/dist/lib/functions/function-loader.d.ts +2 -0
- package/dist/lib/functions/function-loader.d.ts.map +1 -1
- package/dist/lib/functions/function-loader.js +10 -0
- package/dist/lib/functions/function-loader.js.map +1 -1
- package/dist/lib/integrations/email.d.ts +38 -0
- package/dist/lib/integrations/email.d.ts.map +1 -0
- package/dist/lib/integrations/email.js +249 -0
- package/dist/lib/integrations/email.js.map +1 -0
- package/dist/lib/integrations/integration-manager.d.ts +5 -0
- package/dist/lib/integrations/integration-manager.d.ts.map +1 -1
- package/dist/lib/integrations/integration-manager.js +53 -3
- package/dist/lib/integrations/integration-manager.js.map +1 -1
- package/dist/lib/integrations/types.d.ts +187 -4
- package/dist/lib/integrations/types.d.ts.map +1 -1
- package/dist/lib/integrations/types.js +24 -1
- package/dist/lib/integrations/types.js.map +1 -1
- package/dist/lib/knowledge/knowledge-store.d.ts +6 -0
- package/dist/lib/knowledge/knowledge-store.d.ts.map +1 -1
- package/dist/lib/knowledge/knowledge-store.js +71 -4
- package/dist/lib/knowledge/knowledge-store.js.map +1 -1
- package/dist/lib/knowledge/loaders/file-loaders.d.ts +8 -2
- package/dist/lib/knowledge/loaders/file-loaders.d.ts.map +1 -1
- package/dist/lib/knowledge/loaders/file-loaders.js +89 -60
- package/dist/lib/knowledge/loaders/file-loaders.js.map +1 -1
- package/dist/lib/knowledge/loaders/web-loader.d.ts +12 -3
- package/dist/lib/knowledge/loaders/web-loader.d.ts.map +1 -1
- package/dist/lib/knowledge/loaders/web-loader.js +56 -22
- package/dist/lib/knowledge/loaders/web-loader.js.map +1 -1
- package/dist/lib/knowledge/types.d.ts +56 -20
- package/dist/lib/knowledge/types.d.ts.map +1 -1
- package/dist/lib/knowledge/types.js +18 -3
- package/dist/lib/knowledge/types.js.map +1 -1
- package/dist/lib/llm/llm-call-logger.d.ts +3 -1
- package/dist/lib/llm/llm-call-logger.d.ts.map +1 -1
- package/dist/lib/llm/llm-call-logger.js +31 -26
- package/dist/lib/llm/llm-call-logger.js.map +1 -1
- package/dist/lib/llm/llm-config.d.ts +8 -0
- package/dist/lib/llm/llm-config.d.ts.map +1 -1
- package/dist/lib/llm/llm-config.js +3 -1
- package/dist/lib/llm/llm-config.js.map +1 -1
- package/dist/lib/llm/llm-factory.d.ts.map +1 -1
- package/dist/lib/llm/llm-factory.js +3 -0
- package/dist/lib/llm/llm-factory.js.map +1 -1
- package/dist/lib/llm/providers/anthropic-chat-model.d.ts +5 -1
- package/dist/lib/llm/providers/anthropic-chat-model.d.ts.map +1 -1
- package/dist/lib/llm/providers/anthropic-chat-model.js +118 -42
- package/dist/lib/llm/providers/anthropic-chat-model.js.map +1 -1
- package/dist/lib/llm/providers/gemini-chat-model.d.ts +3 -2
- package/dist/lib/llm/providers/gemini-chat-model.d.ts.map +1 -1
- package/dist/lib/llm/providers/gemini-chat-model.js +83 -24
- package/dist/lib/llm/providers/gemini-chat-model.js.map +1 -1
- package/dist/lib/llm/providers/openai-chat-model.d.ts +10 -1
- package/dist/lib/llm/providers/openai-chat-model.d.ts.map +1 -1
- package/dist/lib/llm/providers/openai-chat-model.js +233 -32
- package/dist/lib/llm/providers/openai-chat-model.js.map +1 -1
- package/dist/lib/logger.d.ts.map +1 -1
- package/dist/lib/logger.js +0 -1
- package/dist/lib/logger.js.map +1 -1
- package/dist/lib/mcp/mcp-client.d.ts.map +1 -1
- package/dist/lib/mcp/mcp-client.js +5 -3
- package/dist/lib/mcp/mcp-client.js.map +1 -1
- package/dist/lib/mcp/types.d.ts +0 -9
- package/dist/lib/mcp/types.d.ts.map +1 -1
- package/dist/lib/mcp/types.js +1 -2
- package/dist/lib/mcp/types.js.map +1 -1
- package/dist/lib/memory/memory-manager.d.ts +1 -0
- package/dist/lib/memory/memory-manager.d.ts.map +1 -1
- package/dist/lib/memory/memory-manager.js +9 -0
- package/dist/lib/memory/memory-manager.js.map +1 -1
- package/dist/lib/orchestrator.d.ts +2 -8
- package/dist/lib/orchestrator.d.ts.map +1 -1
- package/dist/lib/orchestrator.js +96 -3
- package/dist/lib/orchestrator.js.map +1 -1
- package/dist/lib/sandbox/cdp-client.d.ts +14 -0
- package/dist/lib/sandbox/cdp-client.d.ts.map +1 -0
- package/dist/lib/sandbox/cdp-client.js +113 -0
- package/dist/lib/sandbox/cdp-client.js.map +1 -0
- package/dist/lib/sandbox/html-to-markdown.d.ts +9 -1
- package/dist/lib/sandbox/html-to-markdown.d.ts.map +1 -1
- package/dist/lib/sandbox/html-to-markdown.js +67 -10
- package/dist/lib/sandbox/html-to-markdown.js.map +1 -1
- package/dist/lib/sandbox/index.d.ts +5 -0
- package/dist/lib/sandbox/index.d.ts.map +1 -1
- package/dist/lib/sandbox/index.js +4 -0
- package/dist/lib/sandbox/index.js.map +1 -1
- package/dist/lib/sandbox/page-readiness.d.ts +37 -0
- package/dist/lib/sandbox/page-readiness.d.ts.map +1 -0
- package/dist/lib/sandbox/page-readiness.js +235 -0
- package/dist/lib/sandbox/page-readiness.js.map +1 -0
- package/dist/lib/sandbox/sandbox-browser.d.ts +4 -0
- package/dist/lib/sandbox/sandbox-browser.d.ts.map +1 -0
- package/dist/lib/sandbox/sandbox-browser.js +303 -0
- package/dist/lib/sandbox/sandbox-browser.js.map +1 -0
- package/dist/lib/sandbox/sandbox-file.d.ts +4 -0
- package/dist/lib/sandbox/sandbox-file.d.ts.map +1 -0
- package/dist/lib/sandbox/sandbox-file.js +168 -0
- package/dist/lib/sandbox/sandbox-file.js.map +1 -0
- package/dist/lib/sandbox/sandbox-shell.d.ts +4 -0
- package/dist/lib/sandbox/sandbox-shell.d.ts.map +1 -0
- package/dist/lib/sandbox/sandbox-shell.js +93 -0
- package/dist/lib/sandbox/sandbox-shell.js.map +1 -0
- package/dist/lib/sandbox/sandbox-web.d.ts.map +1 -1
- package/dist/lib/sandbox/sandbox-web.js +37 -22
- package/dist/lib/sandbox/sandbox-web.js.map +1 -1
- package/dist/lib/sandbox/types.d.ts +9 -0
- package/dist/lib/sandbox/types.d.ts.map +1 -1
- package/dist/lib/sandbox/types.js +1 -0
- package/dist/lib/sandbox/types.js.map +1 -1
- package/dist/lib/sandbox/vision-browser.d.ts +4 -0
- package/dist/lib/sandbox/vision-browser.d.ts.map +1 -0
- package/dist/lib/sandbox/vision-browser.js +289 -0
- package/dist/lib/sandbox/vision-browser.js.map +1 -0
- package/dist/lib/skills/skill-loader.d.ts +2 -0
- package/dist/lib/skills/skill-loader.d.ts.map +1 -1
- package/dist/lib/skills/skill-loader.js +12 -1
- package/dist/lib/skills/skill-loader.js.map +1 -1
- package/dist/lib/tasks/task-manager.d.ts +3 -1
- package/dist/lib/tasks/task-manager.d.ts.map +1 -1
- package/dist/lib/tasks/task-manager.js +11 -0
- package/dist/lib/tasks/task-manager.js.map +1 -1
- package/dist/lib/tasks/task-store.d.ts +1 -1
- package/dist/lib/tasks/task-store.d.ts.map +1 -1
- package/dist/lib/tasks/task-store.js.map +1 -1
- package/dist/lib/tasks/types.d.ts +18 -0
- package/dist/lib/tasks/types.d.ts.map +1 -1
- package/dist/lib/tools/built-in/integration-tools.d.ts +4 -0
- package/dist/lib/tools/built-in/integration-tools.d.ts.map +1 -0
- package/dist/lib/tools/built-in/integration-tools.js +47 -0
- package/dist/lib/tools/built-in/integration-tools.js.map +1 -0
- package/dist/lib/tools/built-in/knowledge-entity-lookup.tool.d.ts.map +1 -1
- package/dist/lib/tools/built-in/knowledge-entity-lookup.tool.js +12 -6
- package/dist/lib/tools/built-in/knowledge-entity-lookup.tool.js.map +1 -1
- package/dist/lib/tools/built-in/knowledge-sql.tool.d.ts.map +1 -1
- package/dist/lib/tools/built-in/knowledge-sql.tool.js +4 -3
- package/dist/lib/tools/built-in/knowledge-sql.tool.js.map +1 -1
- package/dist/lib/tools/built-in/query-validators.d.ts.map +1 -1
- package/dist/lib/tools/built-in/query-validators.js +4 -0
- package/dist/lib/tools/built-in/query-validators.js.map +1 -1
- package/dist/lib/tools/workspace/workspace-tools.d.ts +1 -0
- package/dist/lib/tools/workspace/workspace-tools.d.ts.map +1 -1
- package/dist/lib/tools/workspace/workspace-tools.js +39 -0
- package/dist/lib/tools/workspace/workspace-tools.js.map +1 -1
- package/dist/lib/triggers/cron-trigger.d.ts +1 -1
- package/dist/lib/triggers/cron-trigger.d.ts.map +1 -1
- package/dist/lib/triggers/cron-trigger.js.map +1 -1
- package/dist/lib/triggers/trigger-manager.d.ts +1 -0
- package/dist/lib/triggers/trigger-manager.d.ts.map +1 -1
- package/dist/lib/triggers/trigger-manager.js +26 -0
- package/dist/lib/triggers/trigger-manager.js.map +1 -1
- package/dist/lib/triggers/webhook-trigger.d.ts +1 -1
- package/dist/lib/triggers/webhook-trigger.d.ts.map +1 -1
- package/dist/lib/triggers/webhook-trigger.js.map +1 -1
- package/dist/lib/types/llm-types.d.ts +22 -4
- package/dist/lib/types/llm-types.d.ts.map +1 -1
- package/dist/lib/types/llm-types.js +50 -0
- package/dist/lib/types/llm-types.js.map +1 -1
- package/dist/lib/types/tool-factory.d.ts +2 -2
- package/dist/lib/types/tool-factory.d.ts.map +1 -1
- package/dist/lib/types/tool-factory.js.map +1 -1
- package/dist/lib/utils/env-substitution.d.ts +6 -0
- package/dist/lib/utils/env-substitution.d.ts.map +1 -0
- package/dist/lib/utils/env-substitution.js +15 -0
- package/dist/lib/utils/env-substitution.js.map +1 -0
- package/dist/lib/workflows/react-workflow-executor.js +3 -3
- package/dist/lib/workflows/react-workflow-executor.js.map +1 -1
- package/dist/lib/workflows/types.d.ts +10 -10
- package/dist/lib/workflows/workflow-loader.d.ts +3 -0
- package/dist/lib/workflows/workflow-loader.d.ts.map +1 -1
- package/dist/lib/workflows/workflow-loader.js +10 -1
- package/dist/lib/workflows/workflow-loader.js.map +1 -1
- package/dist/public/chat.html +114 -0
- package/dist/public/index.html +157 -0
- package/dist/public/src/components/AgentComposer.js +807 -0
- package/dist/public/src/components/AgentsView.js +740 -317
- package/dist/public/src/components/AppRoot.js +30 -5
- package/dist/public/src/components/GraphView.js +372 -288
- package/dist/public/src/components/IdeView.js +163 -7
- package/dist/public/src/components/MonitorView.js +139 -1
- package/dist/public/src/components/StandaloneChat.js +889 -0
- package/dist/public/src/components/WorkflowsView.js +180 -28
- package/dist/public/src/services/ApiService.js +7 -2
- package/dist/public/src/services/SessionStore.js +83 -0
- package/dist/public/src/store.js +0 -2
- package/dist/public/src/utils/markdown.js +13 -0
- package/dist/src/cli/index.js +7 -4
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/middleware/auth.d.ts.map +1 -1
- package/dist/src/middleware/auth.js +28 -6
- package/dist/src/middleware/auth.js.map +1 -1
- package/dist/src/middleware/rate-limit.d.ts +8 -0
- package/dist/src/middleware/rate-limit.d.ts.map +1 -0
- package/dist/src/middleware/rate-limit.js +21 -0
- package/dist/src/middleware/rate-limit.js.map +1 -0
- package/dist/src/routes/agents.route.d.ts.map +1 -1
- package/dist/src/routes/agents.route.js +136 -10
- package/dist/src/routes/agents.route.js.map +1 -1
- package/dist/src/routes/chat.route.d.ts +3 -0
- package/dist/src/routes/chat.route.d.ts.map +1 -0
- package/dist/src/routes/chat.route.js +155 -0
- package/dist/src/routes/chat.route.js.map +1 -0
- package/dist/src/routes/files.route.d.ts.map +1 -1
- package/dist/src/routes/files.route.js +37 -2
- package/dist/src/routes/files.route.js.map +1 -1
- package/dist/src/routes/llm.route.d.ts.map +1 -1
- package/dist/src/routes/llm.route.js +40 -5
- package/dist/src/routes/llm.route.js.map +1 -1
- package/dist/src/routes/tasks.route.d.ts.map +1 -1
- package/dist/src/routes/tasks.route.js +15 -1
- package/dist/src/routes/tasks.route.js.map +1 -1
- package/dist/src/routes/vnc.route.d.ts +3 -0
- package/dist/src/routes/vnc.route.d.ts.map +1 -0
- package/dist/src/routes/vnc.route.js +49 -0
- package/dist/src/routes/vnc.route.js.map +1 -0
- package/dist/src/server.d.ts.map +1 -1
- package/dist/src/server.js +5 -1
- package/dist/src/server.js.map +1 -1
- package/dist/templates/Demo.md +152 -0
- package/dist/templates/README.md +12 -3
- package/dist/templates/agents/architect.agent.yaml +20 -12
- package/dist/templates/agents/chatbot.agent.yaml +23 -26
- package/dist/templates/agents/corporate.agent.yaml +65 -0
- package/dist/templates/agents/investment-analyst.agent.yaml +80 -0
- package/dist/templates/agents/music-librarian.agent.yaml +70 -0
- package/dist/templates/agents/network-security.agent.yaml +82 -0
- package/dist/templates/agents/transport-security.agent.yaml +70 -0
- package/dist/templates/agents/web-engineer.agent.yaml +99 -0
- package/dist/templates/agents/web-pilot.agent.yaml +58 -0
- package/dist/templates/knowledge/music-store/LICENSE.md +11 -0
- package/dist/templates/knowledge/music-store/musicstore.sqlite +0 -0
- package/dist/templates/knowledge/music-store/tables.png +0 -0
- package/dist/templates/knowledge/music-store.knowledge.yaml +138 -0
- package/dist/templates/knowledge/org-chart/personnel.csv +21 -21
- package/dist/templates/knowledge/org-chart.knowledge.yaml +4 -0
- package/dist/templates/knowledge/pet-store.knowledge.yaml +3 -0
- package/dist/templates/knowledge/security-incidents/incidents.json +55935 -0
- package/dist/templates/knowledge/security-incidents.knowledge.yaml +46 -0
- package/dist/templates/knowledge/{example.knowledge.yaml → transcripts.knowledge.yaml} +9 -5
- package/dist/templates/knowledge/transport-ot/systems.csv +117 -0
- package/dist/templates/knowledge/transport-ot.knowledge.yaml +55 -0
- package/dist/templates/llm.json +7 -30
- package/dist/templates/mcp.json +7 -4
- package/dist/templates/skills/orcha-builder/SKILL.md +106 -226
- package/dist/templates/skills/pii-guard/SKILL.md +22 -0
- package/dist/templates/skills/sandbox/SKILL.md +25 -48
- package/dist/templates/skills/web-pilot/SKILL.md +51 -0
- package/package.json +8 -3
- package/dist/templates/agents/knowledge-broker.agent.yaml +0 -39
- package/dist/templates/agents/sandbox.agent.yaml +0 -56
package/README.md
CHANGED
|
@@ -4,31 +4,44 @@
|
|
|
4
4
|
|
|
5
5
|
Agent Orcha is a declarative framework designed to build, manage, and scale multi-agent AI systems with ease. It combines the flexibility of TypeScript with the simplicity of YAML to orchestrate complex workflows, manage diverse tools via MCP, and integrate semantic search seamlessly. Built for developers and operators who demand reliability, extensibility, and clarity in their AI operations.
|
|
6
6
|
|
|
7
|
-
**[Documentation](https://
|
|
7
|
+
**[Documentation](https://agentorcha.com)** | **[NPM Package](https://www.npmjs.com/package/agent-orcha)** | **[Docker Hub](https://hub.docker.com/r/ddalcu/agent-orcha)**
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
docker run -p 3000:3000 -v ./my-workspace:/data -e AUTH_PASSWORD=your-secret-password ddalcu/agent-orcha start
|
|
11
|
+
```
|
|
8
12
|
|
|
9
13
|
## Why Agent Orcha?
|
|
10
14
|
|
|
11
|
-
- **Declarative AI**: Define agents, workflows, and infrastructure in clear, version-controlled YAML files
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
16
|
-
- **
|
|
17
|
-
- **
|
|
18
|
-
- **
|
|
19
|
-
- **
|
|
20
|
-
- **Extensible Functions**: Drop in simple JavaScript functions to extend agent capabilities with zero boilerplate
|
|
15
|
+
- **Declarative AI**: Define agents, workflows, and infrastructure in clear, version-controlled YAML files
|
|
16
|
+
- **Published Agents**: Share agents via standalone chat pages at `/chat/<name>` with optional per-agent password protection
|
|
17
|
+
- **Model Agnostic**: Seamlessly swap between OpenAI, Gemini, Anthropic, or local LLMs (Ollama, LM Studio) without rewriting logic
|
|
18
|
+
- **Universal Tooling**: Leverage the **Model Context Protocol (MCP)** to connect agents to any external service, API, or database
|
|
19
|
+
- **Knowledge Stores**: Built-in SQLite-based vector store with optional **direct mapping** for knowledge graphs — semantic search and graph analysis as a first-class citizen
|
|
20
|
+
- **Robust Workflow Engine**: Orchestrate complex multi-agent sequences with parallel execution, conditional logic, and state management — or use **ReAct** for autonomous prompt-driven workflows
|
|
21
|
+
- **Conversation Memory**: Built-in session-based memory for multi-turn dialogues with automatic message management and TTL cleanup
|
|
22
|
+
- **Browser Sandbox**: Full Chromium browser with CDP control, Xvfb, and noVNC — plus an experimental **Vision Browser** for pixel-coordinate control with vision LLMs
|
|
23
|
+
- **Security**: Rate limiting on auth endpoints, SSRF protection, SQL injection hardening, sandboxed execution
|
|
24
|
+
- **Extensible Functions**: Drop in simple JavaScript functions to extend agent capabilities with zero boilerplate
|
|
21
25
|
|
|
22
|
-
##
|
|
26
|
+
## Agent Orcha Studio
|
|
27
|
+
|
|
28
|
+
Built-in web dashboard at `http://localhost:3000` with agent testing, knowledge browsing, workflow execution, real-time monitoring, and an in-browser IDE with visual agent composer.
|
|
29
|
+
|
|
30
|
+
<p align="center">
|
|
31
|
+
<img src="docs/assets/images/screenshots/0.0.7-chat.png" alt="Agent Orcha Studio — Chat" width="100%" />
|
|
32
|
+
</p>
|
|
23
33
|
|
|
24
|
-
|
|
34
|
+
<p align="center">
|
|
35
|
+
<img src="docs/assets/images/screenshots/0.0.7-agentedit.png" alt="Agent Orcha Studio — Visual Agent Composer" width="100%" />
|
|
36
|
+
</p>
|
|
25
37
|
|
|
26
|
-
- **
|
|
27
|
-
- **
|
|
28
|
-
- **
|
|
29
|
-
- **
|
|
30
|
-
- **
|
|
31
|
-
- **
|
|
38
|
+
- **Agents** — Browse, invoke, stream responses, manage sessions
|
|
39
|
+
- **Knowledge** — Browse, search, view entities and graph structure
|
|
40
|
+
- **MCP** — Browse servers, view and call tools
|
|
41
|
+
- **Workflows** — Execute step-based and ReAct workflows with streaming
|
|
42
|
+
- **Skills** — Browse and inspect skills
|
|
43
|
+
- **Monitor** — Real-time LLM call logs, ReAct loop metrics, and activity feed
|
|
44
|
+
- **IDE** — File editor with syntax highlighting, hot-reload, and **visual agent composer** for `.agent.yaml` files
|
|
32
45
|
|
|
33
46
|
## Architecture
|
|
34
47
|
|
|
@@ -36,238 +49,66 @@ Agent Orcha enables you to:
|
|
|
36
49
|
<img src="docs/architecture.svg" alt="Agent Orcha Architecture" width="100%" />
|
|
37
50
|
</p>
|
|
38
51
|
|
|
39
|
-
###
|
|
40
|
-
|
|
41
|
-
**This project is currently in ALPHA state.** This software should **ALWAYS** be deployed behind a firewall without open access to its APIs. It is designed for **internal use only** and should never be exposed directly to the public internet.
|
|
42
|
-
|
|
43
|
-
Agent Orcha includes a simple password-based authentication gate. Set the `AUTH_PASSWORD` environment variable to require a password for all API access and the Studio UI. When unset, no authentication is required (suitable for local development).
|
|
52
|
+
### Knowledge Layer
|
|
44
53
|
|
|
54
|
+
<p align="center">
|
|
55
|
+
<img src="docs/knowledge-architecture.svg" alt="Agent Orcha Knowledge Architecture" width="100%" />
|
|
56
|
+
</p>
|
|
45
57
|
|
|
46
58
|
## Usage
|
|
47
59
|
|
|
48
|
-
Agent Orcha can be used in multiple ways
|
|
60
|
+
Agent Orcha can be used in multiple ways:
|
|
49
61
|
|
|
50
|
-
1. **
|
|
51
|
-
2. **
|
|
52
|
-
3. **
|
|
53
|
-
4. **Library**
|
|
54
|
-
5. **Source** - Clone and run directly from source for development or customization
|
|
55
|
-
|
|
56
|
-
**Requirements:** Node.js >= 24.0.0 (or Docker for containerized deployment)
|
|
62
|
+
1. **Docker Image** — Official image at [ddalcu/agent-orcha](https://hub.docker.com/r/ddalcu/agent-orcha)
|
|
63
|
+
2. **CLI Tool** — `npx agent-orcha` to initialize and run projects
|
|
64
|
+
3. **Backend API Server** — REST API for your existing frontends
|
|
65
|
+
4. **Library** — Import programmatically in TypeScript/JavaScript
|
|
57
66
|
|
|
67
|
+
**Requirements:** Node.js >= 24.0.0 (or Docker)
|
|
58
68
|
|
|
59
69
|
## Quick Start
|
|
60
70
|
|
|
61
|
-
###
|
|
71
|
+
### Docker
|
|
62
72
|
|
|
63
|
-
1. **Initialize a project:**
|
|
64
73
|
```bash
|
|
65
|
-
|
|
66
|
-
cd my-project
|
|
74
|
+
docker run -p 3000:3000 -e AUTH_PASSWORD=mypass -v ./my-project:/data ddalcu/agent-orcha
|
|
67
75
|
```
|
|
68
76
|
|
|
69
|
-
|
|
70
|
-
```json
|
|
71
|
-
{
|
|
72
|
-
"version": "1.0",
|
|
73
|
-
"models": {
|
|
74
|
-
"default": {
|
|
75
|
-
"provider": "openai",
|
|
76
|
-
"baseUrl": "http://localhost:1234/v1",
|
|
77
|
-
"apiKey": "not-needed",
|
|
78
|
-
"model": "your-model-name",
|
|
79
|
-
"temperature": 0.7
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
"embeddings": {
|
|
83
|
-
"default": {
|
|
84
|
-
"provider": "openai",
|
|
85
|
-
"baseUrl": "http://localhost:1234/v1",
|
|
86
|
-
"apiKey": "not-needed",
|
|
87
|
-
"model": "text-embedding-model"
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
3. **Start the server:**
|
|
94
|
-
```bash
|
|
95
|
-
npx agent-orcha start
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
4. **Test your agent:**
|
|
99
|
-
```bash
|
|
100
|
-
curl -X POST http://localhost:3000/api/agents/example/invoke \
|
|
101
|
-
-H "Content-Type: application/json" \
|
|
102
|
-
-d '{"input": {"query": "Hello, how are you?"}}'
|
|
103
|
-
```
|
|
77
|
+
An empty workspace is automatically scaffolded with example agents, workflows, and configurations.
|
|
104
78
|
|
|
105
|
-
###
|
|
79
|
+
### CLI
|
|
106
80
|
|
|
107
|
-
Run Agent Orcha using the official Docker image:
|
|
108
|
-
|
|
109
|
-
1. **Initialize a project:**
|
|
110
81
|
```bash
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
2. **Start the server:**
|
|
115
|
-
```bash
|
|
116
|
-
docker run -p 3000:3000 -v ./my-agent-orcha-project:/data ddalcu/agent-orcha start
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
3. **Or use Docker Compose:**
|
|
120
|
-
```yaml
|
|
121
|
-
version: '3.8'
|
|
122
|
-
|
|
123
|
-
services:
|
|
124
|
-
agent-orcha:
|
|
125
|
-
image: ddalcu/agent-orcha
|
|
126
|
-
ports:
|
|
127
|
-
- "3000:3000"
|
|
128
|
-
volumes:
|
|
129
|
-
- ./my-agent-orcha-project:/data
|
|
130
|
-
environment:
|
|
131
|
-
- WORKSPACE=/data
|
|
132
|
-
- AUTH_PASSWORD=your-secret-password # Optional
|
|
133
|
-
```
|
|
82
|
+
# Initialize a project
|
|
83
|
+
npx agent-orcha init my-project
|
|
84
|
+
cd my-project
|
|
134
85
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
docker-compose up
|
|
86
|
+
# Start the server
|
|
87
|
+
npx agent-orcha start
|
|
138
88
|
```
|
|
139
89
|
|
|
140
|
-
See the [Docker Hub page](https://hub.docker.com/r/ddalcu/agent-orcha) for more details and available tags.
|
|
141
90
|
|
|
142
|
-
### Library
|
|
91
|
+
### Library
|
|
143
92
|
|
|
144
93
|
```typescript
|
|
145
94
|
import { Orchestrator } from 'agent-orcha';
|
|
146
95
|
|
|
147
|
-
const orchestrator = new Orchestrator({
|
|
148
|
-
workspaceRoot: './my-agents-project'
|
|
149
|
-
});
|
|
150
|
-
|
|
96
|
+
const orchestrator = new Orchestrator({ workspaceRoot: './my-project' });
|
|
151
97
|
await orchestrator.initialize();
|
|
152
98
|
|
|
153
|
-
// Invoke an agent
|
|
154
99
|
const result = await orchestrator.agents.invoke('researcher', {
|
|
155
|
-
topic: 'machine learning'
|
|
156
|
-
context: 'brief overview'
|
|
100
|
+
topic: 'machine learning'
|
|
157
101
|
});
|
|
158
102
|
|
|
159
103
|
console.log(result.output);
|
|
160
|
-
|
|
161
|
-
// Run a workflow
|
|
162
|
-
const workflowResult = await orchestrator.workflows.run('research-paper', {
|
|
163
|
-
topic: 'artificial intelligence'
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
console.log(workflowResult.output);
|
|
167
|
-
|
|
168
|
-
// Search a knowledge store
|
|
169
|
-
const searchResults = await orchestrator.knowledge.search('docs', {
|
|
170
|
-
query: 'how does authentication work',
|
|
171
|
-
k: 4
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
// Run agent with conversation memory
|
|
175
|
-
const memoryResult = await orchestrator.runAgent(
|
|
176
|
-
'chatbot',
|
|
177
|
-
{ message: 'Hello' },
|
|
178
|
-
'session-123' // sessionId
|
|
179
|
-
);
|
|
180
|
-
|
|
181
|
-
// Clean up
|
|
182
104
|
await orchestrator.close();
|
|
183
105
|
```
|
|
184
106
|
|
|
185
|
-
### Backend API Server Usage
|
|
186
|
-
|
|
187
|
-
Run Agent Orcha as a backend API server for your existing applications or frontends:
|
|
188
|
-
|
|
189
|
-
```bash
|
|
190
|
-
# Start the server (defaults to port 3000)
|
|
191
|
-
npx agent-orcha start
|
|
192
|
-
|
|
193
|
-
# Or specify a custom port
|
|
194
|
-
PORT=8080 npx agent-orcha start
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
Agent Orcha exposes a complete REST API that your frontend can consume:
|
|
198
|
-
|
|
199
|
-
```javascript
|
|
200
|
-
// Example: Invoke an agent from your frontend
|
|
201
|
-
const response = await fetch('http://localhost:3000/api/agents/researcher/invoke', {
|
|
202
|
-
method: 'POST',
|
|
203
|
-
headers: { 'Content-Type': 'application/json' },
|
|
204
|
-
body: JSON.stringify({
|
|
205
|
-
input: { topic: 'AI trends' },
|
|
206
|
-
sessionId: 'user-session-123' // Optional for conversation memory
|
|
207
|
-
})
|
|
208
|
-
});
|
|
209
|
-
|
|
210
|
-
const result = await response.json();
|
|
211
|
-
console.log(result.output);
|
|
212
|
-
|
|
213
|
-
// Example: Search a knowledge store
|
|
214
|
-
const searchResponse = await fetch('http://localhost:3000/api/knowledge/docs/search', {
|
|
215
|
-
method: 'POST',
|
|
216
|
-
headers: { 'Content-Type': 'application/json' },
|
|
217
|
-
body: JSON.stringify({
|
|
218
|
-
query: 'authentication best practices',
|
|
219
|
-
k: 5
|
|
220
|
-
})
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
const searchResults = await searchResponse.json();
|
|
224
|
-
|
|
225
|
-
// Example: Stream agent responses (SSE)
|
|
226
|
-
const eventSource = new EventSource(
|
|
227
|
-
'http://localhost:3000/api/agents/chatbot/stream?' +
|
|
228
|
-
new URLSearchParams({
|
|
229
|
-
input: JSON.stringify({ message: 'Hello!' }),
|
|
230
|
-
sessionId: 'user-123'
|
|
231
|
-
})
|
|
232
|
-
);
|
|
233
|
-
|
|
234
|
-
eventSource.onmessage = (event) => {
|
|
235
|
-
const data = JSON.parse(event.data);
|
|
236
|
-
console.log(data.chunk); // Streaming response chunk
|
|
237
|
-
};
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
**CORS Configuration:**
|
|
241
|
-
For production deployments, configure CORS in your server startup or use a reverse proxy (nginx, Caddy, etc.) to handle CORS headers.
|
|
242
|
-
|
|
243
|
-
**Authentication:**
|
|
244
|
-
Set the `AUTH_PASSWORD` environment variable to enable password authentication for all API routes. The Studio UI will prompt for the password on access. When unset, all routes are open (suitable for local development behind a firewall).
|
|
245
|
-
|
|
246
|
-
## CLI Commands
|
|
247
|
-
|
|
248
|
-
| Command | Description |
|
|
249
|
-
|---------|-------------|
|
|
250
|
-
| `npx agent-orcha init [dir]` | Initialize a new project with example configs |
|
|
251
|
-
| `npx agent-orcha start` | Start the agent orchestrator server |
|
|
252
|
-
| `npx agent-orcha help` | Show help information |
|
|
253
|
-
|
|
254
|
-
## Development Scripts
|
|
255
|
-
|
|
256
|
-
For development on the agent-orcha framework itself:
|
|
257
|
-
|
|
258
|
-
| Command | Description |
|
|
259
|
-
|---------|-------------|
|
|
260
|
-
| `npm run dev` | Start development server with auto-reload |
|
|
261
|
-
| `npm run build` | Build |
|
|
262
|
-
| `npm start` | Run build |
|
|
263
|
-
| `npm run lint` | Run ESLint |
|
|
264
|
-
| `npm run typecheck` | Run TypeScript type checking |
|
|
265
|
-
|
|
266
107
|
## Configuration
|
|
267
108
|
|
|
268
109
|
### LLM Configuration (llm.json)
|
|
269
110
|
|
|
270
|
-
All LLM and embedding
|
|
111
|
+
All LLM and embedding configs are defined in `llm.json`. Agents and knowledge stores reference these by name.
|
|
271
112
|
|
|
272
113
|
```json
|
|
273
114
|
{
|
|
@@ -275,170 +116,56 @@ All LLM and embedding configurations are defined in `llm.json` at the project ro
|
|
|
275
116
|
"models": {
|
|
276
117
|
"default": {
|
|
277
118
|
"baseUrl": "http://localhost:1234/v1",
|
|
278
|
-
"apiKey": "
|
|
119
|
+
"apiKey": "${OPENAI_API_KEY}",
|
|
279
120
|
"model": "qwen/qwen3-4b-2507",
|
|
280
|
-
"temperature": 0.7
|
|
281
|
-
|
|
282
|
-
"openai": {
|
|
283
|
-
"apiKey": "sk-your-openai-key",
|
|
284
|
-
"model": "gpt-4o",
|
|
285
|
-
"temperature": 0.7
|
|
121
|
+
"temperature": 0.7,
|
|
122
|
+
"thinkingBudget": 10000
|
|
286
123
|
}
|
|
287
124
|
},
|
|
288
125
|
"embeddings": {
|
|
289
126
|
"default": {
|
|
290
127
|
"baseUrl": "http://localhost:1234/v1",
|
|
291
|
-
"apiKey": "
|
|
128
|
+
"apiKey": "${OPENAI_API_KEY}",
|
|
292
129
|
"model": "text-embedding-nomic-embed-text-v1.5",
|
|
293
130
|
"eosToken": " "
|
|
294
|
-
},
|
|
295
|
-
"openai": {
|
|
296
|
-
"apiKey": "sk-your-openai-key",
|
|
297
|
-
"model": "text-embedding-3-small",
|
|
298
|
-
"dimensions": 1536
|
|
299
|
-
},
|
|
300
|
-
"gemini": {
|
|
301
|
-
"apiKey": "sk-your-gemini-key",
|
|
302
|
-
"model": "text-embedding-004"
|
|
303
131
|
}
|
|
304
132
|
}
|
|
305
133
|
}
|
|
306
134
|
```
|
|
307
135
|
|
|
308
136
|
All providers are treated as OpenAI-compatible APIs. For local inference:
|
|
309
|
-
- **LM Studio**:
|
|
310
|
-
- **Ollama**:
|
|
311
|
-
- **OpenAI**: Omit `baseUrl` (uses default
|
|
312
|
-
|
|
313
|
-
#### Embedding Configuration Options
|
|
314
|
-
|
|
315
|
-
Embedding configurations support the following options:
|
|
316
|
-
|
|
317
|
-
- **model** (required): The embedding model name
|
|
318
|
-
- **apiKey** (required): API key for the embedding service
|
|
319
|
-
- **baseUrl** (optional): Custom API endpoint URL for local or alternative services
|
|
320
|
-
- **provider** (optional): Provider type (openai, gemini, local). Auto-detected if omitted
|
|
321
|
-
- **dimensions** (optional): Output embedding dimensions (e.g., 1536 for OpenAI text-embedding-3-small)
|
|
322
|
-
- **eosToken** (optional): Token to append to all text inputs (e.g., " " for Nomic models to avoid SEP warnings)
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
**Example configurations:**
|
|
326
|
-
|
|
327
|
-
```json
|
|
328
|
-
{
|
|
329
|
-
"embeddings": {
|
|
330
|
-
"nomic-local": {
|
|
331
|
-
"baseUrl": "http://localhost:1234/v1",
|
|
332
|
-
"apiKey": "not-needed",
|
|
333
|
-
"model": "text-embedding-nomic-embed-text-v1.5",
|
|
334
|
-
"eosToken": " "
|
|
335
|
-
},
|
|
336
|
-
"openai-small": {
|
|
337
|
-
"apiKey": "sk-your-key",
|
|
338
|
-
"model": "text-embedding-3-small",
|
|
339
|
-
"dimensions": 1536
|
|
340
|
-
},
|
|
341
|
-
"openai-large": {
|
|
342
|
-
"apiKey": "sk-your-key",
|
|
343
|
-
"model": "text-embedding-3-large",
|
|
344
|
-
"dimensions": 3072
|
|
345
|
-
},
|
|
346
|
-
"gemini": {
|
|
347
|
-
"apiKey": "sk-your-key",
|
|
348
|
-
"model": "text-embedding-004"
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
```
|
|
137
|
+
- **LM Studio**: `baseUrl: "http://localhost:1234/v1"`
|
|
138
|
+
- **Ollama**: `baseUrl: "http://localhost:11434/v1"`
|
|
139
|
+
- **OpenAI**: Omit `baseUrl` (uses default endpoint)
|
|
353
140
|
|
|
354
|
-
### Environment Variables
|
|
141
|
+
### Environment Variables
|
|
355
142
|
|
|
356
143
|
```bash
|
|
357
|
-
# Server
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
#
|
|
362
|
-
WORKSPACE=/path/to/project
|
|
363
|
-
|
|
364
|
-
# Authentication (optional — when set, all API routes and Studio require this password)
|
|
365
|
-
AUTH_PASSWORD=your-secret-password
|
|
144
|
+
PORT=3000 # Server port
|
|
145
|
+
HOST=0.0.0.0 # Server host
|
|
146
|
+
WORKSPACE=/path/to/project # Base directory for config files
|
|
147
|
+
AUTH_PASSWORD=your-secret-password # Password auth for all API routes and Studio
|
|
148
|
+
CORS_ORIGIN=https://your-frontend.com # Cross-origin policy (default: same-origin)
|
|
366
149
|
```
|
|
367
150
|
|
|
368
151
|
## Agents
|
|
369
152
|
|
|
370
|
-
Agents are AI-powered units
|
|
371
|
-
|
|
372
|
-
### Agent Schema
|
|
373
|
-
|
|
374
|
-
```yaml
|
|
375
|
-
# agents/<name>.agent.yaml
|
|
376
|
-
|
|
377
|
-
name: string # Unique identifier (required)
|
|
378
|
-
description: string # Human-readable description (required)
|
|
379
|
-
version: string # Semantic version (default: "1.0.0")
|
|
380
|
-
|
|
381
|
-
llm: string | object # Reference to LLM config in llm.json
|
|
382
|
-
# Simple: llm: default
|
|
383
|
-
# With override: llm: { name: default, temperature: 0.3 }
|
|
384
|
-
|
|
385
|
-
prompt: # Prompt configuration (required)
|
|
386
|
-
system: string # System message/instructions
|
|
387
|
-
inputVariables: [string] # Variables to interpolate in the prompt
|
|
388
|
-
|
|
389
|
-
tools: # Tools available to agent (optional)
|
|
390
|
-
- mcp:<server-name> # MCP server tools
|
|
391
|
-
- knowledge:<store-name> # Knowledge store search
|
|
392
|
-
- function:<function-name> # Custom function
|
|
393
|
-
- builtin:<tool-name> # Built-in tools
|
|
394
|
-
|
|
395
|
-
output: # Output formatting (optional)
|
|
396
|
-
format: text | json | structured
|
|
397
|
-
schema: # Required when format is "structured"
|
|
398
|
-
type: object
|
|
399
|
-
properties: { ... }
|
|
400
|
-
required: [string]
|
|
401
|
-
|
|
402
|
-
skills: # Skills to attach (optional)
|
|
403
|
-
- skill-name # Specific skills by name
|
|
404
|
-
# Or: { mode: all } # Attach all available skills
|
|
405
|
-
|
|
406
|
-
memory: boolean # Enable persistent memory (optional)
|
|
407
|
-
|
|
408
|
-
integrations: # External integrations (optional)
|
|
409
|
-
- integration-name
|
|
410
|
-
|
|
411
|
-
triggers: # Cron or webhook triggers (optional)
|
|
412
|
-
- type: cron
|
|
413
|
-
schedule: "0 * * * *"
|
|
414
|
-
- type: webhook
|
|
415
|
-
|
|
416
|
-
metadata: # Custom metadata (optional)
|
|
417
|
-
category: string
|
|
418
|
-
tags: [string]
|
|
419
|
-
```
|
|
420
|
-
|
|
421
|
-
### Example Agent
|
|
153
|
+
Agents are AI-powered units defined in YAML within the `agents/` directory.
|
|
422
154
|
|
|
423
155
|
```yaml
|
|
424
156
|
# agents/researcher.agent.yaml
|
|
425
|
-
|
|
426
157
|
name: researcher
|
|
427
158
|
description: Researches topics using web fetch and knowledge search
|
|
428
159
|
version: "1.0.0"
|
|
429
160
|
|
|
430
161
|
llm:
|
|
431
162
|
name: default
|
|
432
|
-
temperature: 0.5
|
|
163
|
+
temperature: 0.5
|
|
433
164
|
|
|
434
165
|
prompt:
|
|
435
166
|
system: |
|
|
436
|
-
You are a thorough researcher.
|
|
437
|
-
|
|
438
|
-
2. Fetch additional information from the web
|
|
439
|
-
3. Synthesize findings into a comprehensive report
|
|
440
|
-
|
|
441
|
-
Use the available tools to gather information before responding.
|
|
167
|
+
You are a thorough researcher. Search knowledge bases,
|
|
168
|
+
fetch web information, and synthesize findings.
|
|
442
169
|
inputVariables:
|
|
443
170
|
- topic
|
|
444
171
|
- context
|
|
@@ -450,116 +177,45 @@ tools:
|
|
|
450
177
|
output:
|
|
451
178
|
format: text
|
|
452
179
|
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
180
|
+
maxIterations: 50 # Override default iteration limit (optional)
|
|
181
|
+
memory: true # Enable persistent memory (optional)
|
|
182
|
+
skills: # Skills to attach (optional)
|
|
183
|
+
- skill-name
|
|
184
|
+
publish: true # Standalone chat at /chat/researcher (optional)
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Agent Schema Reference
|
|
188
|
+
|
|
189
|
+
| Field | Description |
|
|
190
|
+
|-------|-------------|
|
|
191
|
+
| `name` | Unique identifier (required) |
|
|
192
|
+
| `description` | Human-readable description (required) |
|
|
193
|
+
| `version` | Semantic version (default: "1.0.0") |
|
|
194
|
+
| `llm` | LLM config reference — string or `{ name, temperature }` |
|
|
195
|
+
| `prompt.system` | System message/instructions |
|
|
196
|
+
| `prompt.inputVariables` | Variables to interpolate in the prompt |
|
|
197
|
+
| `tools` | Tool references: `mcp:`, `knowledge:`, `function:`, `builtin:`, `sandbox:`, `project:` |
|
|
198
|
+
| `output.format` | `text` or `structured` |
|
|
199
|
+
| `output.schema` | JSON Schema (required when format is `structured`) |
|
|
200
|
+
| `maxIterations` | Override default 200 iteration limit |
|
|
201
|
+
| `skills` | Skills to attach (list or `{ mode: all }`) |
|
|
202
|
+
| `memory` | Enable persistent memory |
|
|
203
|
+
| `integrations` | External integrations (collabnook, email) |
|
|
204
|
+
| `triggers` | Cron or webhook triggers |
|
|
205
|
+
| `publish` | Standalone chat page (`true` or `{ enabled, password }`) |
|
|
457
206
|
|
|
458
207
|
### Conversation Memory
|
|
459
208
|
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
**Features:**
|
|
463
|
-
- In-memory session storage with custom message types
|
|
464
|
-
- Automatic FIFO message limit (default: 50 messages per session)
|
|
465
|
-
- Optional TTL-based session cleanup (default: 1 hour)
|
|
466
|
-
- Backward compatible (sessionId is optional)
|
|
467
|
-
|
|
468
|
-
**API Usage:**
|
|
469
|
-
|
|
470
|
-
```bash
|
|
471
|
-
# First message
|
|
472
|
-
curl -X POST http://localhost:3000/api/agents/chatbot-memory/invoke \
|
|
473
|
-
-H "Content-Type: application/json" \
|
|
474
|
-
-d '{
|
|
475
|
-
"input": {"message": "My name is Alice"},
|
|
476
|
-
"sessionId": "user-123"
|
|
477
|
-
}'
|
|
478
|
-
|
|
479
|
-
# Second message (agent remembers the name)
|
|
480
|
-
curl -X POST http://localhost:3000/api/agents/chatbot-memory/invoke \
|
|
481
|
-
-H "Content-Type: application/json" \
|
|
482
|
-
-d '{
|
|
483
|
-
"input": {"message": "What is my name?"},
|
|
484
|
-
"sessionId": "user-123"
|
|
485
|
-
}'
|
|
486
|
-
```
|
|
487
|
-
|
|
488
|
-
**Library Usage:**
|
|
209
|
+
Pass a `sessionId` to maintain context across interactions:
|
|
489
210
|
|
|
490
211
|
```typescript
|
|
491
|
-
|
|
492
|
-
const
|
|
493
|
-
'chatbot-memory',
|
|
494
|
-
{ message: 'My name is Alice' },
|
|
495
|
-
'user-123' // sessionId
|
|
496
|
-
);
|
|
497
|
-
|
|
498
|
-
const result2 = await orchestrator.runAgent(
|
|
499
|
-
'chatbot-memory',
|
|
500
|
-
{ message: 'What is my name?' },
|
|
501
|
-
'user-123' // Same sessionId maintains context
|
|
502
|
-
);
|
|
503
|
-
```
|
|
504
|
-
|
|
505
|
-
**Session Management API:**
|
|
506
|
-
|
|
507
|
-
```bash
|
|
508
|
-
# Get session stats
|
|
509
|
-
curl http://localhost:3000/api/agents/sessions/stats
|
|
510
|
-
|
|
511
|
-
# Get session info
|
|
512
|
-
curl http://localhost:3000/api/agents/sessions/user-123
|
|
513
|
-
|
|
514
|
-
# Clear session
|
|
515
|
-
curl -X DELETE http://localhost:3000/api/agents/sessions/user-123
|
|
516
|
-
```
|
|
517
|
-
|
|
518
|
-
**Memory Management (Programmatic):**
|
|
519
|
-
|
|
520
|
-
```typescript
|
|
521
|
-
// Access memory store
|
|
522
|
-
const memory = orchestrator.memory;
|
|
523
|
-
|
|
524
|
-
// Check if session exists
|
|
525
|
-
const hasSession = memory.hasSession('user-123');
|
|
526
|
-
|
|
527
|
-
// Get message count
|
|
528
|
-
const count = memory.getMessageCount('user-123');
|
|
529
|
-
|
|
530
|
-
// Clear a session
|
|
531
|
-
memory.clearSession('user-123');
|
|
532
|
-
|
|
533
|
-
// Get total sessions
|
|
534
|
-
const totalSessions = memory.getSessionCount();
|
|
212
|
+
const result = await orchestrator.runAgent('chatbot', { message: 'My name is Alice' }, 'session-123');
|
|
213
|
+
const result2 = await orchestrator.runAgent('chatbot', { message: 'What is my name?' }, 'session-123');
|
|
535
214
|
```
|
|
536
215
|
|
|
537
216
|
### Structured Output
|
|
538
217
|
|
|
539
|
-
Agents can return validated, structured JSON output by specifying an `output.schema` configuration. This ensures responses match your desired format with automatic validation.
|
|
540
|
-
|
|
541
|
-
**Features:**
|
|
542
|
-
- JSON Schema-based output validation
|
|
543
|
-
- Type-safe structured responses
|
|
544
|
-
- Automatic schema enforcement via LLM
|
|
545
|
-
- Validation metadata in response
|
|
546
|
-
|
|
547
|
-
**Example Agent Configuration:**
|
|
548
|
-
|
|
549
218
|
```yaml
|
|
550
|
-
# agents/sentiment-structured.agent.yaml
|
|
551
|
-
|
|
552
|
-
name: sentiment-structured
|
|
553
|
-
description: Sentiment analysis with structured output
|
|
554
|
-
llm:
|
|
555
|
-
name: default
|
|
556
|
-
temperature: 0
|
|
557
|
-
prompt:
|
|
558
|
-
system: |
|
|
559
|
-
Analyze the sentiment of the provided text and return a structured response.
|
|
560
|
-
Provide both the sentiment category and a confidence score.
|
|
561
|
-
inputVariables:
|
|
562
|
-
- text
|
|
563
219
|
output:
|
|
564
220
|
format: structured
|
|
565
221
|
schema:
|
|
@@ -568,248 +224,51 @@ output:
|
|
|
568
224
|
sentiment:
|
|
569
225
|
type: string
|
|
570
226
|
enum: [positive, negative, neutral]
|
|
571
|
-
description: The overall sentiment
|
|
572
227
|
confidence:
|
|
573
228
|
type: number
|
|
574
|
-
|
|
575
|
-
maximum: 1
|
|
576
|
-
description: Confidence score
|
|
577
|
-
keywords:
|
|
578
|
-
type: array
|
|
579
|
-
items:
|
|
580
|
-
type: string
|
|
581
|
-
description: Key sentiment-driving words
|
|
582
|
-
required:
|
|
583
|
-
- sentiment
|
|
584
|
-
- confidence
|
|
585
|
-
```
|
|
586
|
-
|
|
587
|
-
**API Usage:**
|
|
588
|
-
|
|
589
|
-
```bash
|
|
590
|
-
curl -X POST http://localhost:3000/api/agents/sentiment-structured/invoke \
|
|
591
|
-
-H "Content-Type: application/json" \
|
|
592
|
-
-d '{
|
|
593
|
-
"input": {"text": "I love this product! It works great!"}
|
|
594
|
-
}'
|
|
595
|
-
```
|
|
596
|
-
|
|
597
|
-
**Response:**
|
|
598
|
-
|
|
599
|
-
```json
|
|
600
|
-
{
|
|
601
|
-
"output": {
|
|
602
|
-
"sentiment": "positive",
|
|
603
|
-
"confidence": 0.95,
|
|
604
|
-
"keywords": ["love", "great"]
|
|
605
|
-
},
|
|
606
|
-
"metadata": {
|
|
607
|
-
"duration": 1234,
|
|
608
|
-
"structuredOutputValid": true
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
```
|
|
612
|
-
|
|
613
|
-
**Library Usage:**
|
|
614
|
-
|
|
615
|
-
```typescript
|
|
616
|
-
const result = await orchestrator.runAgent('sentiment-structured', {
|
|
617
|
-
text: 'This is amazing!'
|
|
618
|
-
});
|
|
619
|
-
|
|
620
|
-
// result.output is a typed object
|
|
621
|
-
console.log(result.output.sentiment); // "positive"
|
|
622
|
-
console.log(result.output.confidence); // 0.95
|
|
623
|
-
console.log(result.metadata.structuredOutputValid); // true
|
|
229
|
+
required: [sentiment, confidence]
|
|
624
230
|
```
|
|
625
231
|
|
|
626
232
|
## Workflows
|
|
627
233
|
|
|
628
|
-
Workflows orchestrate multiple agents
|
|
234
|
+
Workflows orchestrate multiple agents. Two types: **step-based** and **ReAct**.
|
|
629
235
|
|
|
630
|
-
### Step-Based
|
|
236
|
+
### Step-Based
|
|
631
237
|
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
#### Workflow Schema
|
|
238
|
+
Sequential/parallel agent orchestration with explicit step definitions.
|
|
635
239
|
|
|
636
240
|
```yaml
|
|
637
|
-
# workflows/<name>.workflow.yaml
|
|
638
|
-
|
|
639
|
-
name: string # Unique identifier (required)
|
|
640
|
-
description: string # Human-readable description (required)
|
|
641
|
-
version: string # Semantic version (default: "1.0.0")
|
|
642
|
-
type: steps # Optional (steps is default)
|
|
643
|
-
|
|
644
|
-
input: # Input schema (required)
|
|
645
|
-
schema:
|
|
646
|
-
<field_name>:
|
|
647
|
-
type: string | number | boolean | array | object
|
|
648
|
-
required: boolean # (default: false)
|
|
649
|
-
default: any # Default value
|
|
650
|
-
description: string # Field description
|
|
651
|
-
|
|
652
|
-
steps: # Workflow steps (required)
|
|
653
|
-
- id: string # Unique step identifier
|
|
654
|
-
agent: string # Agent name to execute
|
|
655
|
-
input: # Input mapping using templates
|
|
656
|
-
<key>: "{{input.field}}" # From workflow input
|
|
657
|
-
<key>: "{{steps.stepId.output}}" # From previous step
|
|
658
|
-
condition: string # Optional conditional execution
|
|
659
|
-
retry: # Optional retry configuration
|
|
660
|
-
maxAttempts: number
|
|
661
|
-
delay: number # Milliseconds
|
|
662
|
-
output:
|
|
663
|
-
key: string # Store output under this key
|
|
664
|
-
|
|
665
|
-
# Parallel execution
|
|
666
|
-
- parallel:
|
|
667
|
-
- id: step1
|
|
668
|
-
agent: agent1
|
|
669
|
-
input: {...}
|
|
670
|
-
- id: step2
|
|
671
|
-
agent: agent2
|
|
672
|
-
input: {...}
|
|
673
|
-
|
|
674
|
-
config: # Workflow configuration (optional)
|
|
675
|
-
timeout: number # Total timeout ms (default: 300000)
|
|
676
|
-
onError: stop | continue | retry
|
|
677
|
-
|
|
678
|
-
output: # Output mapping (required)
|
|
679
|
-
<key>: "{{steps.stepId.output}}"
|
|
680
|
-
|
|
681
|
-
metadata: # Custom metadata (optional)
|
|
682
|
-
category: string
|
|
683
|
-
tags: [string]
|
|
684
|
-
```
|
|
685
|
-
|
|
686
|
-
#### Template Syntax
|
|
687
|
-
|
|
688
|
-
Access data within workflows using double curly braces:
|
|
689
|
-
|
|
690
|
-
| Template | Description |
|
|
691
|
-
|----------|-------------|
|
|
692
|
-
| `{{input.fieldName}}` | Access workflow input field |
|
|
693
|
-
| `{{steps.stepId.output}}` | Access step output |
|
|
694
|
-
| `{{steps.stepId.output.nested.path}}` | Access nested output |
|
|
695
|
-
| `{{steps.stepId.metadata.duration}}` | Access step metadata |
|
|
696
|
-
|
|
697
|
-
#### Example Workflow
|
|
698
|
-
|
|
699
|
-
```yaml
|
|
700
|
-
# workflows/research-paper.workflow.yaml
|
|
701
|
-
|
|
702
241
|
name: research-paper
|
|
703
|
-
description: Research a topic and write a
|
|
704
|
-
|
|
242
|
+
description: Research a topic and write a paper
|
|
243
|
+
type: steps
|
|
705
244
|
|
|
706
245
|
input:
|
|
707
246
|
schema:
|
|
708
247
|
topic:
|
|
709
248
|
type: string
|
|
710
249
|
required: true
|
|
711
|
-
description: The topic to research
|
|
712
|
-
style:
|
|
713
|
-
type: string
|
|
714
|
-
default: "professional"
|
|
715
250
|
|
|
716
251
|
steps:
|
|
717
252
|
- id: research
|
|
718
253
|
agent: researcher
|
|
719
254
|
input:
|
|
720
255
|
topic: "{{input.topic}}"
|
|
721
|
-
context: "Gather comprehensive information"
|
|
722
|
-
output:
|
|
723
|
-
key: researchFindings
|
|
724
|
-
|
|
725
|
-
- id: summarize
|
|
726
|
-
agent: summarizer
|
|
727
|
-
input:
|
|
728
|
-
content: "{{steps.research.output}}"
|
|
729
|
-
maxPoints: "10"
|
|
730
|
-
condition: "{{steps.research.metadata.success}}"
|
|
731
|
-
output:
|
|
732
|
-
key: summary
|
|
733
256
|
|
|
734
257
|
- id: write
|
|
735
258
|
agent: writer
|
|
736
259
|
input:
|
|
737
260
|
research: "{{steps.research.output}}"
|
|
738
|
-
outline: "{{steps.summarize.output}}"
|
|
739
|
-
style: "{{input.style}}"
|
|
740
|
-
output:
|
|
741
|
-
key: paper
|
|
742
|
-
|
|
743
|
-
config:
|
|
744
|
-
timeout: 600000
|
|
745
|
-
onError: stop
|
|
746
261
|
|
|
747
262
|
output:
|
|
748
263
|
paper: "{{steps.write.output}}"
|
|
749
|
-
summary: "{{steps.summarize.output}}"
|
|
750
|
-
researchFindings: "{{steps.research.output}}"
|
|
751
264
|
```
|
|
752
265
|
|
|
753
|
-
### ReAct
|
|
266
|
+
### ReAct
|
|
754
267
|
|
|
755
|
-
Autonomous, prompt-driven workflows
|
|
756
|
-
|
|
757
|
-
#### ReAct Schema
|
|
758
|
-
|
|
759
|
-
```yaml
|
|
760
|
-
# workflows/<name>.workflow.yaml
|
|
761
|
-
|
|
762
|
-
name: string # Unique identifier (required)
|
|
763
|
-
description: string # Human-readable description (required)
|
|
764
|
-
version: string # Semantic version (default: "1.0.0")
|
|
765
|
-
type: react # Required for ReAct workflows
|
|
766
|
-
|
|
767
|
-
input: # Input schema (required)
|
|
768
|
-
schema:
|
|
769
|
-
<field_name>:
|
|
770
|
-
type: string | number | boolean | array | object
|
|
771
|
-
required: boolean
|
|
772
|
-
description: string
|
|
773
|
-
|
|
774
|
-
prompt: # Prompt configuration (required)
|
|
775
|
-
system: string # System message with instructions
|
|
776
|
-
goal: string # Goal template (supports {{input.*}} interpolation)
|
|
777
|
-
|
|
778
|
-
graph: # ReAct configuration (required)
|
|
779
|
-
model: string # LLM config name from llm.json
|
|
780
|
-
executionMode: react | single-turn # Default: react
|
|
781
|
-
tools: # Tool discovery
|
|
782
|
-
mode: all | include | exclude | none
|
|
783
|
-
sources: [mcp, knowledge, function, builtin]
|
|
784
|
-
include: [string] # For mode: include
|
|
785
|
-
exclude: [string] # For mode: exclude
|
|
786
|
-
agents: # Agent discovery
|
|
787
|
-
mode: all | include | exclude | none
|
|
788
|
-
include: [string]
|
|
789
|
-
exclude: [string]
|
|
790
|
-
maxIterations: number # Default: 10
|
|
791
|
-
timeout: number # Default: 300000
|
|
792
|
-
|
|
793
|
-
output: # Output extraction
|
|
794
|
-
<key>: "{{state.messages[-1].content}}"
|
|
795
|
-
|
|
796
|
-
config: # Optional
|
|
797
|
-
onError: stop | continue | retry
|
|
798
|
-
```
|
|
799
|
-
|
|
800
|
-
#### Execution Modes
|
|
801
|
-
|
|
802
|
-
| Mode | Behavior | Best For |
|
|
803
|
-
|------|----------|----------|
|
|
804
|
-
| `single-turn` | Calls tools once, then returns | Research, data gathering, straightforward tasks |
|
|
805
|
-
| `react` | Multiple rounds of tool calls with analysis | Complex problems, iterative refinement |
|
|
806
|
-
|
|
807
|
-
#### Example ReAct Workflow
|
|
268
|
+
Autonomous, prompt-driven workflows. The agent decides which tools and agents to call.
|
|
808
269
|
|
|
809
270
|
```yaml
|
|
810
271
|
name: react-research
|
|
811
|
-
description: Autonomous research using tool discovery
|
|
812
|
-
version: "1.0.0"
|
|
813
272
|
type: react
|
|
814
273
|
|
|
815
274
|
input:
|
|
@@ -822,21 +281,17 @@ prompt:
|
|
|
822
281
|
system: |
|
|
823
282
|
You are a research assistant with access to tools and agents.
|
|
824
283
|
Identify all tools you need, call them in parallel, then synthesize results.
|
|
825
|
-
|
|
826
|
-
If the user hasn't provided required information, use the ask_user tool
|
|
827
|
-
to request it before proceeding.
|
|
828
284
|
goal: "Research and analyze: {{input.topic}}"
|
|
829
285
|
|
|
830
286
|
graph:
|
|
831
287
|
model: default
|
|
832
|
-
executionMode: single-turn
|
|
288
|
+
executionMode: single-turn # or: react (multi-round)
|
|
833
289
|
tools:
|
|
834
290
|
mode: all
|
|
835
291
|
sources: [mcp, knowledge, function, builtin]
|
|
836
292
|
agents:
|
|
837
293
|
mode: all
|
|
838
294
|
maxIterations: 10
|
|
839
|
-
timeout: 300000
|
|
840
295
|
|
|
841
296
|
output:
|
|
842
297
|
analysis: "{{state.messages[-1].content}}"
|
|
@@ -844,66 +299,16 @@ output:
|
|
|
844
299
|
|
|
845
300
|
## Knowledge Stores
|
|
846
301
|
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
Optionally add a `graph.directMapping` section to build a knowledge graph from structured data (typically database sources).
|
|
850
|
-
|
|
851
|
-
### Knowledge Store Schema
|
|
302
|
+
Semantic search and RAG using **SQLite + sqlite-vec** — no external vector databases required. Define in the `knowledge/` directory.
|
|
852
303
|
|
|
853
304
|
```yaml
|
|
854
|
-
# knowledge/<name>.knowledge.yaml
|
|
855
|
-
|
|
856
|
-
name: string # Unique identifier (required)
|
|
857
|
-
description: string # Human-readable description (required)
|
|
858
|
-
|
|
859
|
-
source: # Data source (required)
|
|
860
|
-
type: directory | file | database | web
|
|
861
|
-
|
|
862
|
-
loader: # Document loader (required)
|
|
863
|
-
type: text | pdf | csv | json | markdown
|
|
864
|
-
|
|
865
|
-
splitter: # Text chunking (required)
|
|
866
|
-
type: character | recursive | token | markdown
|
|
867
|
-
chunkSize: number # Characters per chunk (default: 1000)
|
|
868
|
-
chunkOverlap: number # Overlap between chunks (default: 200)
|
|
869
|
-
|
|
870
|
-
embedding: string # Reference to embedding config in llm.json (default: "default")
|
|
871
|
-
|
|
872
|
-
graph: # Optional — enables entity graph
|
|
873
|
-
directMapping: # Maps structured data to entities and relationships
|
|
874
|
-
entities:
|
|
875
|
-
- type: string # Entity type name
|
|
876
|
-
idColumn: string # Column used as unique ID
|
|
877
|
-
nameColumn: string # Column used as display name (optional)
|
|
878
|
-
properties: [string] # Columns to include as entity properties
|
|
879
|
-
relationships: # Optional
|
|
880
|
-
- type: string # Relationship type name
|
|
881
|
-
source: string # Source entity type
|
|
882
|
-
target: string # Target entity type
|
|
883
|
-
sourceIdColumn: string # Column linking to source entity
|
|
884
|
-
targetIdColumn: string # Column linking to target entity
|
|
885
|
-
|
|
886
|
-
search: # Search configuration (optional)
|
|
887
|
-
defaultK: number # Results per search (default: 4)
|
|
888
|
-
scoreThreshold: number # Minimum similarity (0-1)
|
|
889
|
-
```
|
|
890
|
-
|
|
891
|
-
#### Example: Vector-Only Store
|
|
892
|
-
|
|
893
|
-
```yaml
|
|
894
|
-
# knowledge/transcripts.knowledge.yaml
|
|
895
|
-
|
|
896
305
|
name: transcripts
|
|
897
|
-
description: Meeting transcripts
|
|
898
|
-
|
|
306
|
+
description: Meeting transcripts
|
|
899
307
|
source:
|
|
900
308
|
type: directory
|
|
901
309
|
path: knowledge/sample-data
|
|
902
310
|
pattern: "*.txt"
|
|
903
311
|
|
|
904
|
-
loader:
|
|
905
|
-
type: text
|
|
906
|
-
|
|
907
312
|
splitter:
|
|
908
313
|
type: character
|
|
909
314
|
chunkSize: 1000
|
|
@@ -916,36 +321,17 @@ search:
|
|
|
916
321
|
scoreThreshold: 0.2
|
|
917
322
|
```
|
|
918
323
|
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
```yaml
|
|
922
|
-
# knowledge/blog-posts.knowledge.yaml
|
|
324
|
+
### Data Sources
|
|
923
325
|
|
|
924
|
-
|
|
925
|
-
|
|
326
|
+
- **directory/file** — Local files with glob patterns
|
|
327
|
+
- **database** — PostgreSQL/MySQL via SQL queries
|
|
328
|
+
- **web** — HTML scraping, JSON APIs (with `jsonPath`), raw text
|
|
926
329
|
|
|
927
|
-
|
|
928
|
-
type: database
|
|
929
|
-
connectionString: postgresql://user:pass@localhost:5432/blog
|
|
930
|
-
query: |
|
|
931
|
-
SELECT p.id, p.title, p.slug, p.html AS content,
|
|
932
|
-
u.name AS author_name, u.email AS author_email
|
|
933
|
-
FROM posts p
|
|
934
|
-
LEFT JOIN users u ON p.author_id = u.id
|
|
935
|
-
WHERE p.status = 'published'
|
|
936
|
-
contentColumn: content
|
|
937
|
-
metadataColumns: [id, title, slug, author_name, author_email]
|
|
938
|
-
|
|
939
|
-
loader:
|
|
940
|
-
type: text
|
|
330
|
+
### Knowledge Graph (Direct Mapping)
|
|
941
331
|
|
|
942
|
-
|
|
943
|
-
type: recursive
|
|
944
|
-
chunkSize: 2000
|
|
945
|
-
chunkOverlap: 300
|
|
946
|
-
|
|
947
|
-
embedding: default
|
|
332
|
+
Add `graph.directMapping` to build entity graphs from structured data:
|
|
948
333
|
|
|
334
|
+
```yaml
|
|
949
335
|
graph:
|
|
950
336
|
directMapping:
|
|
951
337
|
entities:
|
|
@@ -953,217 +339,44 @@ graph:
|
|
|
953
339
|
idColumn: id
|
|
954
340
|
nameColumn: title
|
|
955
341
|
properties: [title, slug, content]
|
|
956
|
-
|
|
957
342
|
- type: Author
|
|
958
343
|
idColumn: author_email
|
|
959
344
|
nameColumn: author_name
|
|
960
|
-
properties: [author_name, author_email]
|
|
961
|
-
|
|
962
345
|
relationships:
|
|
963
346
|
- type: WROTE
|
|
964
347
|
source: Author
|
|
965
348
|
target: Post
|
|
966
349
|
sourceIdColumn: author_email
|
|
967
350
|
targetIdColumn: id
|
|
968
|
-
|
|
969
|
-
search:
|
|
970
|
-
defaultK: 10
|
|
971
|
-
```
|
|
972
|
-
|
|
973
|
-
**How it works:**
|
|
974
|
-
- All data persists to SQLite at `.knowledge-data/{name}.db`
|
|
975
|
-
- On restart, source hashes are compared — if unchanged, data restores instantly without re-indexing
|
|
976
|
-
- Stores with `graph.directMapping` also store entities and relationships with vector embeddings
|
|
977
|
-
- Agents get additional graph tools (traverse, entity_lookup, graph_schema) when entities exist
|
|
978
|
-
|
|
979
|
-
### Data Source Types
|
|
980
|
-
|
|
981
|
-
#### Directory/File Sources
|
|
982
|
-
```yaml
|
|
983
|
-
source:
|
|
984
|
-
type: directory
|
|
985
|
-
path: knowledge/sample-data
|
|
986
|
-
pattern: "*.txt"
|
|
987
|
-
recursive: true
|
|
988
|
-
```
|
|
989
|
-
|
|
990
|
-
#### Database Sources
|
|
991
|
-
```yaml
|
|
992
|
-
source:
|
|
993
|
-
type: database
|
|
994
|
-
connectionString: postgresql://user:password@localhost:5432/docs_db
|
|
995
|
-
query: SELECT content, title, category FROM documents WHERE published = true
|
|
996
|
-
contentColumn: content
|
|
997
|
-
metadataColumns:
|
|
998
|
-
- title
|
|
999
|
-
- category
|
|
1000
|
-
batchSize: 100
|
|
1001
|
-
```
|
|
1002
|
-
|
|
1003
|
-
#### Web Scraping Sources
|
|
1004
|
-
```yaml
|
|
1005
|
-
source:
|
|
1006
|
-
type: web
|
|
1007
|
-
url: https://docs.example.com/guide/
|
|
1008
|
-
selector: article.documentation
|
|
1009
351
|
```
|
|
1010
352
|
|
|
353
|
+
Stores with entities get additional graph tools: `entity_lookup`, `traverse`, `graph_schema`, `sql`.
|
|
1011
354
|
|
|
1012
355
|
## Functions
|
|
1013
356
|
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
### Function Schema
|
|
1017
|
-
|
|
1018
|
-
Create a file in `functions/` ending with `.function.js`:
|
|
1019
|
-
|
|
1020
|
-
```javascript
|
|
1021
|
-
/**
|
|
1022
|
-
* Function description
|
|
1023
|
-
*/
|
|
1024
|
-
export default {
|
|
1025
|
-
name: 'function-name', // Unique identifier (required)
|
|
1026
|
-
description: 'What it does', // Clear description (required)
|
|
1027
|
-
|
|
1028
|
-
parameters: { // Input parameters (required)
|
|
1029
|
-
param1: {
|
|
1030
|
-
type: 'number', // string | number | boolean | array | object | enum
|
|
1031
|
-
description: 'Parameter description',
|
|
1032
|
-
required: true, // Optional, defaults to true
|
|
1033
|
-
default: 0, // Optional default value
|
|
1034
|
-
},
|
|
1035
|
-
},
|
|
1036
|
-
|
|
1037
|
-
execute: async ({ param1 }) => { // Execution function (required)
|
|
1038
|
-
// Your logic here
|
|
1039
|
-
return `Result: ${param1}`;
|
|
1040
|
-
},
|
|
1041
|
-
};
|
|
1042
|
-
|
|
1043
|
-
// Optional metadata for documentation
|
|
1044
|
-
export const metadata = {
|
|
1045
|
-
name: 'function-name',
|
|
1046
|
-
version: '1.0.0',
|
|
1047
|
-
author: 'Your Name',
|
|
1048
|
-
tags: ['category'],
|
|
1049
|
-
};
|
|
1050
|
-
```
|
|
1051
|
-
|
|
1052
|
-
### Example Function
|
|
357
|
+
Custom JavaScript tools in `functions/`:
|
|
1053
358
|
|
|
1054
359
|
```javascript
|
|
1055
360
|
// functions/fibonacci.function.js
|
|
1056
|
-
|
|
1057
361
|
export default {
|
|
1058
362
|
name: 'fibonacci',
|
|
1059
|
-
description: 'Returns the nth Fibonacci number
|
|
1060
|
-
|
|
363
|
+
description: 'Returns the nth Fibonacci number',
|
|
1061
364
|
parameters: {
|
|
1062
|
-
n: {
|
|
1063
|
-
type: 'number',
|
|
1064
|
-
description: 'The index (0-based, max 100)',
|
|
1065
|
-
},
|
|
365
|
+
n: { type: 'number', description: 'The index (0-based, max 100)' },
|
|
1066
366
|
},
|
|
1067
|
-
|
|
1068
367
|
execute: async ({ n }) => {
|
|
1069
|
-
if (n < 0 || !Number.isInteger(n)) {
|
|
1070
|
-
throw new Error('Index must be a non-negative integer');
|
|
1071
|
-
}
|
|
1072
|
-
if (n > 100) {
|
|
1073
|
-
throw new Error('Index too large (max 100)');
|
|
1074
|
-
}
|
|
1075
|
-
|
|
1076
|
-
if (n === 0) return 'Fibonacci(0) = 0';
|
|
1077
|
-
if (n === 1) return 'Fibonacci(1) = 1';
|
|
1078
|
-
|
|
1079
368
|
let prev = 0, curr = 1;
|
|
1080
|
-
for (let i = 2; i <= n; i++)
|
|
1081
|
-
|
|
1082
|
-
}
|
|
1083
|
-
|
|
1084
|
-
return `Fibonacci(${n}) = ${curr}`;
|
|
369
|
+
for (let i = 2; i <= n; i++) [prev, curr] = [curr, prev + curr];
|
|
370
|
+
return `Fibonacci(${n}) = ${n < 2 ? n : curr}`;
|
|
1085
371
|
},
|
|
1086
372
|
};
|
|
1087
373
|
```
|
|
1088
374
|
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
Reference functions in your agent's tools list with the `function:` prefix:
|
|
1092
|
-
|
|
1093
|
-
```yaml
|
|
1094
|
-
name: math-assistant
|
|
1095
|
-
description: Assistant that can calculate Fibonacci numbers
|
|
1096
|
-
|
|
1097
|
-
llm:
|
|
1098
|
-
name: default
|
|
1099
|
-
temperature: 0.3
|
|
1100
|
-
|
|
1101
|
-
prompt:
|
|
1102
|
-
system: |
|
|
1103
|
-
You are a math assistant. Use the fibonacci tool to calculate
|
|
1104
|
-
Fibonacci numbers when asked.
|
|
1105
|
-
inputVariables:
|
|
1106
|
-
- query
|
|
1107
|
-
|
|
1108
|
-
tools:
|
|
1109
|
-
- function:fibonacci # References fibonacci.function.js
|
|
1110
|
-
|
|
1111
|
-
output:
|
|
1112
|
-
format: text
|
|
1113
|
-
```
|
|
1114
|
-
|
|
1115
|
-
### Parameter Types
|
|
1116
|
-
|
|
1117
|
-
- **string**: Text value
|
|
1118
|
-
- **number**: Numeric value
|
|
1119
|
-
- **boolean**: true/false
|
|
1120
|
-
- **array**: Array of values
|
|
1121
|
-
- **object**: JSON object
|
|
1122
|
-
- **enum**: One of a fixed set (requires `values` array)
|
|
1123
|
-
|
|
1124
|
-
Example enum parameter:
|
|
1125
|
-
```javascript
|
|
1126
|
-
parameters: {
|
|
1127
|
-
operation: {
|
|
1128
|
-
type: 'enum',
|
|
1129
|
-
values: ['add', 'subtract', 'multiply', 'divide'],
|
|
1130
|
-
description: 'Math operation to perform',
|
|
1131
|
-
},
|
|
1132
|
-
}
|
|
1133
|
-
```
|
|
375
|
+
Reference in agents with `function:fibonacci`.
|
|
1134
376
|
|
|
1135
377
|
## MCP Servers
|
|
1136
378
|
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
### MCP Configuration
|
|
1140
|
-
|
|
1141
|
-
```json
|
|
1142
|
-
{
|
|
1143
|
-
"version": "1.0.0",
|
|
1144
|
-
"servers": {
|
|
1145
|
-
"<server-name>": {
|
|
1146
|
-
"transport": "streamable-http | stdio | sse | sse-only",
|
|
1147
|
-
"url": "https://server-url/mcp",
|
|
1148
|
-
"command": "node",
|
|
1149
|
-
"args": ["./mcp-server.js"],
|
|
1150
|
-
"env": { "KEY": "VALUE" },
|
|
1151
|
-
"headers": { "Authorization": "Bearer TOKEN" },
|
|
1152
|
-
"timeout": 30000,
|
|
1153
|
-
"enabled": true,
|
|
1154
|
-
"description": "Server description"
|
|
1155
|
-
}
|
|
1156
|
-
},
|
|
1157
|
-
"globalOptions": {
|
|
1158
|
-
"throwOnLoadError": false,
|
|
1159
|
-
"prefixToolNameWithServerName": true,
|
|
1160
|
-
"additionalToolNamePrefix": "",
|
|
1161
|
-
"defaultToolTimeout": 30000
|
|
1162
|
-
}
|
|
1163
|
-
}
|
|
1164
|
-
```
|
|
1165
|
-
|
|
1166
|
-
### Example MCP Configuration
|
|
379
|
+
Configure in `mcp.json`:
|
|
1167
380
|
|
|
1168
381
|
```json
|
|
1169
382
|
{
|
|
@@ -1171,388 +384,92 @@ Model Context Protocol (MCP) servers provide external tools to agents. Configure
|
|
|
1171
384
|
"servers": {
|
|
1172
385
|
"fetch": {
|
|
1173
386
|
"transport": "streamable-http",
|
|
1174
|
-
"url": "https://remote.mcpservers.org/fetch/mcp"
|
|
1175
|
-
"description": "Web fetch capabilities",
|
|
1176
|
-
"timeout": 30000,
|
|
1177
|
-
"enabled": true
|
|
387
|
+
"url": "https://remote.mcpservers.org/fetch/mcp"
|
|
1178
388
|
},
|
|
1179
389
|
"filesystem": {
|
|
1180
390
|
"transport": "stdio",
|
|
1181
391
|
"command": "npx",
|
|
1182
|
-
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
|
|
1183
|
-
"description": "File system access"
|
|
392
|
+
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
|
|
1184
393
|
}
|
|
1185
394
|
}
|
|
1186
395
|
}
|
|
1187
396
|
```
|
|
1188
397
|
|
|
1189
|
-
Reference
|
|
1190
|
-
```yaml
|
|
1191
|
-
tools:
|
|
1192
|
-
- mcp:fetch # All tools from "fetch" server
|
|
1193
|
-
```
|
|
1194
|
-
|
|
1195
|
-
## Agent Orcha Studio
|
|
1196
|
-
|
|
1197
|
-
Agent Orcha includes a built-in web dashboard accessible at `http://localhost:3000` when the server is running. The Studio provides a visual interface for managing and testing your entire Agent Orcha instance.
|
|
1198
|
-
|
|
1199
|
-
### Tabs
|
|
1200
|
-
|
|
1201
|
-
- **Agents**: Browse all configured agents, invoke them with custom input, stream responses in real-time, and manage conversation sessions
|
|
1202
|
-
- **Knowledge**: Browse and search knowledge stores, view entities and graph structure for stores with direct mapping
|
|
1203
|
-
- **MCP**: Browse MCP servers, view available tools per server, and call tools directly
|
|
1204
|
-
- **Workflows**: Browse and execute workflows (both step-based and ReAct), stream execution progress
|
|
1205
|
-
- **Skills**: Browse and inspect available skills
|
|
1206
|
-
- **Monitor**: View LLM call logs with context size, token estimates, and duration metrics
|
|
1207
|
-
- **IDE**: Full in-browser file editor with file tree navigation, syntax highlighting for YAML, JSON, and JavaScript, and hot-reload on save
|
|
1208
|
-
|
|
1209
|
-
## API Reference
|
|
1210
|
-
|
|
1211
|
-
### Health Check
|
|
1212
|
-
|
|
1213
|
-
```
|
|
1214
|
-
GET /health
|
|
1215
|
-
Response: { "status": "ok", "timestamp": "..." }
|
|
1216
|
-
```
|
|
1217
|
-
|
|
1218
|
-
### Authentication
|
|
1219
|
-
|
|
1220
|
-
When `AUTH_PASSWORD` is set, all `/api/*` routes require a valid session cookie. The `/health` endpoint is always public.
|
|
1221
|
-
|
|
1222
|
-
| Method | Endpoint | Description |
|
|
1223
|
-
|--------|----------|-------------|
|
|
1224
|
-
| GET | `/api/auth/check` | Check authentication status (never returns 401) |
|
|
1225
|
-
| POST | `/api/auth/login` | Authenticate with password, returns session cookie |
|
|
1226
|
-
| POST | `/api/auth/logout` | Invalidate session and clear cookie |
|
|
1227
|
-
|
|
1228
|
-
**Login Request:**
|
|
1229
|
-
```json
|
|
1230
|
-
{
|
|
1231
|
-
"password": "your-secret-password"
|
|
1232
|
-
}
|
|
1233
|
-
```
|
|
1234
|
-
|
|
1235
|
-
**Check Response:**
|
|
1236
|
-
```json
|
|
1237
|
-
{
|
|
1238
|
-
"authenticated": true,
|
|
1239
|
-
"required": true
|
|
1240
|
-
}
|
|
1241
|
-
```
|
|
1242
|
-
|
|
1243
|
-
### Agents
|
|
1244
|
-
|
|
1245
|
-
| Method | Endpoint | Description |
|
|
1246
|
-
|--------|----------|-------------|
|
|
1247
|
-
| GET | `/api/agents` | List all agents |
|
|
1248
|
-
| GET | `/api/agents/:name` | Get agent details |
|
|
1249
|
-
| POST | `/api/agents/:name/invoke` | Run agent |
|
|
1250
|
-
| POST | `/api/agents/:name/stream` | Stream agent response (SSE) |
|
|
1251
|
-
| GET | `/api/agents/sessions/stats` | Get session statistics |
|
|
1252
|
-
| GET | `/api/agents/sessions/:sessionId` | Get session details |
|
|
1253
|
-
| DELETE | `/api/agents/sessions/:sessionId` | Clear session messages |
|
|
1254
|
-
|
|
1255
|
-
**Invoke Request:**
|
|
1256
|
-
```json
|
|
1257
|
-
{
|
|
1258
|
-
"input": {
|
|
1259
|
-
"topic": "your topic",
|
|
1260
|
-
"context": "additional context"
|
|
1261
|
-
},
|
|
1262
|
-
"sessionId": "optional-session-id"
|
|
1263
|
-
}
|
|
1264
|
-
```
|
|
1265
|
-
|
|
1266
|
-
**Response:**
|
|
1267
|
-
```json
|
|
1268
|
-
{
|
|
1269
|
-
"output": "Agent response text",
|
|
1270
|
-
"metadata": {
|
|
1271
|
-
"tokensUsed": 150,
|
|
1272
|
-
"toolCalls": [],
|
|
1273
|
-
"duration": 1234,
|
|
1274
|
-
"sessionId": "optional-session-id",
|
|
1275
|
-
"messagesInSession": 4,
|
|
1276
|
-
"structuredOutputValid": true
|
|
1277
|
-
}
|
|
1278
|
-
}
|
|
1279
|
-
```
|
|
1280
|
-
|
|
1281
|
-
### Workflows
|
|
1282
|
-
|
|
1283
|
-
| Method | Endpoint | Description |
|
|
1284
|
-
|--------|----------|-------------|
|
|
1285
|
-
| GET | `/api/workflows` | List all workflows |
|
|
1286
|
-
| GET | `/api/workflows/:name` | Get workflow details |
|
|
1287
|
-
| POST | `/api/workflows/:name/run` | Execute workflow |
|
|
1288
|
-
| POST | `/api/workflows/:name/stream` | Stream workflow execution (SSE) |
|
|
1289
|
-
|
|
1290
|
-
**Run Request:**
|
|
1291
|
-
```json
|
|
1292
|
-
{
|
|
1293
|
-
"input": {
|
|
1294
|
-
"topic": "research topic",
|
|
1295
|
-
"style": "professional"
|
|
1296
|
-
}
|
|
1297
|
-
}
|
|
1298
|
-
```
|
|
1299
|
-
|
|
1300
|
-
**Response:**
|
|
1301
|
-
```json
|
|
1302
|
-
{
|
|
1303
|
-
"output": {
|
|
1304
|
-
"paper": "Final content",
|
|
1305
|
-
"summary": "Key points"
|
|
1306
|
-
},
|
|
1307
|
-
"metadata": {
|
|
1308
|
-
"duration": 5000,
|
|
1309
|
-
"stepsExecuted": 3,
|
|
1310
|
-
"success": true
|
|
1311
|
-
},
|
|
1312
|
-
"stepResults": {
|
|
1313
|
-
"research": { "output": "...", "metadata": {} },
|
|
1314
|
-
"summarize": { "output": "...", "metadata": {} }
|
|
1315
|
-
}
|
|
1316
|
-
}
|
|
1317
|
-
```
|
|
1318
|
-
|
|
1319
|
-
### Knowledge Stores
|
|
1320
|
-
|
|
1321
|
-
| Method | Endpoint | Description |
|
|
1322
|
-
|--------|----------|-------------|
|
|
1323
|
-
| GET | `/api/knowledge` | List all knowledge stores |
|
|
1324
|
-
| GET | `/api/knowledge/:name` | Get knowledge store config |
|
|
1325
|
-
| POST | `/api/knowledge/:name/search` | Search knowledge store |
|
|
1326
|
-
| POST | `/api/knowledge/:name/refresh` | Reload documents |
|
|
1327
|
-
| POST | `/api/knowledge/:name/add` | Add documents |
|
|
1328
|
-
| GET | `/api/knowledge/:name/entities` | Get graph entities |
|
|
1329
|
-
| GET | `/api/knowledge/:name/edges` | Get graph edges |
|
|
1330
|
-
|
|
1331
|
-
**Search Request:**
|
|
1332
|
-
```json
|
|
1333
|
-
{
|
|
1334
|
-
"query": "search term",
|
|
1335
|
-
"k": 4
|
|
1336
|
-
}
|
|
1337
|
-
```
|
|
1338
|
-
|
|
1339
|
-
### LLM
|
|
1340
|
-
|
|
1341
|
-
| Method | Endpoint | Description |
|
|
1342
|
-
|--------|----------|-------------|
|
|
1343
|
-
| GET | `/api/llm` | List all LLM configurations |
|
|
1344
|
-
| GET | `/api/llm/:name` | Get LLM config details |
|
|
1345
|
-
| POST | `/api/llm/:name/chat` | Chat with LLM (non-streaming) |
|
|
1346
|
-
| POST | `/api/llm/:name/stream` | Chat with LLM (SSE streaming) |
|
|
1347
|
-
|
|
1348
|
-
**Chat Request:**
|
|
1349
|
-
```json
|
|
1350
|
-
{
|
|
1351
|
-
"message": "Your message"
|
|
1352
|
-
}
|
|
1353
|
-
```
|
|
1354
|
-
|
|
1355
|
-
### Functions
|
|
1356
|
-
|
|
1357
|
-
| Method | Endpoint | Description |
|
|
1358
|
-
|--------|----------|-------------|
|
|
1359
|
-
| GET | `/api/functions` | List all functions |
|
|
1360
|
-
| GET | `/api/functions/:name` | Get function details and schema |
|
|
1361
|
-
| POST | `/api/functions/:name/call` | Call a function |
|
|
1362
|
-
|
|
1363
|
-
**Call Request:**
|
|
1364
|
-
```json
|
|
1365
|
-
{
|
|
1366
|
-
"arguments": {
|
|
1367
|
-
"a": 5,
|
|
1368
|
-
"b": 3,
|
|
1369
|
-
"operation": "add"
|
|
1370
|
-
}
|
|
1371
|
-
}
|
|
1372
|
-
```
|
|
1373
|
-
|
|
1374
|
-
### MCP
|
|
1375
|
-
|
|
1376
|
-
| Method | Endpoint | Description |
|
|
1377
|
-
|--------|----------|-------------|
|
|
1378
|
-
| GET | `/api/mcp` | List all MCP servers |
|
|
1379
|
-
| GET | `/api/mcp/:name` | Get MCP server config |
|
|
1380
|
-
| GET | `/api/mcp/:name/tools` | List tools from server |
|
|
1381
|
-
| POST | `/api/mcp/:name/call` | Call a tool on server |
|
|
398
|
+
Reference in agents with `mcp:fetch`.
|
|
1382
399
|
|
|
1383
|
-
|
|
1384
|
-
```json
|
|
1385
|
-
{
|
|
1386
|
-
"tool": "tool-name",
|
|
1387
|
-
"arguments": { "url": "https://example.com" }
|
|
1388
|
-
}
|
|
1389
|
-
```
|
|
1390
|
-
|
|
1391
|
-
### Skills
|
|
1392
|
-
|
|
1393
|
-
| Method | Endpoint | Description |
|
|
1394
|
-
|--------|----------|-------------|
|
|
1395
|
-
| GET | `/api/skills` | List all skills |
|
|
1396
|
-
| GET | `/api/skills/:name` | Get skill details |
|
|
1397
|
-
|
|
1398
|
-
### Tasks
|
|
1399
|
-
|
|
1400
|
-
| Method | Endpoint | Description |
|
|
1401
|
-
|--------|----------|-------------|
|
|
1402
|
-
| GET | `/api/tasks` | List all tasks |
|
|
1403
|
-
| POST | `/api/tasks` | Submit a new task |
|
|
1404
|
-
| GET | `/api/tasks/:id` | Get task status |
|
|
1405
|
-
| DELETE | `/api/tasks/:id` | Cancel a task |
|
|
1406
|
-
|
|
1407
|
-
### Files
|
|
1408
|
-
|
|
1409
|
-
| Method | Endpoint | Description |
|
|
1410
|
-
|--------|----------|-------------|
|
|
1411
|
-
| GET | `/api/files/tree` | Get project directory tree |
|
|
1412
|
-
| GET | `/api/files/read?path=...` | Read file contents |
|
|
1413
|
-
| PUT | `/api/files/write` | Write file contents |
|
|
400
|
+
## Tool Types
|
|
1414
401
|
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
402
|
+
| Prefix | Description |
|
|
403
|
+
|--------|-------------|
|
|
404
|
+
| `mcp:<server>` | External tools from MCP servers |
|
|
405
|
+
| `knowledge:<store>` | Semantic search on knowledge stores |
|
|
406
|
+
| `function:<name>` | Custom JavaScript functions |
|
|
407
|
+
| `builtin:<name>` | Framework tools (`ask_user`, `memory_save`) |
|
|
408
|
+
| `sandbox:exec` | JavaScript execution in sandboxed VM |
|
|
409
|
+
| `sandbox:shell` | Shell commands (non-root sandbox user) |
|
|
410
|
+
| `sandbox:web_fetch` | URL fetching with SSRF protection |
|
|
411
|
+
| `sandbox:web_search` | Web search |
|
|
412
|
+
| `sandbox:browser_*` | CDP-based Chromium control (navigate, observe, click, type, screenshot, evaluate) |
|
|
413
|
+
| `sandbox:file_*` | Sandboxed file tools (read, write, edit, insert, replace_lines) scoped to `/tmp` |
|
|
414
|
+
| `project:read/write/delete` | Workspace file access |
|
|
415
|
+
|
|
416
|
+
### Vision Browser (Experimental)
|
|
417
|
+
|
|
418
|
+
Pixel-coordinate browser control for vision LLMs. Enable with `EXPERIMENTAL_VISION=true`:
|
|
419
|
+
|
|
420
|
+
| Tool | Description |
|
|
421
|
+
|------|-------------|
|
|
422
|
+
| `sandbox_vision_screenshot` | Capture JPEG screenshot |
|
|
423
|
+
| `sandbox_vision_navigate` | Navigate to URL |
|
|
424
|
+
| `sandbox_vision_click` | Click at x,y coordinates |
|
|
425
|
+
| `sandbox_vision_type` | Type text |
|
|
426
|
+
| `sandbox_vision_scroll` | Scroll page |
|
|
427
|
+
| `sandbox_vision_key` | Press keyboard key |
|
|
428
|
+
| `sandbox_vision_drag` | Drag between coordinates |
|
|
429
|
+
|
|
430
|
+
Every action tool auto-captures a screenshot, cutting the screenshot-infer-act loop to one call per action.
|
|
431
|
+
|
|
432
|
+
## API
|
|
433
|
+
|
|
434
|
+
Full API documentation is available at [agentorcha.com](https://agentorcha.com). Key endpoint groups:
|
|
435
|
+
|
|
436
|
+
| Group | Base Path | Description |
|
|
437
|
+
|-------|-----------|-------------|
|
|
438
|
+
| Health | `GET /health` | Health check |
|
|
439
|
+
| Auth | `/api/auth/*` | Login, logout, session check |
|
|
440
|
+
| Agents | `/api/agents/*` | List, invoke, stream, session management |
|
|
441
|
+
| Chat | `/api/chat/*` | Published agent standalone chat |
|
|
442
|
+
| Workflows | `/api/workflows/*` | List, run, stream |
|
|
443
|
+
| Knowledge | `/api/knowledge/*` | List, search, refresh, graph entities/edges |
|
|
444
|
+
| LLM | `/api/llm/*` | List configs, chat, stream |
|
|
445
|
+
| Functions | `/api/functions/*` | List, call |
|
|
446
|
+
| MCP | `/api/mcp/*` | List servers, list tools, call tools |
|
|
447
|
+
| Skills | `/api/skills/*` | List, inspect |
|
|
448
|
+
| Tasks | `/api/tasks/*` | Submit, track, cancel |
|
|
449
|
+
| Files | `/api/files/*` | File tree, read, write |
|
|
1422
450
|
|
|
1423
451
|
## Directory Structure
|
|
1424
452
|
|
|
1425
453
|
```
|
|
1426
454
|
my-project/
|
|
1427
|
-
├── agents/
|
|
1428
|
-
├── workflows/
|
|
1429
|
-
├── knowledge/
|
|
1430
|
-
├── functions/
|
|
1431
|
-
├──
|
|
1432
|
-
|
|
1433
|
-
├──
|
|
1434
|
-
|
|
1435
|
-
└── .env # Environment variables
|
|
1436
|
-
```
|
|
1437
|
-
|
|
1438
|
-
**Framework source structure:**
|
|
1439
|
-
|
|
1440
|
-
```
|
|
1441
|
-
agent-orcha/
|
|
1442
|
-
├── src/ # Server/API code
|
|
1443
|
-
│ ├── index.ts # Entry point
|
|
1444
|
-
│ ├── server.ts # Fastify server setup
|
|
1445
|
-
│ ├── cli/ # CLI commands
|
|
1446
|
-
│ └── routes/ # API route handlers
|
|
1447
|
-
│ ├── agents.route.ts
|
|
1448
|
-
│ ├── workflows.route.ts
|
|
1449
|
-
│ ├── knowledge.route.ts
|
|
1450
|
-
│ ├── skills.route.ts
|
|
1451
|
-
│ ├── tasks.route.ts
|
|
1452
|
-
│ ├── llm.route.ts
|
|
1453
|
-
│ ├── functions.route.ts
|
|
1454
|
-
│ ├── mcp.route.ts
|
|
1455
|
-
│ └── files.route.ts
|
|
1456
|
-
│
|
|
1457
|
-
├── lib/ # Core library
|
|
1458
|
-
│ ├── orchestrator.ts # Main orchestrator class
|
|
1459
|
-
│ ├── agents/ # Agent system
|
|
1460
|
-
│ │ ├── types.ts
|
|
1461
|
-
│ │ ├── agent-loader.ts
|
|
1462
|
-
│ │ ├── agent-executor.ts
|
|
1463
|
-
│ │ └── structured-output-wrapper.ts
|
|
1464
|
-
│ ├── workflows/ # Workflow system
|
|
1465
|
-
│ │ ├── types.ts
|
|
1466
|
-
│ │ ├── workflow-loader.ts
|
|
1467
|
-
│ │ ├── workflow-executor.ts
|
|
1468
|
-
│ │ └── react-workflow-executor.ts
|
|
1469
|
-
│ ├── knowledge/ # Knowledge store system
|
|
1470
|
-
│ │ ├── types.ts
|
|
1471
|
-
│ │ ├── knowledge-store.ts
|
|
1472
|
-
│ │ ├── sqlite-store.ts
|
|
1473
|
-
│ │ └── direct-mapper.ts
|
|
1474
|
-
│ ├── skills/ # Skills system
|
|
1475
|
-
│ │ └── skill-loader.ts
|
|
1476
|
-
│ ├── tasks/ # Task management
|
|
1477
|
-
│ │ ├── task-manager.ts
|
|
1478
|
-
│ │ └── task-store.ts
|
|
1479
|
-
│ ├── sandbox/ # Sandbox execution
|
|
1480
|
-
│ │ └── vm-executor.ts
|
|
1481
|
-
│ ├── integrations/ # External integrations
|
|
1482
|
-
│ │ └── integration-manager.ts
|
|
1483
|
-
│ ├── triggers/ # Cron & webhook triggers
|
|
1484
|
-
│ │ └── trigger-manager.ts
|
|
1485
|
-
│ ├── memory/ # Memory system
|
|
1486
|
-
│ │ ├── conversation-store.ts
|
|
1487
|
-
│ │ └── memory-manager.ts
|
|
1488
|
-
│ ├── llm/ # LLM factory + providers
|
|
1489
|
-
│ │ ├── llm-factory.ts
|
|
1490
|
-
│ │ └── providers/
|
|
1491
|
-
│ ├── mcp/ # MCP client
|
|
1492
|
-
│ │ └── mcp-client.ts
|
|
1493
|
-
│ ├── functions/ # Function loader
|
|
1494
|
-
│ └── tools/ # Tool registry and discovery
|
|
1495
|
-
│ ├── tool-registry.ts
|
|
1496
|
-
│ └── built-in/
|
|
1497
|
-
│ └── knowledge-tools-factory.ts
|
|
1498
|
-
│
|
|
1499
|
-
├── public/ # Web UI (Studio)
|
|
1500
|
-
│ └── src/
|
|
1501
|
-
│ ├── components/ # Web components
|
|
1502
|
-
│ └── services/ # API client
|
|
1503
|
-
│
|
|
1504
|
-
├── templates/ # Project initialization templates
|
|
1505
|
-
└── docs/ # Documentation website
|
|
1506
|
-
```
|
|
1507
|
-
|
|
1508
|
-
## Tool Types
|
|
1509
|
-
|
|
1510
|
-
### Function Tools
|
|
1511
|
-
Custom JavaScript functions you create in the `functions/` directory:
|
|
1512
|
-
```yaml
|
|
1513
|
-
tools:
|
|
1514
|
-
- function:fibonacci # References fibonacci.function.js
|
|
1515
|
-
- function:calculator
|
|
455
|
+
├── agents/ # Agent definitions (YAML)
|
|
456
|
+
├── workflows/ # Workflow definitions (YAML)
|
|
457
|
+
├── knowledge/ # Knowledge store configs and data
|
|
458
|
+
├── functions/ # Custom function tools (JavaScript)
|
|
459
|
+
├── skills/ # Skill prompt files (Markdown)
|
|
460
|
+
├── llm.json # LLM and embedding configurations
|
|
461
|
+
├── mcp.json # MCP server configuration
|
|
462
|
+
└── .env # Environment variables
|
|
1516
463
|
```
|
|
1517
464
|
|
|
1518
|
-
|
|
1519
|
-
External tools from MCP servers:
|
|
1520
|
-
```yaml
|
|
1521
|
-
tools:
|
|
1522
|
-
- mcp:fetch # All tools from "fetch" server
|
|
1523
|
-
```
|
|
465
|
+
## Development
|
|
1524
466
|
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
```
|
|
1532
|
-
|
|
1533
|
-
### Built-in Tools
|
|
1534
|
-
Framework-provided tools:
|
|
1535
|
-
```yaml
|
|
1536
|
-
tools:
|
|
1537
|
-
- builtin:ask_user # Human-in-the-loop (ReAct workflows)
|
|
1538
|
-
- builtin:memory_save # Save to persistent memory
|
|
1539
|
-
```
|
|
1540
|
-
|
|
1541
|
-
### Sandbox Tools
|
|
1542
|
-
Sandboxed code execution:
|
|
1543
|
-
```yaml
|
|
1544
|
-
tools:
|
|
1545
|
-
- sandbox:exec # Execute code in sandbox
|
|
1546
|
-
- sandbox:web_fetch # Fetch URLs from sandbox
|
|
1547
|
-
- sandbox:web_search # Web search from sandbox
|
|
1548
|
-
```
|
|
1549
|
-
|
|
1550
|
-
### Project Tools
|
|
1551
|
-
Workspace file access:
|
|
1552
|
-
```yaml
|
|
1553
|
-
tools:
|
|
1554
|
-
- project:read # Read project files
|
|
1555
|
-
- project:write # Write project files
|
|
467
|
+
```bash
|
|
468
|
+
npm run dev # Dev server with auto-reload
|
|
469
|
+
npm run build # Build
|
|
470
|
+
npm start # Run build
|
|
471
|
+
npm run lint # ESLint
|
|
472
|
+
npm run typecheck # TypeScript type checking
|
|
1556
473
|
```
|
|
1557
474
|
|
|
1558
475
|
## License
|