voyageai-cli 1.28.0 → 1.29.0
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/package.json +2 -1
- package/src/commands/app.js +15 -0
- package/src/commands/playground.js +638 -7
- package/src/commands/workflow.js +417 -14
- package/src/lib/explanations.js +88 -0
- package/src/lib/npm-utils.js +265 -0
- package/src/lib/workflow-registry.js +416 -0
- package/src/lib/workflow-scaffold.js +319 -0
- package/src/lib/workflow.js +433 -7
- package/src/playground/announcements.md +71 -0
- package/src/playground/icons/V.png +0 -0
- package/src/playground/index.html +2204 -94
- package/src/workflows/consistency-check.json +4 -0
- package/src/workflows/cost-analysis.json +4 -0
- package/src/workflows/enrich-and-ingest.json +56 -0
- package/src/workflows/intelligent-ingest.json +66 -0
- package/src/workflows/kb-health-report.json +45 -0
- package/src/workflows/multi-collection-search.json +4 -0
- package/src/workflows/research-and-summarize.json +4 -0
- package/src/workflows/search-with-fallback.json +66 -0
- package/src/workflows/smart-ingest.json +4 -0
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
"name": "Consistency Check",
|
|
4
4
|
"description": "Compare content about the same topic across two collections using semantic similarity",
|
|
5
5
|
"version": "1.0.0",
|
|
6
|
+
"branding": {
|
|
7
|
+
"icon": "check-circle",
|
|
8
|
+
"color": "#166534"
|
|
9
|
+
},
|
|
6
10
|
"inputs": {
|
|
7
11
|
"topic": {
|
|
8
12
|
"type": "string",
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "enrich-and-ingest",
|
|
3
|
+
"description": "Fetch external metadata, enrich document, then ingest",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"branding": {
|
|
6
|
+
"icon": "database",
|
|
7
|
+
"color": "#15803D"
|
|
8
|
+
},
|
|
9
|
+
"inputs": {
|
|
10
|
+
"document_url": { "type": "string", "required": true, "description": "URL to fetch document metadata from" },
|
|
11
|
+
"text": { "type": "string", "required": true, "description": "Document text to ingest" }
|
|
12
|
+
},
|
|
13
|
+
"steps": [
|
|
14
|
+
{
|
|
15
|
+
"id": "fetch_metadata",
|
|
16
|
+
"tool": "http",
|
|
17
|
+
"name": "Fetch document metadata",
|
|
18
|
+
"inputs": {
|
|
19
|
+
"url": "{{ inputs.document_url }}",
|
|
20
|
+
"method": "GET",
|
|
21
|
+
"timeout": 5000
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"id": "store",
|
|
26
|
+
"tool": "ingest",
|
|
27
|
+
"name": "Ingest with metadata",
|
|
28
|
+
"inputs": {
|
|
29
|
+
"text": "{{ inputs.text }}",
|
|
30
|
+
"source": "{{ fetch_metadata.output.body.title }}",
|
|
31
|
+
"metadata": {
|
|
32
|
+
"author": "{{ fetch_metadata.output.body.author }}",
|
|
33
|
+
"category": "{{ fetch_metadata.output.body.category }}",
|
|
34
|
+
"fetchedAt": "{{ fetch_metadata.output.body.timestamp }}"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"id": "notify",
|
|
40
|
+
"tool": "http",
|
|
41
|
+
"name": "Notify webhook",
|
|
42
|
+
"inputs": {
|
|
43
|
+
"url": "https://hooks.slack.com/services/T00/B00/xxx",
|
|
44
|
+
"method": "POST",
|
|
45
|
+
"body": {
|
|
46
|
+
"text": "Ingested document — {{ store.output.chunks }} chunks"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"continueOnError": true
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"output": {
|
|
53
|
+
"source": "{{ fetch_metadata.output.body.title }}",
|
|
54
|
+
"chunks": "{{ store.output.chunks }}"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "intelligent-ingest",
|
|
3
|
+
"description": "Chunk, deduplicate, and selectively ingest documents",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"branding": {
|
|
6
|
+
"icon": "brain",
|
|
7
|
+
"color": "#0D9488"
|
|
8
|
+
},
|
|
9
|
+
"inputs": {
|
|
10
|
+
"text": { "type": "string", "required": true, "description": "Document text to process" },
|
|
11
|
+
"source": { "type": "string", "required": true, "description": "Source identifier" },
|
|
12
|
+
"similarity_threshold": { "type": "number", "default": 0.92, "description": "Similarity threshold for deduplication" }
|
|
13
|
+
},
|
|
14
|
+
"defaults": { "db": "myapp", "collection": "knowledge" },
|
|
15
|
+
"steps": [
|
|
16
|
+
{
|
|
17
|
+
"id": "split",
|
|
18
|
+
"tool": "chunk",
|
|
19
|
+
"name": "Chunk the document",
|
|
20
|
+
"inputs": {
|
|
21
|
+
"text": "{{ inputs.text }}",
|
|
22
|
+
"strategy": "recursive",
|
|
23
|
+
"size": 512,
|
|
24
|
+
"source": "{{ inputs.source }}"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"id": "filter_short",
|
|
29
|
+
"tool": "filter",
|
|
30
|
+
"name": "Remove short chunks",
|
|
31
|
+
"inputs": {
|
|
32
|
+
"array": "{{ split.output.chunks }}",
|
|
33
|
+
"condition": "item.charCount > 100"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "check_each",
|
|
38
|
+
"tool": "loop",
|
|
39
|
+
"name": "Check novelty of each chunk",
|
|
40
|
+
"inputs": {
|
|
41
|
+
"items": "{{ filter_short.output.results }}",
|
|
42
|
+
"as": "chunk",
|
|
43
|
+
"step": {
|
|
44
|
+
"tool": "search",
|
|
45
|
+
"inputs": {
|
|
46
|
+
"query": "{{ chunk.content }}",
|
|
47
|
+
"limit": 1
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"id": "embed_novel",
|
|
54
|
+
"tool": "template",
|
|
55
|
+
"name": "Summarize results",
|
|
56
|
+
"inputs": {
|
|
57
|
+
"text": "Processed {{ split.output.totalChunks }} chunks, {{ filter_short.output.resultCount }} passed filter, {{ check_each.output.iterations }} checked for novelty"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"output": {
|
|
62
|
+
"totalChunks": "{{ split.output.totalChunks }}",
|
|
63
|
+
"filteredChunks": "{{ filter_short.output.resultCount }}",
|
|
64
|
+
"summary": "{{ embed_novel.output.text }}"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "kb-health-report",
|
|
3
|
+
"description": "Analyze knowledge base health: counts, coverage, staleness",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"branding": {
|
|
6
|
+
"icon": "activity",
|
|
7
|
+
"color": "#DC2626"
|
|
8
|
+
},
|
|
9
|
+
"inputs": {
|
|
10
|
+
"test_queries": {
|
|
11
|
+
"type": "array",
|
|
12
|
+
"default": ["authentication", "deployment", "error handling", "configuration"],
|
|
13
|
+
"description": "Queries to test coverage"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"defaults": { "db": "myapp", "collection": "knowledge" },
|
|
17
|
+
"steps": [
|
|
18
|
+
{
|
|
19
|
+
"id": "coverage_check",
|
|
20
|
+
"tool": "loop",
|
|
21
|
+
"name": "Test query coverage",
|
|
22
|
+
"inputs": {
|
|
23
|
+
"items": "{{ inputs.test_queries }}",
|
|
24
|
+
"as": "test_query",
|
|
25
|
+
"step": {
|
|
26
|
+
"tool": "query",
|
|
27
|
+
"inputs": {
|
|
28
|
+
"query": "{{ test_query }}",
|
|
29
|
+
"limit": 3
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"id": "report",
|
|
36
|
+
"tool": "generate",
|
|
37
|
+
"name": "Generate health report",
|
|
38
|
+
"inputs": {
|
|
39
|
+
"prompt": "Analyze this knowledge base health data and write a brief report.",
|
|
40
|
+
"context": "Query coverage tests: {{ coverage_check.output.results }}"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"output": "{{ report.output }}"
|
|
45
|
+
}
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
"name": "Multi-Collection Search",
|
|
4
4
|
"description": "Search multiple collections, merge results, and rerank for best relevance",
|
|
5
5
|
"version": "1.0.0",
|
|
6
|
+
"branding": {
|
|
7
|
+
"icon": "layers",
|
|
8
|
+
"color": "#0EA5E9"
|
|
9
|
+
},
|
|
6
10
|
"inputs": {
|
|
7
11
|
"query": {
|
|
8
12
|
"type": "string",
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "search-with-fallback",
|
|
3
|
+
"description": "Search primary collection, fall back to secondary if empty",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"branding": {
|
|
6
|
+
"icon": "search",
|
|
7
|
+
"color": "#0891B2"
|
|
8
|
+
},
|
|
9
|
+
"inputs": {
|
|
10
|
+
"query": { "type": "string", "required": true, "description": "Search query" },
|
|
11
|
+
"primary_collection": { "type": "string", "default": "api_docs", "description": "Primary collection to search" },
|
|
12
|
+
"fallback_collection": { "type": "string", "default": "knowledge", "description": "Fallback collection if primary returns no results" }
|
|
13
|
+
},
|
|
14
|
+
"steps": [
|
|
15
|
+
{
|
|
16
|
+
"id": "primary_search",
|
|
17
|
+
"tool": "query",
|
|
18
|
+
"name": "Search primary collection",
|
|
19
|
+
"inputs": {
|
|
20
|
+
"query": "{{ inputs.query }}",
|
|
21
|
+
"collection": "{{ inputs.primary_collection }}",
|
|
22
|
+
"limit": 5
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"id": "check_results",
|
|
27
|
+
"tool": "conditional",
|
|
28
|
+
"name": "Any results found?",
|
|
29
|
+
"inputs": {
|
|
30
|
+
"condition": "{{ primary_search.output.results.length > 0 }}",
|
|
31
|
+
"then": ["format_primary"],
|
|
32
|
+
"else": ["fallback_search", "format_fallback"]
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "fallback_search",
|
|
37
|
+
"tool": "query",
|
|
38
|
+
"name": "Search fallback collection",
|
|
39
|
+
"inputs": {
|
|
40
|
+
"query": "{{ inputs.query }}",
|
|
41
|
+
"collection": "{{ inputs.fallback_collection }}",
|
|
42
|
+
"limit": 5
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"id": "format_primary",
|
|
47
|
+
"tool": "template",
|
|
48
|
+
"name": "Format primary results",
|
|
49
|
+
"inputs": {
|
|
50
|
+
"text": "Found {{ primary_search.output.results.length }} results in {{ inputs.primary_collection }}."
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"id": "format_fallback",
|
|
55
|
+
"tool": "template",
|
|
56
|
+
"name": "Format fallback results",
|
|
57
|
+
"inputs": {
|
|
58
|
+
"text": "No results in {{ inputs.primary_collection }}. Found {{ fallback_search.output.results.length }} results in {{ inputs.fallback_collection }}."
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"output": {
|
|
63
|
+
"summary": "{{ check_results.output.branchTaken }}",
|
|
64
|
+
"results": "{{ check_results.output.branchTaken }}"
|
|
65
|
+
}
|
|
66
|
+
}
|