voyageai-cli 1.23.1 → 1.26.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/README.md +64 -0
- package/package.json +1 -1
- package/src/cli.js +2 -0
- package/src/commands/about.js +1 -1
- package/src/commands/bug.js +1 -1
- package/src/commands/mcp-server.js +74 -0
- package/src/commands/playground.js +31 -0
- package/src/commands/scaffold.js +23 -1
- package/src/commands/workflow.js +336 -0
- package/src/lib/explanations.js +53 -0
- package/src/lib/scaffold-structure.js +8 -9
- package/src/lib/telemetry.js +1 -1
- package/src/lib/template-engine.js +240 -0
- package/src/lib/templates/nextjs/README.md.tpl +78 -55
- package/src/lib/templates/nextjs/favicon.svg.tpl +11 -0
- package/src/lib/templates/nextjs/footer.jsx.tpl +49 -0
- package/src/lib/templates/nextjs/layout.jsx.tpl +16 -10
- package/src/lib/templates/nextjs/lib-mongo.js.tpl +5 -5
- package/src/lib/templates/nextjs/lib-voyage.js.tpl +13 -8
- package/src/lib/templates/nextjs/navbar.jsx.tpl +98 -0
- package/src/lib/templates/nextjs/page-home.jsx.tpl +201 -0
- package/src/lib/templates/nextjs/page-search.jsx.tpl +184 -82
- package/src/lib/templates/nextjs/theme-registry.jsx.tpl +51 -0
- package/src/lib/templates/nextjs/theme.js.tpl +138 -65
- package/src/lib/templates/nextjs/vai-logo-256.png +0 -0
- package/src/lib/workflow-utils.js +65 -0
- package/src/lib/workflow.js +1259 -0
- package/src/mcp/install.js +201 -0
- package/src/mcp/tools/management.js +1 -60
- package/src/playground/icons/dark/128.png +0 -0
- package/src/playground/icons/dark/16.png +0 -0
- package/src/playground/icons/dark/256.png +0 -0
- package/src/playground/icons/dark/32.png +0 -0
- package/src/playground/icons/dark/64.png +0 -0
- package/src/playground/icons/light/128.png +0 -0
- package/src/playground/icons/light/16.png +0 -0
- package/src/playground/icons/light/256.png +0 -0
- package/src/playground/icons/light/32.png +0 -0
- package/src/playground/icons/light/64.png +0 -0
- package/src/playground/icons/watermark.png +0 -0
- package/src/playground/index.html +125 -73
- package/src/workflows/consistency-check.json +64 -0
- package/src/workflows/cost-analysis.json +69 -0
- package/src/workflows/multi-collection-search.json +80 -0
- package/src/workflows/research-and-summarize.json +46 -0
- package/src/workflows/smart-ingest.json +63 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://vai.dev/schemas/workflow-v1.json",
|
|
3
|
+
"name": "Multi-Collection Search",
|
|
4
|
+
"description": "Search multiple collections, merge results, and rerank for best relevance",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"inputs": {
|
|
7
|
+
"query": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The search query",
|
|
10
|
+
"required": true
|
|
11
|
+
},
|
|
12
|
+
"collection1": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "First collection to search",
|
|
15
|
+
"required": true
|
|
16
|
+
},
|
|
17
|
+
"collection2": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "Second collection to search",
|
|
20
|
+
"required": true
|
|
21
|
+
},
|
|
22
|
+
"limit": {
|
|
23
|
+
"type": "number",
|
|
24
|
+
"description": "Results per collection",
|
|
25
|
+
"default": 10
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"defaults": {},
|
|
29
|
+
"steps": [
|
|
30
|
+
{
|
|
31
|
+
"id": "search_1",
|
|
32
|
+
"name": "Search first collection",
|
|
33
|
+
"tool": "query",
|
|
34
|
+
"inputs": {
|
|
35
|
+
"query": "{{ inputs.query }}",
|
|
36
|
+
"collection": "{{ inputs.collection1 }}",
|
|
37
|
+
"limit": "{{ inputs.limit }}",
|
|
38
|
+
"rerank": false
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"id": "search_2",
|
|
43
|
+
"name": "Search second collection",
|
|
44
|
+
"tool": "query",
|
|
45
|
+
"inputs": {
|
|
46
|
+
"query": "{{ inputs.query }}",
|
|
47
|
+
"collection": "{{ inputs.collection2 }}",
|
|
48
|
+
"limit": "{{ inputs.limit }}",
|
|
49
|
+
"rerank": false
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"id": "merge",
|
|
54
|
+
"name": "Merge results",
|
|
55
|
+
"tool": "merge",
|
|
56
|
+
"inputs": {
|
|
57
|
+
"arrays": [
|
|
58
|
+
"{{ search_1.output.results }}",
|
|
59
|
+
"{{ search_2.output.results }}"
|
|
60
|
+
],
|
|
61
|
+
"dedup": true,
|
|
62
|
+
"dedup_field": "source"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"id": "rerank_all",
|
|
67
|
+
"name": "Rerank merged results",
|
|
68
|
+
"tool": "rerank",
|
|
69
|
+
"inputs": {
|
|
70
|
+
"query": "{{ inputs.query }}",
|
|
71
|
+
"documents": "{{ merge.output.results }}"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"output": {
|
|
76
|
+
"results": "{{ rerank_all.output.results }}",
|
|
77
|
+
"resultCount": "{{ rerank_all.output.resultCount }}",
|
|
78
|
+
"query": "{{ inputs.query }}"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://vai.dev/schemas/workflow-v1.json",
|
|
3
|
+
"name": "Research and Summarize",
|
|
4
|
+
"description": "Search knowledge base, then use LLM to produce a structured summary",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"inputs": {
|
|
7
|
+
"question": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The research question to answer",
|
|
10
|
+
"required": true
|
|
11
|
+
},
|
|
12
|
+
"limit": {
|
|
13
|
+
"type": "number",
|
|
14
|
+
"description": "Maximum documents to retrieve",
|
|
15
|
+
"default": 10
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"defaults": {},
|
|
19
|
+
"steps": [
|
|
20
|
+
{
|
|
21
|
+
"id": "research",
|
|
22
|
+
"name": "Search knowledge base",
|
|
23
|
+
"tool": "query",
|
|
24
|
+
"inputs": {
|
|
25
|
+
"query": "{{ inputs.question }}",
|
|
26
|
+
"limit": "{{ inputs.limit }}"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"id": "summarize",
|
|
31
|
+
"name": "Generate summary with LLM",
|
|
32
|
+
"tool": "generate",
|
|
33
|
+
"inputs": {
|
|
34
|
+
"prompt": "Based on the following documents, provide a structured summary answering: {{ inputs.question }}",
|
|
35
|
+
"context": "{{ research.output.results }}",
|
|
36
|
+
"systemPrompt": "You are a research analyst. Structure your response with: Key Findings, Supporting Evidence, and Gaps in Available Information. Cite sources when possible."
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"output": {
|
|
41
|
+
"summary": "{{ summarize.output.text }}",
|
|
42
|
+
"sources": "{{ research.output.results }}",
|
|
43
|
+
"sourceCount": "{{ research.output.resultCount }}",
|
|
44
|
+
"question": "{{ inputs.question }}"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://vai.dev/schemas/workflow-v1.json",
|
|
3
|
+
"name": "Smart Ingest",
|
|
4
|
+
"description": "Check if a document is novel before ingesting (avoid duplicates)",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"inputs": {
|
|
7
|
+
"text": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The document text to ingest",
|
|
10
|
+
"required": true
|
|
11
|
+
},
|
|
12
|
+
"source": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Source identifier for the document",
|
|
15
|
+
"required": true
|
|
16
|
+
},
|
|
17
|
+
"threshold": {
|
|
18
|
+
"type": "number",
|
|
19
|
+
"description": "Similarity threshold (0-1). Documents more similar than this are considered duplicates",
|
|
20
|
+
"default": 0.85
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"defaults": {},
|
|
24
|
+
"steps": [
|
|
25
|
+
{
|
|
26
|
+
"id": "check_existing",
|
|
27
|
+
"name": "Search for similar existing documents",
|
|
28
|
+
"tool": "search",
|
|
29
|
+
"inputs": {
|
|
30
|
+
"query": "{{ inputs.text }}",
|
|
31
|
+
"limit": 3
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"id": "similarity_check",
|
|
36
|
+
"name": "Check similarity to top match",
|
|
37
|
+
"tool": "similarity",
|
|
38
|
+
"inputs": {
|
|
39
|
+
"text1": "{{ inputs.text }}",
|
|
40
|
+
"text2": "{{ check_existing.output.results[0].text }}"
|
|
41
|
+
},
|
|
42
|
+
"condition": "{{ check_existing.output.results.length > 0 }}"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"id": "ingest_doc",
|
|
46
|
+
"name": "Ingest if sufficiently novel",
|
|
47
|
+
"tool": "ingest",
|
|
48
|
+
"inputs": {
|
|
49
|
+
"text": "{{ inputs.text }}",
|
|
50
|
+
"source": "{{ inputs.source }}",
|
|
51
|
+
"metadata": {
|
|
52
|
+
"ingested_via": "smart-ingest-workflow"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"condition": "{{ !similarity_check.output || similarity_check.output.similarity < 0.85 }}"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"output": {
|
|
59
|
+
"ingested": "{{ ingest_doc.output ? true : false }}",
|
|
60
|
+
"similarityScore": "{{ similarity_check.output.similarity }}",
|
|
61
|
+
"existingDocs": "{{ check_existing.output.resultCount }}"
|
|
62
|
+
}
|
|
63
|
+
}
|