agent-orcha 0.0.1
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/LICENSE +21 -0
- package/README.md +917 -0
- package/bin/cli.js +2 -0
- package/dist/lib/agents/agent-executor.d.ts +13 -0
- package/dist/lib/agents/agent-executor.d.ts.map +1 -0
- package/dist/lib/agents/agent-executor.js +158 -0
- package/dist/lib/agents/agent-executor.js.map +1 -0
- package/dist/lib/agents/agent-loader.d.ts +13 -0
- package/dist/lib/agents/agent-loader.d.ts.map +1 -0
- package/dist/lib/agents/agent-loader.js +39 -0
- package/dist/lib/agents/agent-loader.js.map +1 -0
- package/dist/lib/agents/index.d.ts +5 -0
- package/dist/lib/agents/index.d.ts.map +1 -0
- package/dist/lib/agents/index.js +4 -0
- package/dist/lib/agents/index.js.map +1 -0
- package/dist/lib/agents/types.d.ts +140 -0
- package/dist/lib/agents/types.d.ts.map +1 -0
- package/dist/lib/agents/types.js +28 -0
- package/dist/lib/agents/types.js.map +1 -0
- package/dist/lib/functions/function-loader.d.ts +30 -0
- package/dist/lib/functions/function-loader.d.ts.map +1 -0
- package/dist/lib/functions/function-loader.js +107 -0
- package/dist/lib/functions/function-loader.js.map +1 -0
- package/dist/lib/functions/index.d.ts +3 -0
- package/dist/lib/functions/index.d.ts.map +1 -0
- package/dist/lib/functions/index.js +2 -0
- package/dist/lib/functions/index.js.map +1 -0
- package/dist/lib/functions/simple-function-wrapper.d.ts +33 -0
- package/dist/lib/functions/simple-function-wrapper.d.ts.map +1 -0
- package/dist/lib/functions/simple-function-wrapper.js +66 -0
- package/dist/lib/functions/simple-function-wrapper.js.map +1 -0
- package/dist/lib/index.d.ts +16 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +17 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/llm/index.d.ts +6 -0
- package/dist/lib/llm/index.d.ts.map +1 -0
- package/dist/lib/llm/index.js +4 -0
- package/dist/lib/llm/index.js.map +1 -0
- package/dist/lib/llm/llm-config.d.ts +138 -0
- package/dist/lib/llm/llm-config.d.ts.map +1 -0
- package/dist/lib/llm/llm-config.js +75 -0
- package/dist/lib/llm/llm-config.js.map +1 -0
- package/dist/lib/llm/llm-factory.d.ts +30 -0
- package/dist/lib/llm/llm-factory.d.ts.map +1 -0
- package/dist/lib/llm/llm-factory.js +103 -0
- package/dist/lib/llm/llm-factory.js.map +1 -0
- package/dist/lib/llm/provider-detector.d.ts +12 -0
- package/dist/lib/llm/provider-detector.d.ts.map +1 -0
- package/dist/lib/llm/provider-detector.js +46 -0
- package/dist/lib/llm/provider-detector.js.map +1 -0
- package/dist/lib/llm/types.d.ts +19 -0
- package/dist/lib/llm/types.d.ts.map +1 -0
- package/dist/lib/llm/types.js +18 -0
- package/dist/lib/llm/types.js.map +1 -0
- package/dist/lib/logger.d.ts +43 -0
- package/dist/lib/logger.d.ts.map +1 -0
- package/dist/lib/logger.js +113 -0
- package/dist/lib/logger.js.map +1 -0
- package/dist/lib/mcp/index.d.ts +4 -0
- package/dist/lib/mcp/index.d.ts.map +1 -0
- package/dist/lib/mcp/index.js +3 -0
- package/dist/lib/mcp/index.js.map +1 -0
- package/dist/lib/mcp/mcp-client.d.ts +17 -0
- package/dist/lib/mcp/mcp-client.d.ts.map +1 -0
- package/dist/lib/mcp/mcp-client.js +166 -0
- package/dist/lib/mcp/mcp-client.js.map +1 -0
- package/dist/lib/mcp/types.d.ts +146 -0
- package/dist/lib/mcp/types.d.ts.map +1 -0
- package/dist/lib/mcp/types.js +24 -0
- package/dist/lib/mcp/types.js.map +1 -0
- package/dist/lib/orchestrator.d.ts +64 -0
- package/dist/lib/orchestrator.d.ts.map +1 -0
- package/dist/lib/orchestrator.js +201 -0
- package/dist/lib/orchestrator.js.map +1 -0
- package/dist/lib/tools/built-in/index.d.ts +2 -0
- package/dist/lib/tools/built-in/index.d.ts.map +1 -0
- package/dist/lib/tools/built-in/index.js +2 -0
- package/dist/lib/tools/built-in/index.js.map +1 -0
- package/dist/lib/tools/built-in/vector-search.tool.d.ts +4 -0
- package/dist/lib/tools/built-in/vector-search.tool.d.ts.map +1 -0
- package/dist/lib/tools/built-in/vector-search.tool.js +26 -0
- package/dist/lib/tools/built-in/vector-search.tool.js.map +1 -0
- package/dist/lib/tools/index.d.ts +3 -0
- package/dist/lib/tools/index.d.ts.map +1 -0
- package/dist/lib/tools/index.js +3 -0
- package/dist/lib/tools/index.js.map +1 -0
- package/dist/lib/tools/tool-registry.d.ts +20 -0
- package/dist/lib/tools/tool-registry.d.ts.map +1 -0
- package/dist/lib/tools/tool-registry.js +76 -0
- package/dist/lib/tools/tool-registry.js.map +1 -0
- package/dist/lib/vectors/index.d.ts +5 -0
- package/dist/lib/vectors/index.d.ts.map +1 -0
- package/dist/lib/vectors/index.js +4 -0
- package/dist/lib/vectors/index.js.map +1 -0
- package/dist/lib/vectors/types.d.ts +212 -0
- package/dist/lib/vectors/types.d.ts.map +1 -0
- package/dist/lib/vectors/types.js +39 -0
- package/dist/lib/vectors/types.js.map +1 -0
- package/dist/lib/vectors/vector-store-factory.d.ts +14 -0
- package/dist/lib/vectors/vector-store-factory.d.ts.map +1 -0
- package/dist/lib/vectors/vector-store-factory.js +350 -0
- package/dist/lib/vectors/vector-store-factory.js.map +1 -0
- package/dist/lib/vectors/vector-store-manager.d.ts +18 -0
- package/dist/lib/vectors/vector-store-manager.d.ts.map +1 -0
- package/dist/lib/vectors/vector-store-manager.js +79 -0
- package/dist/lib/vectors/vector-store-manager.js.map +1 -0
- package/dist/lib/workflows/index.d.ts +5 -0
- package/dist/lib/workflows/index.d.ts.map +1 -0
- package/dist/lib/workflows/index.js +4 -0
- package/dist/lib/workflows/index.js.map +1 -0
- package/dist/lib/workflows/types.d.ts +630 -0
- package/dist/lib/workflows/types.d.ts.map +1 -0
- package/dist/lib/workflows/types.js +51 -0
- package/dist/lib/workflows/types.js.map +1 -0
- package/dist/lib/workflows/workflow-executor.d.ts +22 -0
- package/dist/lib/workflows/workflow-executor.d.ts.map +1 -0
- package/dist/lib/workflows/workflow-executor.js +276 -0
- package/dist/lib/workflows/workflow-executor.js.map +1 -0
- package/dist/lib/workflows/workflow-loader.d.ts +13 -0
- package/dist/lib/workflows/workflow-loader.d.ts.map +1 -0
- package/dist/lib/workflows/workflow-loader.js +39 -0
- package/dist/lib/workflows/workflow-loader.js.map +1 -0
- package/dist/public/index.html +762 -0
- package/dist/src/cli/commands/init.d.ts +2 -0
- package/dist/src/cli/commands/init.d.ts.map +1 -0
- package/dist/src/cli/commands/init.js +108 -0
- package/dist/src/cli/commands/init.js.map +1 -0
- package/dist/src/cli/commands/start.d.ts +3 -0
- package/dist/src/cli/commands/start.d.ts.map +1 -0
- package/dist/src/cli/commands/start.js +114 -0
- package/dist/src/cli/commands/start.js.map +1 -0
- package/dist/src/cli/index.d.ts +3 -0
- package/dist/src/cli/index.d.ts.map +1 -0
- package/dist/src/cli/index.js +59 -0
- package/dist/src/cli/index.js.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +62 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/routes/agents.route.d.ts +3 -0
- package/dist/src/routes/agents.route.d.ts.map +1 -0
- package/dist/src/routes/agents.route.js +58 -0
- package/dist/src/routes/agents.route.js.map +1 -0
- package/dist/src/routes/llm.route.d.ts +3 -0
- package/dist/src/routes/llm.route.d.ts.map +1 -0
- package/dist/src/routes/llm.route.js +97 -0
- package/dist/src/routes/llm.route.js.map +1 -0
- package/dist/src/routes/vectors.route.d.ts +3 -0
- package/dist/src/routes/vectors.route.d.ts.map +1 -0
- package/dist/src/routes/vectors.route.js +74 -0
- package/dist/src/routes/vectors.route.js.map +1 -0
- package/dist/src/routes/workflows.route.d.ts +3 -0
- package/dist/src/routes/workflows.route.d.ts.map +1 -0
- package/dist/src/routes/workflows.route.js +58 -0
- package/dist/src/routes/workflows.route.js.map +1 -0
- package/dist/src/server.d.ts +9 -0
- package/dist/src/server.d.ts.map +1 -0
- package/dist/src/server.js +34 -0
- package/dist/src/server.js.map +1 -0
- package/dist/templates/.env.example +6 -0
- package/dist/templates/README.md +234 -0
- package/dist/templates/agents/example.agent.yaml +32 -0
- package/dist/templates/agents/knowledge.agent.yaml +36 -0
- package/dist/templates/agents/math.agent.yaml +38 -0
- package/dist/templates/agents/time.agent.yaml +42 -0
- package/dist/templates/functions/README.md +195 -0
- package/dist/templates/functions/fibonacci.function.js +55 -0
- package/dist/templates/llm.json +44 -0
- package/dist/templates/mcp.json +18 -0
- package/dist/templates/vectors/example-chroma.vector.yaml +43 -0
- package/dist/templates/vectors/example.vector.yaml +28 -0
- package/dist/templates/vectors/sample-data/example-document.txt +15 -0
- package/dist/templates/workflows/example.workflow.yaml +79 -0
- package/package.json +77 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export const vectorsRoutes = async (fastify) => {
|
|
2
|
+
fastify.get('/', async () => {
|
|
3
|
+
const configs = fastify.orchestrator.vectors.listConfigs();
|
|
4
|
+
return configs.map((config) => ({
|
|
5
|
+
name: config.name,
|
|
6
|
+
description: config.description,
|
|
7
|
+
source: config.source,
|
|
8
|
+
store: config.store.type,
|
|
9
|
+
}));
|
|
10
|
+
});
|
|
11
|
+
fastify.get('/:name', async (request, reply) => {
|
|
12
|
+
const config = fastify.orchestrator.vectors.getConfig(request.params.name);
|
|
13
|
+
if (!config) {
|
|
14
|
+
return reply.status(404).send({
|
|
15
|
+
error: 'Vector store not found',
|
|
16
|
+
name: request.params.name,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return config;
|
|
20
|
+
});
|
|
21
|
+
fastify.post('/:name/search', async (request, reply) => {
|
|
22
|
+
const { name } = request.params;
|
|
23
|
+
const { query, k } = request.body;
|
|
24
|
+
try {
|
|
25
|
+
const results = await fastify.orchestrator.searchVectors(name, query, k);
|
|
26
|
+
return { results };
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
30
|
+
if (message.includes('not found')) {
|
|
31
|
+
return reply.status(404).send({ error: message });
|
|
32
|
+
}
|
|
33
|
+
return reply.status(500).send({ error: message });
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
fastify.post('/:name/refresh', async (request, reply) => {
|
|
37
|
+
const { name } = request.params;
|
|
38
|
+
try {
|
|
39
|
+
await fastify.orchestrator.vectors.refresh(name);
|
|
40
|
+
return { success: true };
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
44
|
+
return reply.status(500).send({ error: message });
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
fastify.post('/:name/add', async (request, reply) => {
|
|
48
|
+
const { name } = request.params;
|
|
49
|
+
const { documents } = request.body;
|
|
50
|
+
try {
|
|
51
|
+
const store = fastify.orchestrator.vectors.get(name);
|
|
52
|
+
if (!store) {
|
|
53
|
+
await fastify.orchestrator.vectors.initialize(name);
|
|
54
|
+
const initializedStore = fastify.orchestrator.vectors.get(name);
|
|
55
|
+
if (!initializedStore) {
|
|
56
|
+
return reply.status(404).send({
|
|
57
|
+
error: 'Vector store not found',
|
|
58
|
+
name,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
await initializedStore.addDocuments(documents);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
await store.addDocuments(documents);
|
|
65
|
+
}
|
|
66
|
+
return { success: true, added: documents.length };
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
70
|
+
return reply.status(500).send({ error: message });
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=vectors.route.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vectors.route.js","sourceRoot":"","sources":["../../../src/routes/vectors.route.ts"],"names":[],"mappings":"AAkBA,MAAM,CAAC,M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version":3,"file":"workflows.route.d.ts","sourceRoot":"","sources":["../../../src/routes/workflows.route.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAUlD,eAAO,MAAM,eAAe,EAAE,kBAwE7B,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export const workflowsRoutes = async (fastify) => {
|
|
2
|
+
fastify.get('/', async () => {
|
|
3
|
+
const workflows = fastify.orchestrator.workflows.list();
|
|
4
|
+
return workflows.map((workflow) => ({
|
|
5
|
+
name: workflow.name,
|
|
6
|
+
description: workflow.description,
|
|
7
|
+
version: workflow.version,
|
|
8
|
+
steps: workflow.steps.length,
|
|
9
|
+
inputSchema: workflow.input.schema,
|
|
10
|
+
}));
|
|
11
|
+
});
|
|
12
|
+
fastify.get('/:name', async (request, reply) => {
|
|
13
|
+
const workflow = fastify.orchestrator.workflows.get(request.params.name);
|
|
14
|
+
if (!workflow) {
|
|
15
|
+
return reply.status(404).send({
|
|
16
|
+
error: 'Workflow not found',
|
|
17
|
+
name: request.params.name,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return workflow;
|
|
21
|
+
});
|
|
22
|
+
fastify.post('/:name/run', async (request, reply) => {
|
|
23
|
+
const { name } = request.params;
|
|
24
|
+
const { input } = request.body;
|
|
25
|
+
try {
|
|
26
|
+
const result = await fastify.orchestrator.runWorkflow(name, input);
|
|
27
|
+
return result;
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
31
|
+
if (message.includes('not found')) {
|
|
32
|
+
return reply.status(404).send({ error: message });
|
|
33
|
+
}
|
|
34
|
+
return reply.status(500).send({ error: message });
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
fastify.post('/:name/stream', async (request, reply) => {
|
|
38
|
+
const { name } = request.params;
|
|
39
|
+
const { input } = request.body;
|
|
40
|
+
reply.raw.setHeader('Content-Type', 'text/event-stream');
|
|
41
|
+
reply.raw.setHeader('Cache-Control', 'no-cache');
|
|
42
|
+
reply.raw.setHeader('Connection', 'keep-alive');
|
|
43
|
+
try {
|
|
44
|
+
const stream = fastify.orchestrator.streamWorkflow(name, input);
|
|
45
|
+
for await (const update of stream) {
|
|
46
|
+
reply.raw.write(`data: ${JSON.stringify(update)}\n\n`);
|
|
47
|
+
}
|
|
48
|
+
reply.raw.write('data: [DONE]\n\n');
|
|
49
|
+
reply.raw.end();
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
53
|
+
reply.raw.write(`data: ${JSON.stringify({ type: 'error', error: message })}\n\n`);
|
|
54
|
+
reply.raw.end();
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=workflows.route.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflows.route.js","sourceRoot":"","sources":["../../../src/routes/workflows.route.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,MAAM,eAAe,GAAuB,KAAK,EAAE,OAAO,EAAE,EAAE;IACnE,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,IAAI,EAAE;QAC1B,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;QACxD,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;YAClC,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,WAAW,EAAE,QAAQ,CAAC,WAAW;YACjC,OAAO,EAAE,QAAQ,CAAC,OAAO;YACzB,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM;YAC5B,WAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM;SACnC,CAAC,CAAC,CAAC;IACN,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CAA6B,QAAQ,EAAE,KAAK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AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type FastifyInstance } from 'fastify';
|
|
2
|
+
import type { Orchestrator } from '../lib/index.js';
|
|
3
|
+
declare module 'fastify' {
|
|
4
|
+
interface FastifyInstance {
|
|
5
|
+
orchestrator: Orchestrator;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export declare function createServer(orchestrator: Orchestrator): Promise<FastifyInstance>;
|
|
9
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"AAEA,OAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AAGxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AASpD,OAAO,QAAQ,SAAS,CAAC;IACvB,UAAU,eAAe;QACvB,YAAY,EAAE,YAAY,CAAC;KAC5B;CACF;AAED,wBAAsB,YAAY,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,eAAe,CAAC,CA2BvF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as path from 'path';
|
|
2
|
+
import { fileURLToPath } from 'url';
|
|
3
|
+
import Fastify from 'fastify';
|
|
4
|
+
import cors from '@fastify/cors';
|
|
5
|
+
import fastifyStatic from '@fastify/static';
|
|
6
|
+
import { agentsRoutes } from './routes/agents.route.js';
|
|
7
|
+
import { workflowsRoutes } from './routes/workflows.route.js';
|
|
8
|
+
import { vectorsRoutes } from './routes/vectors.route.js';
|
|
9
|
+
import { llmRoutes } from './routes/llm.route.js';
|
|
10
|
+
import { getPinoConfig } from '../lib/logger.js';
|
|
11
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
export async function createServer(orchestrator) {
|
|
13
|
+
const fastify = Fastify({
|
|
14
|
+
logger: getPinoConfig(),
|
|
15
|
+
disableRequestLogging: true,
|
|
16
|
+
});
|
|
17
|
+
await fastify.register(cors, {
|
|
18
|
+
origin: process.env['CORS_ORIGIN'] ?? true,
|
|
19
|
+
});
|
|
20
|
+
await fastify.register(fastifyStatic, {
|
|
21
|
+
root: path.join(__dirname, '..', 'public'),
|
|
22
|
+
prefix: '/',
|
|
23
|
+
});
|
|
24
|
+
fastify.decorate('orchestrator', orchestrator);
|
|
25
|
+
fastify.get('/health', async () => {
|
|
26
|
+
return { status: 'ok', timestamp: new Date().toISOString() };
|
|
27
|
+
});
|
|
28
|
+
await fastify.register(agentsRoutes, { prefix: '/api/agents' });
|
|
29
|
+
await fastify.register(workflowsRoutes, { prefix: '/api/workflows' });
|
|
30
|
+
await fastify.register(vectorsRoutes, { prefix: '/api/vectors' });
|
|
31
|
+
await fastify.register(llmRoutes, { prefix: '/api/llm' });
|
|
32
|
+
return fastify;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,OAAiC,MAAM,SAAS,CAAC;AACxD,OAAO,IAAI,MAAM,eAAe,CAAC;AACjC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC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agent Orchestrator - a TypeScript framework for building and orchestrating multi-agent AI systems.
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
### 1. Configure LLM Settings
|
|
8
|
+
|
|
9
|
+
Edit `llm.json` to configure your LLM providers:
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"version": "1.0",
|
|
14
|
+
"models": {
|
|
15
|
+
"default": {
|
|
16
|
+
"provider": "openai",
|
|
17
|
+
"baseUrl": "http://localhost:1234/v1", // For local LLMs (LM Studio, Ollama)
|
|
18
|
+
"apiKey": "not-needed",
|
|
19
|
+
"model": "your-model-name",
|
|
20
|
+
"temperature": 0.7
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"embeddings": {
|
|
24
|
+
"default": {
|
|
25
|
+
"provider": "openai",
|
|
26
|
+
"baseUrl": "http://localhost:1234/v1",
|
|
27
|
+
"apiKey": "not-needed",
|
|
28
|
+
"model": "text-embedding-model"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**Supported Providers:**
|
|
35
|
+
- Local: LM Studio (`http://localhost:1234/v1`), Ollama (`http://localhost:11434/v1`)
|
|
36
|
+
- Cloud: OpenAI, Google Gemini, Anthropic Claude
|
|
37
|
+
|
|
38
|
+
### 2. Start the Server
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npx agent-orcha start
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The server will run at `http://localhost:3000`
|
|
45
|
+
|
|
46
|
+
### 3. Test Your Agent
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
curl -X POST http://localhost:3000/api/agents/example/invoke \
|
|
50
|
+
-H "Content-Type: application/json" \
|
|
51
|
+
-d '{"input": {"query": "Hello, how are you?"}}'
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Project Structure
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
.
|
|
58
|
+
├── agents/ # Agent definitions (YAML)
|
|
59
|
+
├── workflows/ # Workflow definitions (YAML)
|
|
60
|
+
├── vectors/ # Vector store configs and data
|
|
61
|
+
├── functions/ # Custom function tools (JavaScript)
|
|
62
|
+
├── llm.json # LLM and embedding configurations
|
|
63
|
+
├── mcp.json # MCP server configurations (optional)
|
|
64
|
+
└── .env # Environment variables (optional)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Creating Agents
|
|
68
|
+
|
|
69
|
+
Create a new file in `agents/` directory:
|
|
70
|
+
|
|
71
|
+
```yaml
|
|
72
|
+
# agents/my-agent.agent.yaml
|
|
73
|
+
|
|
74
|
+
name: my-agent
|
|
75
|
+
description: Description of what this agent does
|
|
76
|
+
version: "1.0.0"
|
|
77
|
+
|
|
78
|
+
llm:
|
|
79
|
+
name: default
|
|
80
|
+
temperature: 0.7
|
|
81
|
+
|
|
82
|
+
prompt:
|
|
83
|
+
system: |
|
|
84
|
+
You are a helpful assistant that...
|
|
85
|
+
inputVariables:
|
|
86
|
+
- query
|
|
87
|
+
|
|
88
|
+
tools: []
|
|
89
|
+
|
|
90
|
+
output:
|
|
91
|
+
format: text
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Creating Workflows
|
|
95
|
+
|
|
96
|
+
Create a new file in `workflows/` directory:
|
|
97
|
+
|
|
98
|
+
```yaml
|
|
99
|
+
# workflows/my-workflow.workflow.yaml
|
|
100
|
+
|
|
101
|
+
name: my-workflow
|
|
102
|
+
description: Description of the workflow
|
|
103
|
+
version: "1.0.0"
|
|
104
|
+
|
|
105
|
+
input:
|
|
106
|
+
schema:
|
|
107
|
+
topic:
|
|
108
|
+
type: string
|
|
109
|
+
required: true
|
|
110
|
+
|
|
111
|
+
steps:
|
|
112
|
+
- id: step1
|
|
113
|
+
agent: my-agent
|
|
114
|
+
input:
|
|
115
|
+
query: "{{input.topic}}"
|
|
116
|
+
output:
|
|
117
|
+
key: result
|
|
118
|
+
|
|
119
|
+
output:
|
|
120
|
+
result: "{{steps.step1.output}}"
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Using Vector Stores
|
|
124
|
+
|
|
125
|
+
1. Add documents to `vectors/sample-data/`
|
|
126
|
+
2. Configure vector store in `vectors/`:
|
|
127
|
+
|
|
128
|
+
```yaml
|
|
129
|
+
# vectors/my-knowledge.vector.yaml
|
|
130
|
+
|
|
131
|
+
name: my-knowledge
|
|
132
|
+
description: My knowledge base
|
|
133
|
+
|
|
134
|
+
source:
|
|
135
|
+
type: directory
|
|
136
|
+
path: vectors/sample-data
|
|
137
|
+
pattern: "*.txt"
|
|
138
|
+
|
|
139
|
+
loader:
|
|
140
|
+
type: text
|
|
141
|
+
|
|
142
|
+
splitter:
|
|
143
|
+
type: character
|
|
144
|
+
chunkSize: 1000
|
|
145
|
+
chunkOverlap: 200
|
|
146
|
+
|
|
147
|
+
embedding: default
|
|
148
|
+
|
|
149
|
+
store:
|
|
150
|
+
type: memory # Use 'chroma' for persistent storage
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**For persistent storage with Chroma:**
|
|
154
|
+
```yaml
|
|
155
|
+
store:
|
|
156
|
+
type: chroma
|
|
157
|
+
options:
|
|
158
|
+
path: .chroma # Where to store data
|
|
159
|
+
collectionName: my-knowledge # Collection name
|
|
160
|
+
url: http://localhost:8000 # Chroma server URL
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
**Note:** To use Chroma, run the server:
|
|
164
|
+
```bash
|
|
165
|
+
docker run -p 8000:8000 chromadb/chroma
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
3. Reference in agent:
|
|
169
|
+
|
|
170
|
+
```yaml
|
|
171
|
+
tools:
|
|
172
|
+
- vector:my-knowledge
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Using MCP Servers
|
|
176
|
+
|
|
177
|
+
Configure MCP servers in `mcp.json`:
|
|
178
|
+
|
|
179
|
+
```json
|
|
180
|
+
{
|
|
181
|
+
"servers": {
|
|
182
|
+
"fetch": {
|
|
183
|
+
"transport": "streamable-http",
|
|
184
|
+
"url": "https://remote.mcpservers.org/fetch/mcp",
|
|
185
|
+
"enabled": true
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Reference in agent:
|
|
192
|
+
|
|
193
|
+
```yaml
|
|
194
|
+
tools:
|
|
195
|
+
- mcp:fetch
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## API Endpoints
|
|
199
|
+
|
|
200
|
+
- `GET /api/agents` - List all agents
|
|
201
|
+
- `POST /api/agents/:name/invoke` - Invoke an agent
|
|
202
|
+
- `GET /api/workflows` - List all workflows
|
|
203
|
+
- `POST /api/workflows/:name/run` - Run a workflow
|
|
204
|
+
- `POST /api/vectors/:name/search` - Search vector store
|
|
205
|
+
|
|
206
|
+
## Web UI
|
|
207
|
+
|
|
208
|
+
Open `http://localhost:3000` in your browser to access the interactive UI for testing agents and workflows.
|
|
209
|
+
|
|
210
|
+
## Using as a Library
|
|
211
|
+
|
|
212
|
+
You can also use Agent Orchestrator programmatically:
|
|
213
|
+
|
|
214
|
+
```javascript
|
|
215
|
+
import { Orchestrator } from 'agent-orcha';
|
|
216
|
+
|
|
217
|
+
const orchestrator = new Orchestrator({ projectRoot: '.' });
|
|
218
|
+
await orchestrator.initialize();
|
|
219
|
+
|
|
220
|
+
// Invoke an agent
|
|
221
|
+
const result = await orchestrator.agents.invoke('my-agent', {
|
|
222
|
+
query: 'Hello world'
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
console.log(result.output);
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
## Documentation
|
|
229
|
+
|
|
230
|
+
Full documentation: https://github.com/ddalcu/agent-orcha
|
|
231
|
+
|
|
232
|
+
## License
|
|
233
|
+
|
|
234
|
+
MIT
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: example
|
|
2
|
+
description: An example agent that demonstrates the basic structure
|
|
3
|
+
version: "1.0.0"
|
|
4
|
+
|
|
5
|
+
llm:
|
|
6
|
+
name: default
|
|
7
|
+
temperature: 0.7
|
|
8
|
+
|
|
9
|
+
prompt:
|
|
10
|
+
system: |
|
|
11
|
+
You are a helpful AI assistant.
|
|
12
|
+
|
|
13
|
+
When responding to user queries:
|
|
14
|
+
1. Be clear and concise
|
|
15
|
+
2. Use tools when available to enhance your responses
|
|
16
|
+
3. Provide accurate information
|
|
17
|
+
inputVariables:
|
|
18
|
+
- query
|
|
19
|
+
|
|
20
|
+
tools: []
|
|
21
|
+
# Add tools here, for example:
|
|
22
|
+
# - mcp:fetch # MCP server tools
|
|
23
|
+
# - vector:knowledge # Vector store search
|
|
24
|
+
# - function:calculator # Custom function
|
|
25
|
+
|
|
26
|
+
output:
|
|
27
|
+
format: text
|
|
28
|
+
|
|
29
|
+
metadata:
|
|
30
|
+
category: general
|
|
31
|
+
tags:
|
|
32
|
+
- example
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
name: knowledge
|
|
2
|
+
description: An agent that searches a knowledge base using vector store for semantic search
|
|
3
|
+
version: "1.0.0"
|
|
4
|
+
|
|
5
|
+
llm:
|
|
6
|
+
name: default
|
|
7
|
+
temperature: 0.5
|
|
8
|
+
|
|
9
|
+
prompt:
|
|
10
|
+
system: |
|
|
11
|
+
You are a knowledgeable assistant with access to a vector database.
|
|
12
|
+
|
|
13
|
+
When users ask questions:
|
|
14
|
+
1. Search your knowledge base using the vector store
|
|
15
|
+
2. Find relevant information based on semantic similarity
|
|
16
|
+
3. Provide accurate answers based on the retrieved information
|
|
17
|
+
4. Cite or reference the information you found
|
|
18
|
+
|
|
19
|
+
If you cannot find relevant information in your knowledge base,
|
|
20
|
+
clearly state that and provide general knowledge if appropriate.
|
|
21
|
+
inputVariables:
|
|
22
|
+
- query
|
|
23
|
+
|
|
24
|
+
tools:
|
|
25
|
+
- vector:example # Reference to the example vector store
|
|
26
|
+
|
|
27
|
+
output:
|
|
28
|
+
format: text
|
|
29
|
+
|
|
30
|
+
metadata:
|
|
31
|
+
category: knowledge
|
|
32
|
+
tags:
|
|
33
|
+
- rag
|
|
34
|
+
- vector-search
|
|
35
|
+
- knowledge-base
|
|
36
|
+
- example
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: math
|
|
2
|
+
description: An agent that can calculate Fibonacci numbers using the fibonacci function
|
|
3
|
+
version: "1.0.0"
|
|
4
|
+
|
|
5
|
+
llm:
|
|
6
|
+
name: default
|
|
7
|
+
temperature: 0.3
|
|
8
|
+
|
|
9
|
+
prompt:
|
|
10
|
+
system: |
|
|
11
|
+
You are a mathematical assistant specialized in Fibonacci numbers.
|
|
12
|
+
|
|
13
|
+
When users ask about Fibonacci numbers:
|
|
14
|
+
1. Parse the index from their query (0-based indexing)
|
|
15
|
+
2. Use the fibonacci function with parameter n to calculate the result
|
|
16
|
+
3. Return the result in a clear, formatted way
|
|
17
|
+
|
|
18
|
+
The fibonacci function returns the nth Fibonacci number.
|
|
19
|
+
Examples:
|
|
20
|
+
- "What is the 10th Fibonacci number?" -> Use n: 10
|
|
21
|
+
- "Calculate Fibonacci of 7" -> Use n: 7
|
|
22
|
+
|
|
23
|
+
If the user's query is not about Fibonacci numbers, politely inform them that you specialize in Fibonacci calculations.
|
|
24
|
+
inputVariables:
|
|
25
|
+
- query
|
|
26
|
+
|
|
27
|
+
tools:
|
|
28
|
+
- function:fibonacci # Reference to the fibonacci function
|
|
29
|
+
|
|
30
|
+
output:
|
|
31
|
+
format: text
|
|
32
|
+
|
|
33
|
+
metadata:
|
|
34
|
+
category: mathematics
|
|
35
|
+
tags:
|
|
36
|
+
- math
|
|
37
|
+
- fibonacci
|
|
38
|
+
- example
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: time
|
|
2
|
+
description: An agent that fetches current time information for specific timezones using web APIs
|
|
3
|
+
version: "1.0.0"
|
|
4
|
+
|
|
5
|
+
llm:
|
|
6
|
+
name: default
|
|
7
|
+
temperature: 0.3
|
|
8
|
+
|
|
9
|
+
prompt:
|
|
10
|
+
system: |
|
|
11
|
+
You are a time information assistant with access to web fetch capabilities.
|
|
12
|
+
|
|
13
|
+
When users ask for time information:
|
|
14
|
+
1. Use the fetch tool to get current time from worldtimeapi.org
|
|
15
|
+
2. For East Coast USA, use the timezone: America/New_York
|
|
16
|
+
3. Parse the JSON response and extract the datetime information
|
|
17
|
+
4. Format the time in a user-friendly way
|
|
18
|
+
|
|
19
|
+
API endpoint format: http://worldtimeapi.org/api/timezone/America/New_York
|
|
20
|
+
|
|
21
|
+
The response will include:
|
|
22
|
+
- datetime: The current date and time
|
|
23
|
+
- timezone: The timezone name
|
|
24
|
+
- utc_offset: The UTC offset
|
|
25
|
+
|
|
26
|
+
Present the time clearly with the timezone information.
|
|
27
|
+
inputVariables:
|
|
28
|
+
- timezone
|
|
29
|
+
|
|
30
|
+
tools:
|
|
31
|
+
- mcp:fetch # Reference to the MCP fetch server
|
|
32
|
+
|
|
33
|
+
output:
|
|
34
|
+
format: text
|
|
35
|
+
|
|
36
|
+
metadata:
|
|
37
|
+
category: utilities
|
|
38
|
+
tags:
|
|
39
|
+
- time
|
|
40
|
+
- fetch
|
|
41
|
+
- api
|
|
42
|
+
- example
|