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.
- package/README.md +792 -125
- package/dist/lib/agents/agent-executor.d.ts +6 -1
- package/dist/lib/agents/agent-executor.d.ts.map +1 -1
- package/dist/lib/agents/agent-executor.js +241 -45
- package/dist/lib/agents/agent-executor.js.map +1 -1
- package/dist/lib/agents/agent-loader.d.ts.map +1 -1
- package/dist/lib/agents/agent-loader.js +3 -1
- package/dist/lib/agents/agent-loader.js.map +1 -1
- package/dist/lib/agents/index.d.ts +2 -1
- package/dist/lib/agents/index.d.ts.map +1 -1
- package/dist/lib/agents/index.js +1 -0
- package/dist/lib/agents/index.js.map +1 -1
- package/dist/lib/agents/structured-output-wrapper.d.ts +19 -0
- package/dist/lib/agents/structured-output-wrapper.d.ts.map +1 -0
- package/dist/lib/agents/structured-output-wrapper.js +104 -0
- package/dist/lib/agents/structured-output-wrapper.js.map +1 -0
- package/dist/lib/agents/types.d.ts +17 -10
- package/dist/lib/agents/types.d.ts.map +1 -1
- package/dist/lib/agents/types.js +1 -1
- package/dist/lib/agents/types.js.map +1 -1
- package/dist/lib/index.d.ts +9 -7
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +7 -5
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/knowledge/graph-rag/community-detector.d.ts +16 -0
- package/dist/lib/knowledge/graph-rag/community-detector.d.ts.map +1 -0
- package/dist/lib/knowledge/graph-rag/community-detector.js +81 -0
- package/dist/lib/knowledge/graph-rag/community-detector.js.map +1 -0
- package/dist/lib/knowledge/graph-rag/community-summarizer.d.ts +17 -0
- package/dist/lib/knowledge/graph-rag/community-summarizer.d.ts.map +1 -0
- package/dist/lib/knowledge/graph-rag/community-summarizer.js +87 -0
- package/dist/lib/knowledge/graph-rag/community-summarizer.js.map +1 -0
- package/dist/lib/knowledge/graph-rag/entity-extractor.d.ts +36 -0
- package/dist/lib/knowledge/graph-rag/entity-extractor.d.ts.map +1 -0
- package/dist/lib/knowledge/graph-rag/entity-extractor.js +192 -0
- package/dist/lib/knowledge/graph-rag/entity-extractor.js.map +1 -0
- package/dist/lib/knowledge/graph-rag/extraction-cache.d.ts +30 -0
- package/dist/lib/knowledge/graph-rag/extraction-cache.d.ts.map +1 -0
- package/dist/lib/knowledge/graph-rag/extraction-cache.js +88 -0
- package/dist/lib/knowledge/graph-rag/extraction-cache.js.map +1 -0
- package/dist/lib/knowledge/graph-rag/global-search.d.ts +19 -0
- package/dist/lib/knowledge/graph-rag/global-search.d.ts.map +1 -0
- package/dist/lib/knowledge/graph-rag/global-search.js +96 -0
- package/dist/lib/knowledge/graph-rag/global-search.js.map +1 -0
- package/dist/lib/knowledge/graph-rag/graph-rag-factory.d.ts +24 -0
- package/dist/lib/knowledge/graph-rag/graph-rag-factory.d.ts.map +1 -0
- package/dist/lib/knowledge/graph-rag/graph-rag-factory.js +239 -0
- package/dist/lib/knowledge/graph-rag/graph-rag-factory.js.map +1 -0
- package/dist/lib/knowledge/graph-rag/index.d.ts +14 -0
- package/dist/lib/knowledge/graph-rag/index.d.ts.map +1 -0
- package/dist/lib/knowledge/graph-rag/index.js +12 -0
- package/dist/lib/knowledge/graph-rag/index.js.map +1 -0
- package/dist/lib/knowledge/graph-rag/local-search.d.ts +20 -0
- package/dist/lib/knowledge/graph-rag/local-search.d.ts.map +1 -0
- package/dist/lib/knowledge/graph-rag/local-search.js +110 -0
- package/dist/lib/knowledge/graph-rag/local-search.js.map +1 -0
- package/dist/lib/knowledge/graph-rag/memory-graph-store.d.ts +31 -0
- package/dist/lib/knowledge/graph-rag/memory-graph-store.d.ts.map +1 -0
- package/dist/lib/knowledge/graph-rag/memory-graph-store.js +165 -0
- package/dist/lib/knowledge/graph-rag/memory-graph-store.js.map +1 -0
- package/dist/lib/knowledge/graph-rag/neo4j-graph-store.d.ts +38 -0
- package/dist/lib/knowledge/graph-rag/neo4j-graph-store.d.ts.map +1 -0
- package/dist/lib/knowledge/graph-rag/neo4j-graph-store.js +190 -0
- package/dist/lib/knowledge/graph-rag/neo4j-graph-store.js.map +1 -0
- package/dist/lib/knowledge/graph-rag/search-mode-detector.d.ts +11 -0
- package/dist/lib/knowledge/graph-rag/search-mode-detector.d.ts.map +1 -0
- package/dist/lib/knowledge/graph-rag/search-mode-detector.js +50 -0
- package/dist/lib/knowledge/graph-rag/search-mode-detector.js.map +1 -0
- package/dist/lib/knowledge/graph-rag/types.d.ts +368 -0
- package/dist/lib/knowledge/graph-rag/types.d.ts.map +1 -0
- package/dist/lib/knowledge/graph-rag/types.js +48 -0
- package/dist/lib/knowledge/graph-rag/types.js.map +1 -0
- package/dist/lib/knowledge/index.d.ts +9 -0
- package/dist/lib/knowledge/index.d.ts.map +1 -0
- package/dist/lib/knowledge/index.js +8 -0
- package/dist/lib/knowledge/index.js.map +1 -0
- package/dist/lib/knowledge/knowledge-store-factory.d.ts +16 -0
- package/dist/lib/knowledge/knowledge-store-factory.d.ts.map +1 -0
- package/dist/lib/{vectors/vector-store-factory.js → knowledge/knowledge-store-factory.js} +36 -10
- package/dist/lib/knowledge/knowledge-store-factory.js.map +1 -0
- package/dist/lib/knowledge/knowledge-store-manager.d.ts +18 -0
- package/dist/lib/knowledge/knowledge-store-manager.d.ts.map +1 -0
- package/dist/lib/knowledge/knowledge-store-manager.js +98 -0
- package/dist/lib/knowledge/knowledge-store-manager.js.map +1 -0
- package/dist/lib/knowledge/loaders/database-loader.d.ts +18 -0
- package/dist/lib/knowledge/loaders/database-loader.d.ts.map +1 -0
- package/dist/lib/knowledge/loaders/database-loader.js +115 -0
- package/dist/lib/knowledge/loaders/database-loader.js.map +1 -0
- package/dist/lib/knowledge/loaders/index.d.ts +4 -0
- package/dist/lib/knowledge/loaders/index.d.ts.map +1 -0
- package/dist/lib/knowledge/loaders/index.js +4 -0
- package/dist/lib/knowledge/loaders/index.js.map +1 -0
- package/dist/lib/knowledge/loaders/s3-loader.d.ts +17 -0
- package/dist/lib/knowledge/loaders/s3-loader.d.ts.map +1 -0
- package/dist/lib/knowledge/loaders/s3-loader.js +185 -0
- package/dist/lib/knowledge/loaders/s3-loader.js.map +1 -0
- package/dist/lib/knowledge/loaders/web-loader.d.ts +12 -0
- package/dist/lib/knowledge/loaders/web-loader.d.ts.map +1 -0
- package/dist/lib/knowledge/loaders/web-loader.js +56 -0
- package/dist/lib/knowledge/loaders/web-loader.js.map +1 -0
- package/dist/lib/knowledge/types.d.ts +1839 -0
- package/dist/lib/knowledge/types.d.ts.map +1 -0
- package/dist/lib/knowledge/types.js +111 -0
- package/dist/lib/knowledge/types.js.map +1 -0
- package/dist/lib/knowledge/utils/connection-pool.d.ts +18 -0
- package/dist/lib/knowledge/utils/connection-pool.d.ts.map +1 -0
- package/dist/lib/knowledge/utils/connection-pool.js +77 -0
- package/dist/lib/knowledge/utils/connection-pool.js.map +1 -0
- package/dist/lib/knowledge/utils/file-type-detector.d.ts +10 -0
- package/dist/lib/knowledge/utils/file-type-detector.d.ts.map +1 -0
- package/dist/lib/knowledge/utils/file-type-detector.js +32 -0
- package/dist/lib/knowledge/utils/file-type-detector.js.map +1 -0
- package/dist/lib/knowledge/utils/index.d.ts +3 -0
- package/dist/lib/knowledge/utils/index.d.ts.map +1 -0
- package/dist/lib/knowledge/utils/index.js +3 -0
- package/dist/lib/knowledge/utils/index.js.map +1 -0
- package/dist/lib/mcp/mcp-client.d.ts +9 -1
- package/dist/lib/mcp/mcp-client.d.ts.map +1 -1
- package/dist/lib/mcp/mcp-client.js +33 -0
- package/dist/lib/mcp/mcp-client.js.map +1 -1
- package/dist/lib/memory/conversation-store.d.ts +43 -0
- package/dist/lib/memory/conversation-store.d.ts.map +1 -0
- package/dist/lib/memory/conversation-store.js +109 -0
- package/dist/lib/memory/conversation-store.js.map +1 -0
- package/dist/lib/memory/index.d.ts +3 -0
- package/dist/lib/memory/index.d.ts.map +1 -0
- package/dist/lib/memory/index.js +3 -0
- package/dist/lib/memory/index.js.map +1 -0
- package/dist/lib/memory/types.d.ts +19 -0
- package/dist/lib/memory/types.d.ts.map +1 -0
- package/dist/lib/memory/types.js +6 -0
- package/dist/lib/memory/types.js.map +1 -0
- package/dist/lib/orchestrator.d.ts +56 -14
- package/dist/lib/orchestrator.d.ts.map +1 -1
- package/dist/lib/orchestrator.js +182 -25
- package/dist/lib/orchestrator.js.map +1 -1
- package/dist/lib/tools/agent-tool-wrapper.d.ts +22 -0
- package/dist/lib/tools/agent-tool-wrapper.d.ts.map +1 -0
- package/dist/lib/tools/agent-tool-wrapper.js +56 -0
- package/dist/lib/tools/agent-tool-wrapper.js.map +1 -0
- package/dist/lib/tools/built-in/ask-user.tool.d.ts +7 -0
- package/dist/lib/tools/built-in/ask-user.tool.d.ts.map +1 -0
- package/dist/lib/tools/built-in/ask-user.tool.js +23 -0
- package/dist/lib/tools/built-in/ask-user.tool.js.map +1 -0
- package/dist/lib/tools/built-in/index.d.ts +2 -1
- package/dist/lib/tools/built-in/index.d.ts.map +1 -1
- package/dist/lib/tools/built-in/index.js +2 -1
- package/dist/lib/tools/built-in/index.js.map +1 -1
- package/dist/lib/tools/built-in/knowledge-search.tool.d.ts +4 -0
- package/dist/lib/tools/built-in/knowledge-search.tool.d.ts.map +1 -0
- package/dist/lib/tools/built-in/{vector-search.tool.js → knowledge-search.tool.js} +4 -4
- package/dist/lib/tools/built-in/knowledge-search.tool.js.map +1 -0
- package/dist/lib/tools/index.d.ts +3 -1
- package/dist/lib/tools/index.d.ts.map +1 -1
- package/dist/lib/tools/index.js +3 -1
- package/dist/lib/tools/index.js.map +1 -1
- package/dist/lib/tools/tool-discovery.d.ts +50 -0
- package/dist/lib/tools/tool-discovery.d.ts.map +1 -0
- package/dist/lib/tools/tool-discovery.js +178 -0
- package/dist/lib/tools/tool-discovery.js.map +1 -0
- package/dist/lib/tools/tool-registry.d.ts +19 -3
- package/dist/lib/tools/tool-registry.d.ts.map +1 -1
- package/dist/lib/tools/tool-registry.js +63 -10
- package/dist/lib/tools/tool-registry.js.map +1 -1
- package/dist/lib/workflows/index.d.ts +4 -2
- package/dist/lib/workflows/index.d.ts.map +1 -1
- package/dist/lib/workflows/index.js +3 -1
- package/dist/lib/workflows/index.js.map +1 -1
- package/dist/lib/workflows/interrupt-manager.d.ts +42 -0
- package/dist/lib/workflows/interrupt-manager.d.ts.map +1 -0
- package/dist/lib/workflows/interrupt-manager.js +102 -0
- package/dist/lib/workflows/interrupt-manager.js.map +1 -0
- package/dist/lib/workflows/langgraph-executor.d.ts +51 -0
- package/dist/lib/workflows/langgraph-executor.d.ts.map +1 -0
- package/dist/lib/workflows/langgraph-executor.js +297 -0
- package/dist/lib/workflows/langgraph-executor.js.map +1 -0
- package/dist/lib/workflows/types.d.ts +911 -34
- package/dist/lib/workflows/types.d.ts.map +1 -1
- package/dist/lib/workflows/types.js +51 -2
- package/dist/lib/workflows/types.js.map +1 -1
- package/dist/lib/workflows/workflow-executor.d.ts.map +1 -1
- package/dist/lib/workflows/workflow-executor.js +4 -0
- package/dist/lib/workflows/workflow-executor.js.map +1 -1
- package/dist/lib/workflows/workflow-loader.d.ts.map +1 -1
- package/dist/lib/workflows/workflow-loader.js +3 -1
- package/dist/lib/workflows/workflow-loader.js.map +1 -1
- package/dist/public/index.html +133 -700
- package/dist/public/src/components/AgentsView.js +763 -0
- package/dist/public/src/components/AppRoot.js +76 -0
- package/dist/public/src/components/IdeView.js +330 -0
- package/dist/public/src/components/KnowledgeView.js +133 -0
- package/dist/public/src/components/LlmView.js +127 -0
- package/dist/public/src/components/McpView.js +387 -0
- package/dist/public/src/components/NavBar.js +71 -0
- package/dist/public/src/components/WorkflowsView.js +243 -0
- package/dist/public/src/main.js +9 -0
- package/dist/public/src/services/ApiService.js +142 -0
- package/dist/public/src/store.js +41 -0
- package/dist/public/src/utils/Component.js +23 -0
- package/dist/public/src/utils/markdown.js +82 -0
- package/dist/src/cli/commands/start.d.ts.map +1 -1
- package/dist/src/cli/commands/start.js +3 -2
- package/dist/src/cli/commands/start.js.map +1 -1
- package/dist/src/index.js +46 -12
- package/dist/src/index.js.map +1 -1
- package/dist/src/routes/agents.route.d.ts.map +1 -1
- package/dist/src/routes/agents.route.js +38 -5
- package/dist/src/routes/agents.route.js.map +1 -1
- package/dist/src/routes/files.route.d.ts +3 -0
- package/dist/src/routes/files.route.d.ts.map +1 -0
- package/dist/src/routes/files.route.js +160 -0
- package/dist/src/routes/files.route.js.map +1 -0
- package/dist/src/routes/functions.route.d.ts +3 -0
- package/dist/src/routes/functions.route.d.ts.map +1 -0
- package/dist/src/routes/functions.route.js +83 -0
- package/dist/src/routes/functions.route.js.map +1 -0
- package/dist/src/routes/knowledge.route.d.ts +3 -0
- package/dist/src/routes/knowledge.route.d.ts.map +1 -0
- package/dist/src/routes/knowledge.route.js +153 -0
- package/dist/src/routes/knowledge.route.js.map +1 -0
- package/dist/src/routes/mcp.route.d.ts +3 -0
- package/dist/src/routes/mcp.route.d.ts.map +1 -0
- package/dist/src/routes/mcp.route.js +79 -0
- package/dist/src/routes/mcp.route.js.map +1 -0
- package/dist/src/routes/workflows.route.d.ts.map +1 -1
- package/dist/src/routes/workflows.route.js +2 -1
- package/dist/src/routes/workflows.route.js.map +1 -1
- package/dist/src/server.d.ts.map +1 -1
- package/dist/src/server.js +8 -2
- package/dist/src/server.js.map +1 -1
- package/dist/templates/.env.example +21 -0
- package/dist/templates/README.md +43 -152
- package/dist/templates/agents/call-center-analyst-simple.agent.yaml +36 -0
- package/dist/templates/agents/math.agent.yaml +4 -14
- package/dist/templates/agents/sentiment-structured.agent.yaml +42 -0
- package/dist/templates/functions/calculator.function.js +69 -0
- package/dist/templates/functions/text-formatter.function.js +66 -0
- package/dist/templates/{vectors/example.vector.yaml → knowledge/example.knowledge.yaml} +1 -1
- package/dist/templates/knowledge/transcripts/call-001.txt +40 -0
- package/dist/templates/knowledge/transcripts/call-002.txt +36 -0
- package/dist/templates/knowledge/transcripts/call-003.txt +42 -0
- package/dist/templates/llm.md +1195 -0
- package/dist/templates/workflows/example.workflow.yaml +8 -19
- package/dist/templates/workflows/langgraph-example.workflow.yaml +84 -0
- package/package.json +19 -10
- package/dist/lib/tools/built-in/vector-search.tool.d.ts +0 -4
- package/dist/lib/tools/built-in/vector-search.tool.d.ts.map +0 -1
- package/dist/lib/tools/built-in/vector-search.tool.js.map +0 -1
- package/dist/lib/vectors/index.d.ts +0 -5
- package/dist/lib/vectors/index.d.ts.map +0 -1
- package/dist/lib/vectors/index.js +0 -4
- package/dist/lib/vectors/index.js.map +0 -1
- package/dist/lib/vectors/types.d.ts +0 -212
- package/dist/lib/vectors/types.d.ts.map +0 -1
- package/dist/lib/vectors/types.js +0 -39
- package/dist/lib/vectors/types.js.map +0 -1
- package/dist/lib/vectors/vector-store-factory.d.ts +0 -14
- package/dist/lib/vectors/vector-store-factory.d.ts.map +0 -1
- package/dist/lib/vectors/vector-store-factory.js.map +0 -1
- package/dist/lib/vectors/vector-store-manager.d.ts +0 -18
- package/dist/lib/vectors/vector-store-manager.d.ts.map +0 -1
- package/dist/lib/vectors/vector-store-manager.js +0 -79
- package/dist/lib/vectors/vector-store-manager.js.map +0 -1
- package/dist/src/routes/vectors.route.d.ts +0 -3
- package/dist/src/routes/vectors.route.d.ts.map +0 -1
- package/dist/src/routes/vectors.route.js +0 -74
- package/dist/src/routes/vectors.route.js.map +0 -1
- package/dist/templates/agents/example.agent.yaml +0 -32
- package/dist/templates/agents/knowledge.agent.yaml +0 -36
- package/dist/templates/agents/time.agent.yaml +0 -42
- package/dist/templates/functions/README.md +0 -195
- package/dist/templates/functions/fibonacci.function.js +0 -55
- package/dist/templates/vectors/example-chroma.vector.yaml +0 -43
- package/dist/templates/vectors/sample-data/example-document.txt +0 -15
package/README.md
CHANGED
|
@@ -1,23 +1,51 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
1
3
|
# Agent Orcha
|
|
2
4
|
|
|
3
|
-
|
|
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
|
+
|
|
7
|
+
**[Documentation](https://ddalcu.github.io/agent-orcha)** | **[NPM Package](https://www.npmjs.com/package/agent-orcha)** | **[Docker Hub](https://hub.docker.com/r/ddalcu/agent-orcha)**
|
|
8
|
+
|
|
9
|
+
## Why Agent Orcha?
|
|
10
|
+
|
|
11
|
+
- **Declarative AI**: Define agents, workflows, and infrastructure in clear, version-controlled YAML files. No more spaghetti code.
|
|
12
|
+
- **Model Agnostic**: Seamlessly swap between OpenAI, Gemini, Anthropic, or local LLMs (Ollama, LM Studio) without rewriting logic.
|
|
13
|
+
- **Universal Tooling**: Leverage the **Model Context Protocol (MCP)** to connect agents to any external service, API, or database instantly.
|
|
14
|
+
- **Knowledge Stores**: Built-in vector store and **GraphRAG** integration makes semantic search and knowledge graph analysis a first-class citizen.
|
|
15
|
+
- **Robust Workflow Engine**: Orchestrate complex multi-agent sequences with parallel execution, conditional logic, and state management - or use **LangGraph** for autonomous prompt-driven workflows.
|
|
16
|
+
- **Conversation Memory**: Built-in session-based memory for multi-turn dialogues with automatic message management and TTL cleanup.
|
|
17
|
+
- **Structured Output**: Enforce JSON schemas on agent responses with automatic validation and type safety.
|
|
18
|
+
- **Agent Orcha Studio**: Built-in web dashboard with agent testing, knowledge browsing, workflow execution, and an **in-browser IDE** for editing configs.
|
|
19
|
+
- **Developer Experience**: Fully typed interfaces, intuitive CLI tooling, and a modular architecture designed for rapid iteration from prototype to production.
|
|
20
|
+
- **Extensible Functions**: Drop in simple JavaScript functions to extend agent capabilities with zero boilerplate.
|
|
4
21
|
|
|
5
22
|
## Overview
|
|
6
23
|
|
|
7
24
|
Agent Orcha enables you to:
|
|
8
25
|
|
|
9
26
|
- **Define agents** using YAML configuration files with customizable LLM providers, prompts, and tools
|
|
10
|
-
- **Create workflows** that coordinate multiple agents in sequential or
|
|
11
|
-
- **Integrate
|
|
27
|
+
- **Create workflows** that coordinate multiple agents in sequential, parallel, or autonomous (LangGraph) execution
|
|
28
|
+
- **Integrate knowledge stores** for RAG (Retrieval Augmented Generation) with vector search and GraphRAG
|
|
12
29
|
- **Connect MCP servers** to extend agent capabilities with external tools
|
|
13
|
-
- **Create local
|
|
30
|
+
- **Create local functions** to give your agents the ability to call your own custom code
|
|
31
|
+
- **Manage everything** through a web-based Studio dashboard with built-in IDE
|
|
32
|
+
|
|
33
|
+
### Alpha Status and Security Notice
|
|
34
|
+
|
|
35
|
+
**This project is currently in ALPHA state.** No security precautions have been implemented yet. 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.
|
|
36
|
+
|
|
14
37
|
|
|
15
38
|
## Usage
|
|
16
|
-
- **Use as is** check out and run
|
|
17
|
-
- **Use as a library** in your TypeScript/JavaScript projects
|
|
18
|
-
- **Use as a CLI** with npx for standalone agent orchestration (recommended)
|
|
19
39
|
|
|
20
|
-
|
|
40
|
+
Agent Orcha can be used in multiple ways depending on your needs:
|
|
41
|
+
|
|
42
|
+
1. **CLI Tool (Recommended)** - Use `npx agent-orcha` to initialize and run Agent Orcha projects standalone
|
|
43
|
+
2. **Backend API Server** - Run Agent Orcha as a REST API backend for your existing frontends or applications
|
|
44
|
+
3. **Docker Image** - Use the official Docker image ([ddalcu/agent-orcha](https://hub.docker.com/r/ddalcu/agent-orcha)) for local and server deployments
|
|
45
|
+
4. **Library** - Import and use Agent Orcha programmatically in your TypeScript/JavaScript projects
|
|
46
|
+
5. **Source** - Clone and run directly from source for development or customization
|
|
47
|
+
|
|
48
|
+
**Requirements:** Node.js >= 20.0.0 (or Docker for containerized deployment)
|
|
21
49
|
|
|
22
50
|
|
|
23
51
|
## Quick Start
|
|
@@ -66,6 +94,42 @@ curl -X POST http://localhost:3000/api/agents/example/invoke \
|
|
|
66
94
|
-d '{"input": {"query": "Hello, how are you?"}}'
|
|
67
95
|
```
|
|
68
96
|
|
|
97
|
+
### Docker Usage
|
|
98
|
+
|
|
99
|
+
Run Agent Orcha using the official Docker image:
|
|
100
|
+
|
|
101
|
+
1. **Initialize a project:**
|
|
102
|
+
```bash
|
|
103
|
+
docker run -v ./my-agent-orcha-project:/data ddalcu/agent-orcha init
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
2. **Start the server:**
|
|
107
|
+
```bash
|
|
108
|
+
docker run -p 3000:3000 -v ./my-agent-orcha-project:/data ddalcu/agent-orcha start
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
3. **Or use Docker Compose:**
|
|
112
|
+
```yaml
|
|
113
|
+
version: '3.8'
|
|
114
|
+
|
|
115
|
+
services:
|
|
116
|
+
agent-orcha:
|
|
117
|
+
image: ddalcu/agent-orcha
|
|
118
|
+
ports:
|
|
119
|
+
- "3000:3000"
|
|
120
|
+
volumes:
|
|
121
|
+
- ./my-agent-orcha-project:/data
|
|
122
|
+
environment:
|
|
123
|
+
- ORCHA_BASE_DIR=/data
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Then run:
|
|
127
|
+
```bash
|
|
128
|
+
docker-compose up
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
See the [Docker Hub page](https://hub.docker.com/r/ddalcu/agent-orcha) for more details and available tags.
|
|
132
|
+
|
|
69
133
|
### Library Usage
|
|
70
134
|
|
|
71
135
|
```typescript
|
|
@@ -92,10 +156,84 @@ const workflowResult = await orchestrator.workflows.run('research-paper', {
|
|
|
92
156
|
|
|
93
157
|
console.log(workflowResult.output);
|
|
94
158
|
|
|
159
|
+
// Search a knowledge store
|
|
160
|
+
const searchResults = await orchestrator.knowledge.search('docs', {
|
|
161
|
+
query: 'how does authentication work',
|
|
162
|
+
k: 4
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
// Run agent with conversation memory
|
|
166
|
+
const memoryResult = await orchestrator.runAgent(
|
|
167
|
+
'chatbot',
|
|
168
|
+
{ message: 'Hello' },
|
|
169
|
+
'session-123' // sessionId
|
|
170
|
+
);
|
|
171
|
+
|
|
95
172
|
// Clean up
|
|
96
173
|
await orchestrator.close();
|
|
97
174
|
```
|
|
98
175
|
|
|
176
|
+
### Backend API Server Usage
|
|
177
|
+
|
|
178
|
+
Run Agent Orcha as a backend API server for your existing applications or frontends:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
# Start the server (defaults to port 3000)
|
|
182
|
+
npx agent-orcha start
|
|
183
|
+
|
|
184
|
+
# Or specify a custom port
|
|
185
|
+
PORT=8080 npx agent-orcha start
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Agent Orcha exposes a complete REST API that your frontend can consume:
|
|
189
|
+
|
|
190
|
+
```javascript
|
|
191
|
+
// Example: Invoke an agent from your frontend
|
|
192
|
+
const response = await fetch('http://localhost:3000/api/agents/researcher/invoke', {
|
|
193
|
+
method: 'POST',
|
|
194
|
+
headers: { 'Content-Type': 'application/json' },
|
|
195
|
+
body: JSON.stringify({
|
|
196
|
+
input: { topic: 'AI trends' },
|
|
197
|
+
sessionId: 'user-session-123' // Optional for conversation memory
|
|
198
|
+
})
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
const result = await response.json();
|
|
202
|
+
console.log(result.output);
|
|
203
|
+
|
|
204
|
+
// Example: Search a knowledge store
|
|
205
|
+
const searchResponse = await fetch('http://localhost:3000/api/knowledge/docs/search', {
|
|
206
|
+
method: 'POST',
|
|
207
|
+
headers: { 'Content-Type': 'application/json' },
|
|
208
|
+
body: JSON.stringify({
|
|
209
|
+
query: 'authentication best practices',
|
|
210
|
+
k: 5
|
|
211
|
+
})
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
const searchResults = await searchResponse.json();
|
|
215
|
+
|
|
216
|
+
// Example: Stream agent responses (SSE)
|
|
217
|
+
const eventSource = new EventSource(
|
|
218
|
+
'http://localhost:3000/api/agents/chatbot/stream?' +
|
|
219
|
+
new URLSearchParams({
|
|
220
|
+
input: JSON.stringify({ message: 'Hello!' }),
|
|
221
|
+
sessionId: 'user-123'
|
|
222
|
+
})
|
|
223
|
+
);
|
|
224
|
+
|
|
225
|
+
eventSource.onmessage = (event) => {
|
|
226
|
+
const data = JSON.parse(event.data);
|
|
227
|
+
console.log(data.chunk); // Streaming response chunk
|
|
228
|
+
};
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
**CORS Configuration:**
|
|
232
|
+
For production deployments, configure CORS in your server startup or use a reverse proxy (nginx, Caddy, etc.) to handle CORS headers.
|
|
233
|
+
|
|
234
|
+
**Security Note:**
|
|
235
|
+
Agent Orcha is currently in ALPHA with no built-in authentication. Always deploy behind a firewall or add your own authentication layer (JWT, API keys, etc.) before exposing to clients.
|
|
236
|
+
|
|
99
237
|
## CLI Commands
|
|
100
238
|
|
|
101
239
|
| Command | Description |
|
|
@@ -111,8 +249,8 @@ For development on the agent-orcha framework itself:
|
|
|
111
249
|
| Command | Description |
|
|
112
250
|
|---------|-------------|
|
|
113
251
|
| `npm run dev` | Start development server with auto-reload |
|
|
114
|
-
| `npm run build` | Build
|
|
115
|
-
| `npm start` | Run
|
|
252
|
+
| `npm run build` | Build |
|
|
253
|
+
| `npm start` | Run build |
|
|
116
254
|
| `npm run lint` | Run ESLint |
|
|
117
255
|
| `npm run typecheck` | Run TypeScript type checking |
|
|
118
256
|
|
|
@@ -120,7 +258,7 @@ For development on the agent-orcha framework itself:
|
|
|
120
258
|
|
|
121
259
|
### LLM Configuration (llm.json)
|
|
122
260
|
|
|
123
|
-
All LLM and embedding configurations are defined in `llm.json` at the project root. Agents and
|
|
261
|
+
All LLM and embedding configurations are defined in `llm.json` at the project root. Agents and knowledge stores reference these configs by name.
|
|
124
262
|
|
|
125
263
|
```json
|
|
126
264
|
{
|
|
@@ -210,6 +348,9 @@ Embedding configurations support the following options:
|
|
|
210
348
|
# Server configuration
|
|
211
349
|
PORT=3000
|
|
212
350
|
HOST=0.0.0.0
|
|
351
|
+
|
|
352
|
+
# Base directory for config files (optional)
|
|
353
|
+
ORCHA_BASE_DIR=/path/to/project
|
|
213
354
|
```
|
|
214
355
|
|
|
215
356
|
## Agents
|
|
@@ -235,11 +376,16 @@ prompt: # Prompt configuration (required)
|
|
|
235
376
|
|
|
236
377
|
tools: # Tools available to agent (optional)
|
|
237
378
|
- mcp:<server-name> # MCP server tools
|
|
238
|
-
-
|
|
379
|
+
- knowledge:<store-name> # Knowledge store search
|
|
380
|
+
- function:<function-name> # Custom function
|
|
239
381
|
- builtin:<tool-name> # Built-in tools
|
|
240
382
|
|
|
241
383
|
output: # Output formatting (optional)
|
|
242
384
|
format: text | json | structured
|
|
385
|
+
schema: # Required when format is "structured"
|
|
386
|
+
type: object
|
|
387
|
+
properties: { ... }
|
|
388
|
+
required: [string]
|
|
243
389
|
|
|
244
390
|
metadata: # Custom metadata (optional)
|
|
245
391
|
category: string
|
|
@@ -252,7 +398,7 @@ metadata: # Custom metadata (optional)
|
|
|
252
398
|
# agents/researcher.agent.yaml
|
|
253
399
|
|
|
254
400
|
name: researcher
|
|
255
|
-
description: Researches topics using web fetch and
|
|
401
|
+
description: Researches topics using web fetch and knowledge search
|
|
256
402
|
version: "1.0.0"
|
|
257
403
|
|
|
258
404
|
llm:
|
|
@@ -273,21 +419,193 @@ prompt:
|
|
|
273
419
|
|
|
274
420
|
tools:
|
|
275
421
|
- mcp:fetch
|
|
276
|
-
-
|
|
422
|
+
- knowledge:transcripts
|
|
277
423
|
|
|
278
424
|
output:
|
|
279
425
|
format: text
|
|
280
426
|
|
|
281
427
|
metadata:
|
|
282
428
|
category: research
|
|
283
|
-
tags: [research, web,
|
|
429
|
+
tags: [research, web, knowledge]
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
### Conversation Memory
|
|
433
|
+
|
|
434
|
+
Agent Orcha supports session-based conversation memory, allowing agents to maintain context across multiple interactions. This is useful for building chatbots, multi-turn dialogues, and stateful applications.
|
|
435
|
+
|
|
436
|
+
**Features:**
|
|
437
|
+
- In-memory session storage using LangChain messages
|
|
438
|
+
- Automatic FIFO message limit (default: 50 messages per session)
|
|
439
|
+
- Optional TTL-based session cleanup (default: 1 hour)
|
|
440
|
+
- Backward compatible (sessionId is optional)
|
|
441
|
+
|
|
442
|
+
**API Usage:**
|
|
443
|
+
|
|
444
|
+
```bash
|
|
445
|
+
# First message
|
|
446
|
+
curl -X POST http://localhost:3000/api/agents/chatbot-memory/invoke \
|
|
447
|
+
-H "Content-Type: application/json" \
|
|
448
|
+
-d '{
|
|
449
|
+
"input": {"message": "My name is Alice"},
|
|
450
|
+
"sessionId": "user-123"
|
|
451
|
+
}'
|
|
452
|
+
|
|
453
|
+
# Second message (agent remembers the name)
|
|
454
|
+
curl -X POST http://localhost:3000/api/agents/chatbot-memory/invoke \
|
|
455
|
+
-H "Content-Type: application/json" \
|
|
456
|
+
-d '{
|
|
457
|
+
"input": {"message": "What is my name?"},
|
|
458
|
+
"sessionId": "user-123"
|
|
459
|
+
}'
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
**Library Usage:**
|
|
463
|
+
|
|
464
|
+
```typescript
|
|
465
|
+
// Run agent with conversation memory
|
|
466
|
+
const result1 = await orchestrator.runAgent(
|
|
467
|
+
'chatbot-memory',
|
|
468
|
+
{ message: 'My name is Alice' },
|
|
469
|
+
'user-123' // sessionId
|
|
470
|
+
);
|
|
471
|
+
|
|
472
|
+
const result2 = await orchestrator.runAgent(
|
|
473
|
+
'chatbot-memory',
|
|
474
|
+
{ message: 'What is my name?' },
|
|
475
|
+
'user-123' // Same sessionId maintains context
|
|
476
|
+
);
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
**Session Management API:**
|
|
480
|
+
|
|
481
|
+
```bash
|
|
482
|
+
# Get session stats
|
|
483
|
+
curl http://localhost:3000/api/agents/sessions/stats
|
|
484
|
+
|
|
485
|
+
# Get session info
|
|
486
|
+
curl http://localhost:3000/api/agents/sessions/user-123
|
|
487
|
+
|
|
488
|
+
# Clear session
|
|
489
|
+
curl -X DELETE http://localhost:3000/api/agents/sessions/user-123
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
**Memory Management (Programmatic):**
|
|
493
|
+
|
|
494
|
+
```typescript
|
|
495
|
+
// Access memory store
|
|
496
|
+
const memory = orchestrator.memory;
|
|
497
|
+
|
|
498
|
+
// Check if session exists
|
|
499
|
+
const hasSession = memory.hasSession('user-123');
|
|
500
|
+
|
|
501
|
+
// Get message count
|
|
502
|
+
const count = memory.getMessageCount('user-123');
|
|
503
|
+
|
|
504
|
+
// Clear a session
|
|
505
|
+
memory.clearSession('user-123');
|
|
506
|
+
|
|
507
|
+
// Get total sessions
|
|
508
|
+
const totalSessions = memory.getSessionCount();
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
### Structured Output
|
|
512
|
+
|
|
513
|
+
Agents can return validated, structured JSON output by specifying an `output.schema` configuration. This leverages LangChain's `withStructuredOutput()` to ensure responses match your desired format.
|
|
514
|
+
|
|
515
|
+
**Features:**
|
|
516
|
+
- JSON Schema-based output validation
|
|
517
|
+
- Type-safe structured responses
|
|
518
|
+
- Automatic schema enforcement via LLM
|
|
519
|
+
- Validation metadata in response
|
|
520
|
+
|
|
521
|
+
**Example Agent Configuration:**
|
|
522
|
+
|
|
523
|
+
```yaml
|
|
524
|
+
# agents/sentiment-structured.agent.yaml
|
|
525
|
+
|
|
526
|
+
name: sentiment-structured
|
|
527
|
+
description: Sentiment analysis with structured output
|
|
528
|
+
llm:
|
|
529
|
+
name: default
|
|
530
|
+
temperature: 0
|
|
531
|
+
prompt:
|
|
532
|
+
system: |
|
|
533
|
+
Analyze the sentiment of the provided text and return a structured response.
|
|
534
|
+
Provide both the sentiment category and a confidence score.
|
|
535
|
+
inputVariables:
|
|
536
|
+
- text
|
|
537
|
+
output:
|
|
538
|
+
format: structured
|
|
539
|
+
schema:
|
|
540
|
+
type: object
|
|
541
|
+
properties:
|
|
542
|
+
sentiment:
|
|
543
|
+
type: string
|
|
544
|
+
enum: [positive, negative, neutral]
|
|
545
|
+
description: The overall sentiment
|
|
546
|
+
confidence:
|
|
547
|
+
type: number
|
|
548
|
+
minimum: 0
|
|
549
|
+
maximum: 1
|
|
550
|
+
description: Confidence score
|
|
551
|
+
keywords:
|
|
552
|
+
type: array
|
|
553
|
+
items:
|
|
554
|
+
type: string
|
|
555
|
+
description: Key sentiment-driving words
|
|
556
|
+
required:
|
|
557
|
+
- sentiment
|
|
558
|
+
- confidence
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
**API Usage:**
|
|
562
|
+
|
|
563
|
+
```bash
|
|
564
|
+
curl -X POST http://localhost:3000/api/agents/sentiment-structured/invoke \
|
|
565
|
+
-H "Content-Type: application/json" \
|
|
566
|
+
-d '{
|
|
567
|
+
"input": {"text": "I love this product! It works great!"}
|
|
568
|
+
}'
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
**Response:**
|
|
572
|
+
|
|
573
|
+
```json
|
|
574
|
+
{
|
|
575
|
+
"output": {
|
|
576
|
+
"sentiment": "positive",
|
|
577
|
+
"confidence": 0.95,
|
|
578
|
+
"keywords": ["love", "great"]
|
|
579
|
+
},
|
|
580
|
+
"metadata": {
|
|
581
|
+
"duration": 1234,
|
|
582
|
+
"structuredOutputValid": true
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
```
|
|
586
|
+
|
|
587
|
+
**Library Usage:**
|
|
588
|
+
|
|
589
|
+
```typescript
|
|
590
|
+
const result = await orchestrator.runAgent('sentiment-structured', {
|
|
591
|
+
text: 'This is amazing!'
|
|
592
|
+
});
|
|
593
|
+
|
|
594
|
+
// result.output is a typed object
|
|
595
|
+
console.log(result.output.sentiment); // "positive"
|
|
596
|
+
console.log(result.output.confidence); // 0.95
|
|
597
|
+
console.log(result.metadata.structuredOutputValid); // true
|
|
284
598
|
```
|
|
285
599
|
|
|
286
600
|
## Workflows
|
|
287
601
|
|
|
288
|
-
Workflows orchestrate multiple agents in a defined sequence. Define workflows in YAML files within the `workflows/` directory.
|
|
602
|
+
Workflows orchestrate multiple agents in a defined sequence. Define workflows in YAML files within the `workflows/` directory. Agent Orcha supports two workflow types: **step-based** and **LangGraph**.
|
|
603
|
+
|
|
604
|
+
### Step-Based Workflows
|
|
605
|
+
|
|
606
|
+
Traditional sequential/parallel agent orchestration with explicit step definitions.
|
|
289
607
|
|
|
290
|
-
|
|
608
|
+
#### Workflow Schema
|
|
291
609
|
|
|
292
610
|
```yaml
|
|
293
611
|
# workflows/<name>.workflow.yaml
|
|
@@ -295,6 +613,7 @@ Workflows orchestrate multiple agents in a defined sequence. Define workflows in
|
|
|
295
613
|
name: string # Unique identifier (required)
|
|
296
614
|
description: string # Human-readable description (required)
|
|
297
615
|
version: string # Semantic version (default: "1.0.0")
|
|
616
|
+
type: steps # Optional (steps is default)
|
|
298
617
|
|
|
299
618
|
input: # Input schema (required)
|
|
300
619
|
schema:
|
|
@@ -338,7 +657,7 @@ metadata: # Custom metadata (optional)
|
|
|
338
657
|
tags: [string]
|
|
339
658
|
```
|
|
340
659
|
|
|
341
|
-
|
|
660
|
+
#### Template Syntax
|
|
342
661
|
|
|
343
662
|
Access data within workflows using double curly braces:
|
|
344
663
|
|
|
@@ -349,7 +668,7 @@ Access data within workflows using double curly braces:
|
|
|
349
668
|
| `{{steps.stepId.output.nested.path}}` | Access nested output |
|
|
350
669
|
| `{{steps.stepId.metadata.duration}}` | Access step metadata |
|
|
351
670
|
|
|
352
|
-
|
|
671
|
+
#### Example Workflow
|
|
353
672
|
|
|
354
673
|
```yaml
|
|
355
674
|
# workflows/research-paper.workflow.yaml
|
|
@@ -405,23 +724,118 @@ output:
|
|
|
405
724
|
researchFindings: "{{steps.research.output}}"
|
|
406
725
|
```
|
|
407
726
|
|
|
408
|
-
|
|
727
|
+
### LangGraph Workflows
|
|
728
|
+
|
|
729
|
+
Autonomous, prompt-driven workflows using LangGraph. The agent decides which tools and agents to call based on the system prompt, without explicit step definitions.
|
|
730
|
+
|
|
731
|
+
#### LangGraph Schema
|
|
732
|
+
|
|
733
|
+
```yaml
|
|
734
|
+
# workflows/<name>.workflow.yaml
|
|
735
|
+
|
|
736
|
+
name: string # Unique identifier (required)
|
|
737
|
+
description: string # Human-readable description (required)
|
|
738
|
+
version: string # Semantic version (default: "1.0.0")
|
|
739
|
+
type: langgraph # Required for LangGraph workflows
|
|
740
|
+
|
|
741
|
+
input: # Input schema (required)
|
|
742
|
+
schema:
|
|
743
|
+
<field_name>:
|
|
744
|
+
type: string | number | boolean | array | object
|
|
745
|
+
required: boolean
|
|
746
|
+
description: string
|
|
747
|
+
|
|
748
|
+
prompt: # Prompt configuration (required)
|
|
749
|
+
system: string # System message with instructions
|
|
750
|
+
goal: string # Goal template (supports {{input.*}} interpolation)
|
|
751
|
+
|
|
752
|
+
graph: # LangGraph configuration (required)
|
|
753
|
+
model: string # LLM config name from llm.json
|
|
754
|
+
executionMode: react | single-turn # Default: react
|
|
755
|
+
tools: # Tool discovery
|
|
756
|
+
mode: all | include | exclude | none
|
|
757
|
+
sources: [mcp, knowledge, function, builtin]
|
|
758
|
+
include: [string] # For mode: include
|
|
759
|
+
exclude: [string] # For mode: exclude
|
|
760
|
+
agents: # Agent discovery
|
|
761
|
+
mode: all | include | exclude | none
|
|
762
|
+
include: [string]
|
|
763
|
+
exclude: [string]
|
|
764
|
+
maxIterations: number # Default: 10
|
|
765
|
+
timeout: number # Default: 300000
|
|
766
|
+
|
|
767
|
+
output: # Output extraction
|
|
768
|
+
<key>: "{{state.messages[-1].content}}"
|
|
769
|
+
|
|
770
|
+
config: # Optional
|
|
771
|
+
onError: stop | continue | retry
|
|
772
|
+
```
|
|
773
|
+
|
|
774
|
+
#### Execution Modes
|
|
775
|
+
|
|
776
|
+
| Mode | Behavior | Best For |
|
|
777
|
+
|------|----------|----------|
|
|
778
|
+
| `single-turn` | Calls tools once, then returns | Research, data gathering, straightforward tasks |
|
|
779
|
+
| `react` | Multiple rounds of tool calls with analysis | Complex problems, iterative refinement |
|
|
780
|
+
|
|
781
|
+
#### Example LangGraph Workflow
|
|
782
|
+
|
|
783
|
+
```yaml
|
|
784
|
+
name: langgraph-research
|
|
785
|
+
description: Autonomous research using tool discovery
|
|
786
|
+
version: "1.0.0"
|
|
787
|
+
type: langgraph
|
|
788
|
+
|
|
789
|
+
input:
|
|
790
|
+
schema:
|
|
791
|
+
topic:
|
|
792
|
+
type: string
|
|
793
|
+
required: true
|
|
794
|
+
|
|
795
|
+
prompt:
|
|
796
|
+
system: |
|
|
797
|
+
You are a research assistant with access to tools and agents.
|
|
798
|
+
Identify all tools you need, call them in parallel, then synthesize results.
|
|
799
|
+
|
|
800
|
+
If the user hasn't provided required information, use the ask_user tool
|
|
801
|
+
to request it before proceeding.
|
|
802
|
+
goal: "Research and analyze: {{input.topic}}"
|
|
803
|
+
|
|
804
|
+
graph:
|
|
805
|
+
model: default
|
|
806
|
+
executionMode: single-turn
|
|
807
|
+
tools:
|
|
808
|
+
mode: all
|
|
809
|
+
sources: [mcp, knowledge, function, builtin]
|
|
810
|
+
agents:
|
|
811
|
+
mode: all
|
|
812
|
+
maxIterations: 10
|
|
813
|
+
timeout: 300000
|
|
814
|
+
|
|
815
|
+
output:
|
|
816
|
+
analysis: "{{state.messages[-1].content}}"
|
|
817
|
+
```
|
|
818
|
+
|
|
819
|
+
## Knowledge Stores
|
|
409
820
|
|
|
410
|
-
|
|
821
|
+
Knowledge stores enable semantic search and RAG capabilities. Define knowledge stores in YAML files within the `knowledge/` directory. Two kinds are supported: **vector** (default) and **graph-rag**.
|
|
411
822
|
|
|
412
|
-
### Vector
|
|
823
|
+
### Vector Knowledge Stores
|
|
824
|
+
|
|
825
|
+
Traditional vector stores with embeddings for semantic search.
|
|
826
|
+
|
|
827
|
+
#### Vector Knowledge Schema
|
|
413
828
|
|
|
414
829
|
```yaml
|
|
415
|
-
#
|
|
830
|
+
# knowledge/<name>.knowledge.yaml
|
|
416
831
|
|
|
417
832
|
name: string # Unique identifier (required)
|
|
418
833
|
description: string # Human-readable description (required)
|
|
834
|
+
kind: vector # Optional (vector is default)
|
|
419
835
|
|
|
420
836
|
source: # Data source (required)
|
|
421
|
-
type: directory | file |
|
|
422
|
-
|
|
423
|
-
pattern: string # Glob pattern for directories
|
|
424
|
-
recursive: boolean # Recursive search (default: true)
|
|
837
|
+
type: directory | file | database | web | s3
|
|
838
|
+
# See "Data Source Types" below for type-specific fields
|
|
425
839
|
|
|
426
840
|
loader: # Document loader (required)
|
|
427
841
|
type: text | pdf | csv | json | markdown
|
|
@@ -434,7 +848,7 @@ splitter: # Text chunking (required)
|
|
|
434
848
|
embedding: string # Reference to embedding config in llm.json (default: "default")
|
|
435
849
|
|
|
436
850
|
store: # Vector store backend (required)
|
|
437
|
-
type: memory | chroma
|
|
851
|
+
type: memory | chroma | pinecone | qdrant
|
|
438
852
|
options: # Store-specific options (optional)
|
|
439
853
|
path: string # Storage path (for chroma)
|
|
440
854
|
collectionName: string # Collection name (for chroma)
|
|
@@ -445,17 +859,17 @@ search: # Search configuration (optional)
|
|
|
445
859
|
scoreThreshold: number # Minimum similarity (0-1)
|
|
446
860
|
```
|
|
447
861
|
|
|
448
|
-
|
|
862
|
+
#### Example Vector Knowledge Store
|
|
449
863
|
|
|
450
864
|
```yaml
|
|
451
|
-
#
|
|
865
|
+
# knowledge/transcripts.knowledge.yaml
|
|
452
866
|
|
|
453
867
|
name: transcripts
|
|
454
868
|
description: Meeting transcripts for context retrieval
|
|
455
869
|
|
|
456
870
|
source:
|
|
457
871
|
type: directory
|
|
458
|
-
path:
|
|
872
|
+
path: knowledge/sample-data
|
|
459
873
|
pattern: "*.txt"
|
|
460
874
|
|
|
461
875
|
loader:
|
|
@@ -466,7 +880,7 @@ splitter:
|
|
|
466
880
|
chunkSize: 1000
|
|
467
881
|
chunkOverlap: 200
|
|
468
882
|
|
|
469
|
-
embedding: default
|
|
883
|
+
embedding: default
|
|
470
884
|
|
|
471
885
|
store:
|
|
472
886
|
type: memory
|
|
@@ -476,12 +890,194 @@ search:
|
|
|
476
890
|
scoreThreshold: 0.2
|
|
477
891
|
```
|
|
478
892
|
|
|
479
|
-
**Note:**
|
|
893
|
+
**Note:** Knowledge stores are initialized on startup, loading documents and creating embeddings immediately.
|
|
894
|
+
|
|
895
|
+
### GraphRAG Knowledge Stores
|
|
896
|
+
|
|
897
|
+
GraphRAG extracts entities and relationships from documents, builds a knowledge graph, detects communities, and enables both entity-level and thematic search.
|
|
898
|
+
|
|
899
|
+
#### GraphRAG Schema
|
|
900
|
+
|
|
901
|
+
```yaml
|
|
902
|
+
# knowledge/<name>.knowledge.yaml
|
|
903
|
+
|
|
904
|
+
name: string # Unique identifier (required)
|
|
905
|
+
kind: graph-rag # Required for GraphRAG
|
|
906
|
+
description: string # Human-readable description (required)
|
|
907
|
+
|
|
908
|
+
source: # Same source types as vector
|
|
909
|
+
type: directory | file | database | web | s3
|
|
910
|
+
|
|
911
|
+
loader:
|
|
912
|
+
type: text | pdf | csv | json | markdown
|
|
913
|
+
|
|
914
|
+
splitter:
|
|
915
|
+
type: character | recursive | token | markdown
|
|
916
|
+
chunkSize: number
|
|
917
|
+
chunkOverlap: number
|
|
918
|
+
|
|
919
|
+
embedding: string # Embedding config from llm.json
|
|
920
|
+
|
|
921
|
+
graph: # Graph configuration (required)
|
|
922
|
+
extraction: # Entity extraction
|
|
923
|
+
llm: string # LLM from llm.json (default: "default")
|
|
924
|
+
entityTypes: # Optional schema (omit for auto-extraction)
|
|
925
|
+
- name: string
|
|
926
|
+
description: string
|
|
927
|
+
relationshipTypes: # Optional schema
|
|
928
|
+
- name: string
|
|
929
|
+
description: string
|
|
930
|
+
|
|
931
|
+
communities: # Community detection
|
|
932
|
+
algorithm: louvain # Currently only supported algorithm
|
|
933
|
+
resolution: number # Louvain resolution (default: 1.0)
|
|
934
|
+
minSize: number # Minimum community size (default: 2)
|
|
935
|
+
summaryLlm: string # LLM for summaries (default: "default")
|
|
936
|
+
|
|
937
|
+
store: # Graph store backend
|
|
938
|
+
type: memory | neo4j # Default: memory
|
|
939
|
+
options: {}
|
|
940
|
+
|
|
941
|
+
cache: # Graph cache
|
|
942
|
+
enabled: boolean # Default: true
|
|
943
|
+
directory: string # Default: ".graph-cache"
|
|
944
|
+
|
|
945
|
+
search: # Search configuration
|
|
946
|
+
defaultK: number # Results per search (default: 10)
|
|
947
|
+
localSearch: # Entity neighborhood search
|
|
948
|
+
maxDepth: number # Traversal depth (default: 2)
|
|
949
|
+
globalSearch: # Community-level search
|
|
950
|
+
topCommunities: number # Communities to consider (default: 5)
|
|
951
|
+
llm: string # LLM for synthesis (default: "default")
|
|
952
|
+
```
|
|
953
|
+
|
|
954
|
+
#### Example GraphRAG Knowledge Store
|
|
480
955
|
|
|
481
|
-
|
|
956
|
+
```yaml
|
|
957
|
+
# knowledge/call-center.knowledge.yaml
|
|
958
|
+
|
|
959
|
+
name: call-center-analysis
|
|
960
|
+
kind: graph-rag
|
|
961
|
+
description: GraphRAG for analyzing call center transcripts
|
|
962
|
+
|
|
963
|
+
source:
|
|
964
|
+
type: directory
|
|
965
|
+
path: knowledge/transcripts
|
|
966
|
+
pattern: "*.txt"
|
|
967
|
+
|
|
968
|
+
loader:
|
|
969
|
+
type: text
|
|
970
|
+
|
|
971
|
+
splitter:
|
|
972
|
+
type: recursive
|
|
973
|
+
chunkSize: 2000
|
|
974
|
+
chunkOverlap: 200
|
|
975
|
+
|
|
976
|
+
embedding: default
|
|
977
|
+
|
|
978
|
+
graph:
|
|
979
|
+
extraction:
|
|
980
|
+
llm: default
|
|
981
|
+
entityTypes:
|
|
982
|
+
- name: Agent
|
|
983
|
+
description: "Call center representative"
|
|
984
|
+
- name: Customer
|
|
985
|
+
description: "Person calling"
|
|
986
|
+
- name: Vehicle
|
|
987
|
+
description: "Car discussed"
|
|
988
|
+
- name: Outcome
|
|
989
|
+
description: "Result of the call"
|
|
990
|
+
relationshipTypes:
|
|
991
|
+
- name: HANDLED_BY
|
|
992
|
+
description: "Call was handled by an agent"
|
|
993
|
+
- name: INTERESTED_IN
|
|
994
|
+
description: "Customer interest in vehicle"
|
|
995
|
+
- name: RESULTED_IN
|
|
996
|
+
description: "Call resulted in outcome"
|
|
997
|
+
|
|
998
|
+
communities:
|
|
999
|
+
algorithm: louvain
|
|
1000
|
+
resolution: 1.0
|
|
1001
|
+
minSize: 2
|
|
1002
|
+
summaryLlm: default
|
|
1003
|
+
|
|
1004
|
+
store:
|
|
1005
|
+
type: memory
|
|
1006
|
+
|
|
1007
|
+
cache:
|
|
1008
|
+
enabled: true
|
|
1009
|
+
directory: .graph-cache
|
|
1010
|
+
|
|
1011
|
+
search:
|
|
1012
|
+
defaultK: 10
|
|
1013
|
+
localSearch:
|
|
1014
|
+
maxDepth: 2
|
|
1015
|
+
globalSearch:
|
|
1016
|
+
topCommunities: 5
|
|
1017
|
+
llm: default
|
|
1018
|
+
```
|
|
1019
|
+
|
|
1020
|
+
### Data Source Types
|
|
1021
|
+
|
|
1022
|
+
Agent Orcha supports multiple data source types for knowledge stores:
|
|
1023
|
+
|
|
1024
|
+
#### Directory/File Sources
|
|
1025
|
+
Load documents from local files or directories:
|
|
1026
|
+
```yaml
|
|
1027
|
+
source:
|
|
1028
|
+
type: directory
|
|
1029
|
+
path: knowledge/sample-data
|
|
1030
|
+
pattern: "*.txt"
|
|
1031
|
+
recursive: true
|
|
1032
|
+
```
|
|
1033
|
+
|
|
1034
|
+
#### Database Sources
|
|
1035
|
+
Load documents from PostgreSQL or MySQL databases:
|
|
1036
|
+
```yaml
|
|
1037
|
+
source:
|
|
1038
|
+
type: database
|
|
1039
|
+
connectionString: postgresql://user:password@localhost:5432/docs_db
|
|
1040
|
+
query: SELECT content, title, category FROM documents WHERE published = true
|
|
1041
|
+
contentColumn: content
|
|
1042
|
+
metadataColumns:
|
|
1043
|
+
- title
|
|
1044
|
+
- category
|
|
1045
|
+
batchSize: 100
|
|
1046
|
+
```
|
|
1047
|
+
|
|
1048
|
+
See `templates/knowledge/postgres-docs.knowledge.yaml` and `templates/knowledge/mysql-docs.knowledge.yaml` for complete examples.
|
|
1049
|
+
|
|
1050
|
+
#### Web Scraping Sources
|
|
1051
|
+
Load documents from websites using CSS selectors:
|
|
1052
|
+
```yaml
|
|
1053
|
+
source:
|
|
1054
|
+
type: web
|
|
1055
|
+
url: https://docs.example.com/guide/
|
|
1056
|
+
selector: article.documentation # CSS selector for targeted extraction
|
|
1057
|
+
```
|
|
1058
|
+
|
|
1059
|
+
See `templates/knowledge/web-docs.knowledge.yaml` for a complete example.
|
|
1060
|
+
|
|
1061
|
+
#### S3 Sources
|
|
1062
|
+
Load documents from AWS S3 or S3-compatible services (MinIO, Wasabi, etc.):
|
|
1063
|
+
```yaml
|
|
1064
|
+
source:
|
|
1065
|
+
type: s3
|
|
1066
|
+
bucket: my-knowledge-base
|
|
1067
|
+
prefix: documentation/
|
|
1068
|
+
region: us-east-1
|
|
1069
|
+
pattern: "*.{pdf,txt,md}"
|
|
1070
|
+
# Optional for S3-compatible services:
|
|
1071
|
+
endpoint: http://localhost:9000 # For MinIO, Wasabi, etc.
|
|
1072
|
+
forcePathStyle: true # Required for MinIO and some S3-compatible services
|
|
1073
|
+
```
|
|
1074
|
+
|
|
1075
|
+
See `templates/knowledge/s3-pdfs.knowledge.yaml` and `templates/knowledge/s3-minio.knowledge.yaml` for complete examples.
|
|
1076
|
+
|
|
1077
|
+
### Store Types
|
|
482
1078
|
|
|
483
1079
|
#### Memory (Development)
|
|
484
|
-
In-memory
|
|
1080
|
+
In-memory storage. Fast but not persistent - embeddings are recreated on every startup.
|
|
485
1081
|
|
|
486
1082
|
```yaml
|
|
487
1083
|
store:
|
|
@@ -491,14 +1087,14 @@ store:
|
|
|
491
1087
|
**Use cases:** Development, testing, small datasets
|
|
492
1088
|
|
|
493
1089
|
#### Chroma (Production - Local)
|
|
494
|
-
Persistent local
|
|
1090
|
+
Persistent local storage using Chroma. Embeddings are cached and reused across restarts.
|
|
495
1091
|
|
|
496
1092
|
```yaml
|
|
497
1093
|
store:
|
|
498
1094
|
type: chroma
|
|
499
1095
|
options:
|
|
500
1096
|
path: .chroma # Storage directory (default: .chroma)
|
|
501
|
-
collectionName: my-collection # Collection name (default:
|
|
1097
|
+
collectionName: my-collection # Collection name (default: store name)
|
|
502
1098
|
url: http://localhost:8000 # Chroma server URL (default: http://localhost:8000)
|
|
503
1099
|
```
|
|
504
1100
|
|
|
@@ -647,10 +1243,12 @@ Model Context Protocol (MCP) servers provide external tools to agents. Configure
|
|
|
647
1243
|
"version": "1.0.0",
|
|
648
1244
|
"servers": {
|
|
649
1245
|
"<server-name>": {
|
|
650
|
-
"transport": "streamable-http | stdio | sse",
|
|
1246
|
+
"transport": "streamable-http | stdio | sse | sse-only",
|
|
651
1247
|
"url": "https://server-url/mcp",
|
|
652
1248
|
"command": "node",
|
|
653
1249
|
"args": ["./mcp-server.js"],
|
|
1250
|
+
"env": { "KEY": "VALUE" },
|
|
1251
|
+
"headers": { "Authorization": "Bearer TOKEN" },
|
|
654
1252
|
"timeout": 30000,
|
|
655
1253
|
"enabled": true,
|
|
656
1254
|
"description": "Server description"
|
|
@@ -659,6 +1257,7 @@ Model Context Protocol (MCP) servers provide external tools to agents. Configure
|
|
|
659
1257
|
"globalOptions": {
|
|
660
1258
|
"throwOnLoadError": false,
|
|
661
1259
|
"prefixToolNameWithServerName": true,
|
|
1260
|
+
"additionalToolNamePrefix": "",
|
|
662
1261
|
"defaultToolTimeout": 30000
|
|
663
1262
|
}
|
|
664
1263
|
}
|
|
@@ -676,6 +1275,12 @@ Model Context Protocol (MCP) servers provide external tools to agents. Configure
|
|
|
676
1275
|
"description": "Web fetch capabilities",
|
|
677
1276
|
"timeout": 30000,
|
|
678
1277
|
"enabled": true
|
|
1278
|
+
},
|
|
1279
|
+
"filesystem": {
|
|
1280
|
+
"transport": "stdio",
|
|
1281
|
+
"command": "npx",
|
|
1282
|
+
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"],
|
|
1283
|
+
"description": "File system access"
|
|
679
1284
|
}
|
|
680
1285
|
}
|
|
681
1286
|
}
|
|
@@ -687,6 +1292,18 @@ tools:
|
|
|
687
1292
|
- mcp:fetch # All tools from "fetch" server
|
|
688
1293
|
```
|
|
689
1294
|
|
|
1295
|
+
## Agent Orcha Studio
|
|
1296
|
+
|
|
1297
|
+
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.
|
|
1298
|
+
|
|
1299
|
+
### Tabs
|
|
1300
|
+
|
|
1301
|
+
- **Agents**: Browse all configured agents, invoke them with custom input, stream responses in real-time, and manage conversation sessions
|
|
1302
|
+
- **Knowledge**: Browse and search knowledge stores (both vector and GraphRAG), view entities and communities for GraphRAG stores
|
|
1303
|
+
- **MCP**: Browse MCP servers, view available tools per server, and call tools directly
|
|
1304
|
+
- **Workflows**: Browse and execute workflows (both step-based and LangGraph), stream execution progress
|
|
1305
|
+
- **IDE**: Full in-browser file editor with file tree navigation, syntax highlighting for YAML, JSON, and JavaScript, and hot-reload on save
|
|
1306
|
+
|
|
690
1307
|
## API Reference
|
|
691
1308
|
|
|
692
1309
|
### Health Check
|
|
@@ -704,6 +1321,9 @@ Response: { "status": "ok", "timestamp": "..." }
|
|
|
704
1321
|
| GET | `/api/agents/:name` | Get agent details |
|
|
705
1322
|
| POST | `/api/agents/:name/invoke` | Run agent |
|
|
706
1323
|
| POST | `/api/agents/:name/stream` | Stream agent response (SSE) |
|
|
1324
|
+
| GET | `/api/agents/sessions/stats` | Get session statistics |
|
|
1325
|
+
| GET | `/api/agents/sessions/:sessionId` | Get session details |
|
|
1326
|
+
| DELETE | `/api/agents/sessions/:sessionId` | Clear session messages |
|
|
707
1327
|
|
|
708
1328
|
**Invoke Request:**
|
|
709
1329
|
```json
|
|
@@ -711,7 +1331,8 @@ Response: { "status": "ok", "timestamp": "..." }
|
|
|
711
1331
|
"input": {
|
|
712
1332
|
"topic": "your topic",
|
|
713
1333
|
"context": "additional context"
|
|
714
|
-
}
|
|
1334
|
+
},
|
|
1335
|
+
"sessionId": "optional-session-id"
|
|
715
1336
|
}
|
|
716
1337
|
```
|
|
717
1338
|
|
|
@@ -722,7 +1343,10 @@ Response: { "status": "ok", "timestamp": "..." }
|
|
|
722
1343
|
"metadata": {
|
|
723
1344
|
"tokensUsed": 150,
|
|
724
1345
|
"toolCalls": [],
|
|
725
|
-
"duration": 1234
|
|
1346
|
+
"duration": 1234,
|
|
1347
|
+
"sessionId": "optional-session-id",
|
|
1348
|
+
"messagesInSession": 4,
|
|
1349
|
+
"structuredOutputValid": true
|
|
726
1350
|
}
|
|
727
1351
|
}
|
|
728
1352
|
```
|
|
@@ -734,6 +1358,7 @@ Response: { "status": "ok", "timestamp": "..." }
|
|
|
734
1358
|
| GET | `/api/workflows` | List all workflows |
|
|
735
1359
|
| GET | `/api/workflows/:name` | Get workflow details |
|
|
736
1360
|
| POST | `/api/workflows/:name/run` | Execute workflow |
|
|
1361
|
+
| POST | `/api/workflows/:name/stream` | Stream workflow execution (SSE) |
|
|
737
1362
|
|
|
738
1363
|
**Run Request:**
|
|
739
1364
|
```json
|
|
@@ -758,21 +1383,24 @@ Response: { "status": "ok", "timestamp": "..." }
|
|
|
758
1383
|
"success": true
|
|
759
1384
|
},
|
|
760
1385
|
"stepResults": {
|
|
761
|
-
"research": { "output": "...", "metadata": {
|
|
762
|
-
"summarize": { "output": "...", "metadata": {
|
|
1386
|
+
"research": { "output": "...", "metadata": {} },
|
|
1387
|
+
"summarize": { "output": "...", "metadata": {} }
|
|
763
1388
|
}
|
|
764
1389
|
}
|
|
765
1390
|
```
|
|
766
1391
|
|
|
767
|
-
###
|
|
1392
|
+
### Knowledge Stores
|
|
768
1393
|
|
|
769
1394
|
| Method | Endpoint | Description |
|
|
770
1395
|
|--------|----------|-------------|
|
|
771
|
-
| GET | `/api/
|
|
772
|
-
| GET | `/api/
|
|
773
|
-
| POST | `/api/
|
|
774
|
-
| POST | `/api/
|
|
775
|
-
| POST | `/api/
|
|
1396
|
+
| GET | `/api/knowledge` | List all knowledge stores |
|
|
1397
|
+
| GET | `/api/knowledge/:name` | Get knowledge store config |
|
|
1398
|
+
| POST | `/api/knowledge/:name/search` | Search knowledge store |
|
|
1399
|
+
| POST | `/api/knowledge/:name/refresh` | Reload documents |
|
|
1400
|
+
| POST | `/api/knowledge/:name/add` | Add documents |
|
|
1401
|
+
| GET | `/api/knowledge/:name/entities` | Get GraphRAG entities |
|
|
1402
|
+
| GET | `/api/knowledge/:name/communities` | Get GraphRAG communities |
|
|
1403
|
+
| GET | `/api/knowledge/:name/edges` | Get GraphRAG edges |
|
|
776
1404
|
|
|
777
1405
|
**Search Request:**
|
|
778
1406
|
```json
|
|
@@ -782,71 +1410,151 @@ Response: { "status": "ok", "timestamp": "..." }
|
|
|
782
1410
|
}
|
|
783
1411
|
```
|
|
784
1412
|
|
|
1413
|
+
### LLM
|
|
1414
|
+
|
|
1415
|
+
| Method | Endpoint | Description |
|
|
1416
|
+
|--------|----------|-------------|
|
|
1417
|
+
| GET | `/api/llm` | List all LLM configurations |
|
|
1418
|
+
| GET | `/api/llm/:name` | Get LLM config details |
|
|
1419
|
+
| POST | `/api/llm/:name/chat` | Chat with LLM (non-streaming) |
|
|
1420
|
+
| POST | `/api/llm/:name/stream` | Chat with LLM (SSE streaming) |
|
|
1421
|
+
|
|
1422
|
+
**Chat Request:**
|
|
1423
|
+
```json
|
|
1424
|
+
{
|
|
1425
|
+
"message": "Your message"
|
|
1426
|
+
}
|
|
1427
|
+
```
|
|
1428
|
+
|
|
1429
|
+
### Functions
|
|
1430
|
+
|
|
1431
|
+
| Method | Endpoint | Description |
|
|
1432
|
+
|--------|----------|-------------|
|
|
1433
|
+
| GET | `/api/functions` | List all functions |
|
|
1434
|
+
| GET | `/api/functions/:name` | Get function details and schema |
|
|
1435
|
+
| POST | `/api/functions/:name/call` | Call a function |
|
|
1436
|
+
|
|
1437
|
+
**Call Request:**
|
|
1438
|
+
```json
|
|
1439
|
+
{
|
|
1440
|
+
"arguments": {
|
|
1441
|
+
"a": 5,
|
|
1442
|
+
"b": 3,
|
|
1443
|
+
"operation": "add"
|
|
1444
|
+
}
|
|
1445
|
+
}
|
|
1446
|
+
```
|
|
1447
|
+
|
|
1448
|
+
### MCP
|
|
1449
|
+
|
|
1450
|
+
| Method | Endpoint | Description |
|
|
1451
|
+
|--------|----------|-------------|
|
|
1452
|
+
| GET | `/api/mcp` | List all MCP servers |
|
|
1453
|
+
| GET | `/api/mcp/:name` | Get MCP server config |
|
|
1454
|
+
| GET | `/api/mcp/:name/tools` | List tools from server |
|
|
1455
|
+
| POST | `/api/mcp/:name/call` | Call a tool on server |
|
|
1456
|
+
|
|
1457
|
+
**Call Tool Request:**
|
|
1458
|
+
```json
|
|
1459
|
+
{
|
|
1460
|
+
"tool": "tool-name",
|
|
1461
|
+
"arguments": { "url": "https://example.com" }
|
|
1462
|
+
}
|
|
1463
|
+
```
|
|
1464
|
+
|
|
1465
|
+
### Files
|
|
1466
|
+
|
|
1467
|
+
| Method | Endpoint | Description |
|
|
1468
|
+
|--------|----------|-------------|
|
|
1469
|
+
| GET | `/api/files/tree` | Get project directory tree |
|
|
1470
|
+
| GET | `/api/files/read?path=...` | Read file contents |
|
|
1471
|
+
| PUT | `/api/files/write` | Write file contents |
|
|
1472
|
+
|
|
1473
|
+
**Write File Request:**
|
|
1474
|
+
```json
|
|
1475
|
+
{
|
|
1476
|
+
"path": "agents/new-agent.agent.yaml",
|
|
1477
|
+
"content": "name: new-agent\n..."
|
|
1478
|
+
}
|
|
1479
|
+
```
|
|
1480
|
+
|
|
785
1481
|
## Directory Structure
|
|
786
1482
|
|
|
1483
|
+
```
|
|
1484
|
+
my-project/
|
|
1485
|
+
├── agents/ # Agent definitions (YAML)
|
|
1486
|
+
├── workflows/ # Workflow definitions (YAML)
|
|
1487
|
+
├── knowledge/ # Knowledge store configs and data
|
|
1488
|
+
├── functions/ # Custom function tools (JavaScript)
|
|
1489
|
+
├── public/ # Web UI (Studio)
|
|
1490
|
+
│
|
|
1491
|
+
├── llm.json # LLM and embedding configurations
|
|
1492
|
+
├── mcp.json # MCP server configuration
|
|
1493
|
+
└── .env # Environment variables
|
|
1494
|
+
```
|
|
1495
|
+
|
|
1496
|
+
**Framework source structure:**
|
|
1497
|
+
|
|
787
1498
|
```
|
|
788
1499
|
agent-orcha/
|
|
789
1500
|
├── src/ # Server/API code
|
|
790
1501
|
│ ├── index.ts # Entry point
|
|
791
1502
|
│ ├── server.ts # Fastify server setup
|
|
1503
|
+
│ ├── cli/ # CLI commands
|
|
792
1504
|
│ └── routes/ # API route handlers
|
|
793
1505
|
│ ├── agents.route.ts
|
|
794
1506
|
│ ├── workflows.route.ts
|
|
795
|
-
│
|
|
1507
|
+
│ ├── knowledge.route.ts
|
|
1508
|
+
│ ├── llm.route.ts
|
|
1509
|
+
│ ├── functions.route.ts
|
|
1510
|
+
│ ├── mcp.route.ts
|
|
1511
|
+
│ └── files.route.ts
|
|
796
1512
|
│
|
|
797
1513
|
├── lib/ # Core library
|
|
798
1514
|
│ ├── orchestrator.ts # Main orchestrator class
|
|
799
1515
|
│ ├── agents/ # Agent system
|
|
800
1516
|
│ │ ├── types.ts
|
|
801
1517
|
│ │ ├── agent-loader.ts
|
|
802
|
-
│ │
|
|
1518
|
+
│ │ ├── agent-executor.ts
|
|
1519
|
+
│ │ └── structured-output-wrapper.ts
|
|
803
1520
|
│ ├── workflows/ # Workflow system
|
|
804
1521
|
│ │ ├── types.ts
|
|
805
1522
|
│ │ ├── workflow-loader.ts
|
|
806
|
-
│ │
|
|
807
|
-
│
|
|
1523
|
+
│ │ ├── workflow-executor.ts
|
|
1524
|
+
│ │ └── langgraph-executor.ts
|
|
1525
|
+
│ ├── knowledge/ # Knowledge store system
|
|
808
1526
|
│ │ ├── types.ts
|
|
809
|
-
│ │
|
|
1527
|
+
│ │ ├── knowledge-store-manager.ts
|
|
1528
|
+
│ │ └── graph-rag/
|
|
1529
|
+
│ │ └── types.ts
|
|
1530
|
+
│ ├── memory/ # Conversation memory
|
|
1531
|
+
│ │ └── conversation-store.ts
|
|
810
1532
|
│ ├── llm/ # LLM factory
|
|
811
1533
|
│ │ └── llm-factory.ts
|
|
812
1534
|
│ ├── mcp/ # MCP client
|
|
813
1535
|
│ │ └── mcp-client.ts
|
|
814
|
-
│
|
|
815
|
-
│
|
|
1536
|
+
│ ├── functions/ # Function loader
|
|
1537
|
+
│ └── tools/ # Tool registry and discovery
|
|
1538
|
+
│ ├── tool-registry.ts
|
|
1539
|
+
│ └── tool-discovery.ts
|
|
816
1540
|
│
|
|
817
|
-
├──
|
|
818
|
-
|
|
819
|
-
├──
|
|
820
|
-
|
|
821
|
-
├── public/ # Web UI
|
|
1541
|
+
├── public/ # Web UI (Studio)
|
|
1542
|
+
│ └── src/
|
|
1543
|
+
│ ├── components/ # Web components
|
|
1544
|
+
│ └── services/ # API client
|
|
822
1545
|
│
|
|
823
|
-
├──
|
|
824
|
-
|
|
825
|
-
├── llm.json # LLM and embedding configurations
|
|
826
|
-
├── mcp.json # MCP server configuration
|
|
827
|
-
└── .env # Environment variables
|
|
828
|
-
```
|
|
829
|
-
|
|
830
|
-
**Referencing in agents:**
|
|
831
|
-
|
|
832
|
-
```yaml
|
|
833
|
-
# Simple reference
|
|
834
|
-
llm: default
|
|
835
|
-
|
|
836
|
-
# With temperature override
|
|
837
|
-
llm:
|
|
838
|
-
name: default
|
|
839
|
-
temperature: 0.3
|
|
1546
|
+
├── templates/ # Project initialization templates
|
|
1547
|
+
└── docs/ # Documentation website
|
|
840
1548
|
```
|
|
841
1549
|
|
|
842
1550
|
## Tool Types
|
|
843
1551
|
|
|
844
1552
|
### Function Tools
|
|
845
|
-
Custom JavaScript
|
|
1553
|
+
Custom JavaScript functions you create in the `functions/` directory:
|
|
846
1554
|
```yaml
|
|
847
1555
|
tools:
|
|
848
1556
|
- function:fibonacci # References fibonacci.function.js
|
|
849
|
-
- function:
|
|
1557
|
+
- function:calculator
|
|
850
1558
|
```
|
|
851
1559
|
|
|
852
1560
|
### MCP Tools
|
|
@@ -856,62 +1564,21 @@ tools:
|
|
|
856
1564
|
- mcp:fetch # All tools from "fetch" server
|
|
857
1565
|
```
|
|
858
1566
|
|
|
859
|
-
###
|
|
860
|
-
Semantic search on
|
|
1567
|
+
### Knowledge Tools
|
|
1568
|
+
Semantic search on knowledge stores:
|
|
861
1569
|
```yaml
|
|
862
1570
|
tools:
|
|
863
|
-
-
|
|
1571
|
+
- knowledge:transcripts # Search "transcripts" store
|
|
1572
|
+
- knowledge:docs # Search "docs" store
|
|
864
1573
|
```
|
|
865
1574
|
|
|
866
1575
|
### Built-in Tools
|
|
867
1576
|
Framework-provided tools:
|
|
868
1577
|
```yaml
|
|
869
1578
|
tools:
|
|
870
|
-
- builtin:
|
|
871
|
-
```
|
|
872
|
-
|
|
873
|
-
## Web UI
|
|
874
|
-
|
|
875
|
-
Access the web interface at `http://localhost:3000` after starting the server. The UI provides:
|
|
876
|
-
|
|
877
|
-
- **Agents Tab**: Select and run individual agents with custom input
|
|
878
|
-
- **Workflows Tab**: Select workflows, view flow diagrams, and execute with inputs
|
|
879
|
-
|
|
880
|
-
The workflow flow diagram visualizes:
|
|
881
|
-
- Step sequence with agent names
|
|
882
|
-
- Tool badges (MCP servers, vector databases)
|
|
883
|
-
- Input/output nodes
|
|
884
|
-
|
|
885
|
-
## Publishing to npm
|
|
886
|
-
|
|
887
|
-
To publish this package to npm:
|
|
888
|
-
|
|
889
|
-
1. **Build the package:**
|
|
890
|
-
```bash
|
|
891
|
-
npm run build
|
|
1579
|
+
- builtin:ask_user # Human-in-the-loop (LangGraph only)
|
|
892
1580
|
```
|
|
893
1581
|
|
|
894
|
-
2. **Update version in package.json:**
|
|
895
|
-
```bash
|
|
896
|
-
npm version patch # or minor, or major
|
|
897
|
-
```
|
|
898
|
-
|
|
899
|
-
3. **Publish to npm:**
|
|
900
|
-
```bash
|
|
901
|
-
npm publish
|
|
902
|
-
```
|
|
903
|
-
|
|
904
|
-
The package includes:
|
|
905
|
-
- Compiled TypeScript code (`dist/`)
|
|
906
|
-
- CLI executable (`bin/cli.js`)
|
|
907
|
-
- Template files for `init` command (`templates/`)
|
|
908
|
-
- Web UI (`public/`)
|
|
909
|
-
- Type definitions
|
|
910
|
-
|
|
911
|
-
Users can then:
|
|
912
|
-
- Use as CLI: `npx agent-orcha init`
|
|
913
|
-
- Install as library: `npm install agent-orcha`
|
|
914
|
-
|
|
915
1582
|
## License
|
|
916
1583
|
|
|
917
1584
|
MIT
|