voyageai-cli 1.30.0 → 1.30.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.
Files changed (55) hide show
  1. package/package.json +1 -1
  2. package/src/cli.js +6 -0
  3. package/src/commands/chat.js +32 -11
  4. package/src/commands/export.js +124 -0
  5. package/src/commands/import.js +195 -0
  6. package/src/commands/index-workspace.js +239 -0
  7. package/src/commands/mcp-server.js +113 -3
  8. package/src/commands/playground.js +111 -3
  9. package/src/lib/export/contexts/benchmark-export.js +27 -0
  10. package/src/lib/export/contexts/chat-export.js +41 -0
  11. package/src/lib/export/contexts/explore-export.js +22 -0
  12. package/src/lib/export/contexts/search-export.js +54 -0
  13. package/src/lib/export/contexts/workflow-export.js +80 -0
  14. package/src/lib/export/formats/clipboard-export.js +29 -0
  15. package/src/lib/export/formats/csv-export.js +45 -0
  16. package/src/lib/export/formats/json-export.js +50 -0
  17. package/src/lib/export/formats/markdown-export.js +189 -0
  18. package/src/lib/export/formats/mermaid-export.js +274 -0
  19. package/src/lib/export/formats/pdf-export.js +117 -0
  20. package/src/lib/export/formats/png-export.js +96 -0
  21. package/src/lib/export/formats/svg-export.js +116 -0
  22. package/src/lib/export/index.js +175 -0
  23. package/src/lib/workflow.js +206 -27
  24. package/src/mcp/install.js +280 -7
  25. package/src/mcp/schemas/index.js +40 -0
  26. package/src/mcp/server.js +2 -0
  27. package/src/mcp/tools/workspace.js +463 -0
  28. package/src/playground/announcements.md +52 -5
  29. package/src/playground/index.html +11125 -7796
  30. package/src/playground/vendor/mermaid.min.js +2811 -0
  31. package/src/workflows/rag-chat.json +165 -0
  32. package/src/workflows/tests/consistency-check.happy-path.test.json +28 -0
  33. package/src/workflows/tests/consistency-check.missing-source.test.json +26 -0
  34. package/src/workflows/tests/cost-analysis.happy-path.test.json +28 -0
  35. package/src/workflows/tests/enrich-and-ingest.happy-path.test.json +38 -0
  36. package/src/workflows/tests/enrich-and-ingest.notify-fails.test.json +38 -0
  37. package/src/workflows/tests/intelligent-ingest.all-filtered.test.json +26 -0
  38. package/src/workflows/tests/intelligent-ingest.happy-path.test.json +28 -0
  39. package/src/workflows/tests/kb-health-report.custom-queries.test.json +24 -0
  40. package/src/workflows/tests/kb-health-report.happy-path.test.json +26 -0
  41. package/src/workflows/tests/multi-collection-search.happy-path.test.json +40 -0
  42. package/src/workflows/tests/multi-collection-search.one-empty.test.json +28 -0
  43. package/src/workflows/tests/rag-chat.happy-path.test.json +26 -0
  44. package/src/workflows/tests/rag-chat.no-relevant-results.test.json +25 -0
  45. package/src/workflows/tests/research-and-summarize.happy-path.test.json +33 -0
  46. package/src/workflows/tests/research-and-summarize.no-results.test.json +29 -0
  47. package/src/workflows/tests/search-with-fallback.empty-both.test.json +24 -0
  48. package/src/workflows/tests/search-with-fallback.fallback-branch.test.json +24 -0
  49. package/src/workflows/tests/search-with-fallback.happy-path.test.json +27 -0
  50. package/src/workflows/tests/smart-ingest.duplicate-detected.test.json +34 -0
  51. package/src/workflows/tests/smart-ingest.happy-path.test.json +31 -0
  52. package/src/playground/assets/announcements/appstore.jpg +0 -0
  53. package/src/playground/assets/announcements/circuits.jpg +0 -0
  54. package/src/playground/assets/announcements/csvingest.jpg +0 -0
  55. package/src/playground/assets/announcements/green-wave.jpg +0 -0
@@ -0,0 +1,165 @@
1
+ {
2
+ "$schema": "https://vai.dev/schemas/workflow-v1.json",
3
+ "name": "RAG Chat",
4
+ "description": "Retrieval-Augmented Generation chat: searches your knowledge base, reranks for relevance, filters low-quality matches, and generates a grounded answer with source citations",
5
+ "version": "1.0.0",
6
+ "branding": {
7
+ "icon": "message-circle",
8
+ "color": "#7C3AED"
9
+ },
10
+ "inputs": {
11
+ "question": {
12
+ "type": "string",
13
+ "description": "The user's question or message",
14
+ "required": true
15
+ },
16
+ "collection": {
17
+ "type": "string",
18
+ "description": "Knowledge base collection to search",
19
+ "required": true
20
+ },
21
+ "collection2": {
22
+ "type": "string",
23
+ "description": "Optional second collection for broader search (leave empty to skip)",
24
+ "default": ""
25
+ },
26
+ "limit": {
27
+ "type": "number",
28
+ "description": "Maximum documents to retrieve per collection",
29
+ "default": 10
30
+ },
31
+ "min_score": {
32
+ "type": "number",
33
+ "description": "Minimum relevance score (0-1) to include a document",
34
+ "default": 0.3
35
+ },
36
+ "system_prompt": {
37
+ "type": "string",
38
+ "description": "Custom system prompt for the LLM",
39
+ "default": "You are a knowledgeable assistant. Answer questions accurately based on the provided context. Always cite your sources by referencing the document name or source field. If the context does not contain enough information to answer fully, say so clearly and explain what information is missing. Never fabricate information that is not in the provided context."
40
+ },
41
+ "chat_history": {
42
+ "type": "string",
43
+ "description": "Previous conversation turns (for multi-turn context)",
44
+ "default": ""
45
+ }
46
+ },
47
+ "defaults": {},
48
+ "steps": [
49
+ {
50
+ "id": "search_primary",
51
+ "name": "Search primary knowledge base",
52
+ "tool": "query",
53
+ "inputs": {
54
+ "query": "{{ inputs.question }}",
55
+ "collection": "{{ inputs.collection }}",
56
+ "limit": "{{ inputs.limit }}",
57
+ "rerank": false
58
+ }
59
+ },
60
+ {
61
+ "id": "check_multi",
62
+ "name": "Check if second collection is configured",
63
+ "tool": "conditional",
64
+ "inputs": {
65
+ "condition": "{{ inputs.collection2.length > 0 }}",
66
+ "then": ["search_secondary"],
67
+ "else": ["skip_merge"]
68
+ }
69
+ },
70
+ {
71
+ "id": "search_secondary",
72
+ "name": "Search secondary knowledge base",
73
+ "tool": "query",
74
+ "inputs": {
75
+ "query": "{{ inputs.question }}",
76
+ "collection": "{{ inputs.collection2 }}",
77
+ "limit": "{{ inputs.limit }}",
78
+ "rerank": false
79
+ }
80
+ },
81
+ {
82
+ "id": "skip_merge",
83
+ "name": "Pass primary results through",
84
+ "tool": "template",
85
+ "inputs": {
86
+ "text": "Using {{ search_primary.output.resultCount }} results from primary collection"
87
+ }
88
+ },
89
+ {
90
+ "id": "merge_results",
91
+ "name": "Merge results from all collections",
92
+ "tool": "merge",
93
+ "inputs": {
94
+ "arrays": [
95
+ "{{ search_primary.output.results }}",
96
+ "{{ search_secondary.output.results }}"
97
+ ],
98
+ "dedup": true,
99
+ "dedup_field": "source"
100
+ },
101
+ "condition": "{{ inputs.collection2.length > 0 }}"
102
+ },
103
+ {
104
+ "id": "rerank",
105
+ "name": "Rerank by relevance to question",
106
+ "tool": "rerank",
107
+ "inputs": {
108
+ "query": "{{ inputs.question }}",
109
+ "documents": "{{ merge_results.output.results || search_primary.output.results }}"
110
+ }
111
+ },
112
+ {
113
+ "id": "filter_relevant",
114
+ "name": "Filter out low-relevance documents",
115
+ "tool": "filter",
116
+ "inputs": {
117
+ "array": "{{ rerank.output.results }}",
118
+ "condition": "item.score >= {{ inputs.min_score }}"
119
+ }
120
+ },
121
+ {
122
+ "id": "check_context",
123
+ "name": "Check if any relevant context was found",
124
+ "tool": "conditional",
125
+ "inputs": {
126
+ "condition": "{{ filter_relevant.output.resultCount > 0 }}",
127
+ "then": ["build_prompt", "generate_answer"],
128
+ "else": ["no_context_response"]
129
+ }
130
+ },
131
+ {
132
+ "id": "build_prompt",
133
+ "name": "Assemble prompt with context and history",
134
+ "tool": "template",
135
+ "inputs": {
136
+ "text": "{{ inputs.chat_history ? 'Previous conversation:\\n' + inputs.chat_history + '\\n\\n' : '' }}Based on the following knowledge base documents, answer this question: {{ inputs.question }}"
137
+ }
138
+ },
139
+ {
140
+ "id": "generate_answer",
141
+ "name": "Generate grounded answer with LLM",
142
+ "tool": "generate",
143
+ "inputs": {
144
+ "prompt": "{{ build_prompt.output.text }}",
145
+ "context": "{{ filter_relevant.output.results }}",
146
+ "systemPrompt": "{{ inputs.system_prompt }}"
147
+ }
148
+ },
149
+ {
150
+ "id": "no_context_response",
151
+ "name": "Handle no relevant context found",
152
+ "tool": "template",
153
+ "inputs": {
154
+ "text": "I searched the knowledge base but didn't find documents relevant enough to answer your question confidently. The query '{{ inputs.question }}' returned {{ rerank.output.resultCount }} results, but none met the minimum relevance threshold of {{ inputs.min_score }}. Try rephrasing your question or lowering the min_score threshold."
155
+ }
156
+ }
157
+ ],
158
+ "output": {
159
+ "answer": "{{ generate_answer.output.text || no_context_response.output.text }}",
160
+ "sources": "{{ filter_relevant.output.results }}",
161
+ "sourceCount": "{{ filter_relevant.output.resultCount }}",
162
+ "model": "{{ generate_answer.output.model }}",
163
+ "question": "{{ inputs.question }}"
164
+ }
165
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "consistency-check: happy path (both sources have results)",
3
+ "inputs": {
4
+ "topic": "authentication best practices",
5
+ "collection1": "api_docs",
6
+ "collection2": "tutorials"
7
+ },
8
+ "mocks": {
9
+ "query": {
10
+ "results": [
11
+ { "text": "Use OAuth2 for API authentication", "score": 0.92, "source": "auth.md" }
12
+ ],
13
+ "resultCount": 1
14
+ },
15
+ "similarity": {
16
+ "similarity": 0.87,
17
+ "model": "voyage-4-large"
18
+ }
19
+ },
20
+ "expect": {
21
+ "steps": {
22
+ "search_source_a": { "status": "completed" },
23
+ "search_source_b": { "status": "completed" },
24
+ "compare": { "status": "completed" }
25
+ },
26
+ "noErrors": true
27
+ }
28
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "consistency-check: one source empty (comparison skipped)",
3
+ "inputs": {
4
+ "topic": "obscure topic",
5
+ "collection1": "api_docs",
6
+ "collection2": "tutorials"
7
+ },
8
+ "mocks": {
9
+ "query": {
10
+ "results": [],
11
+ "resultCount": 0
12
+ },
13
+ "similarity": {
14
+ "similarity": 0.0,
15
+ "model": "voyage-4-large"
16
+ }
17
+ },
18
+ "expect": {
19
+ "steps": {
20
+ "search_source_a": { "status": "completed" },
21
+ "search_source_b": { "status": "completed" },
22
+ "compare": { "status": "skipped" }
23
+ },
24
+ "noErrors": true
25
+ }
26
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "cost-analysis: happy path",
3
+ "inputs": {
4
+ "docs": 10000,
5
+ "queries": 5000,
6
+ "months": 12
7
+ },
8
+ "mocks": {
9
+ "estimate": {
10
+ "model": "voyage-4-large",
11
+ "embeddingCost": 12.50,
12
+ "queryCost": 8.25,
13
+ "totalCost": 20.75,
14
+ "currency": "USD"
15
+ }
16
+ },
17
+ "expect": {
18
+ "steps": {
19
+ "cost_large": { "status": "completed" },
20
+ "cost_balanced": { "status": "completed" },
21
+ "cost_lite": { "status": "completed" }
22
+ },
23
+ "output": {
24
+ "comparison": { "type": "array", "minLength": 3 }
25
+ },
26
+ "noErrors": true
27
+ }
28
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "enrich-and-ingest: happy path",
3
+ "inputs": {
4
+ "document_url": "https://api.example.com/documents/123/metadata",
5
+ "text": "This is the document text to ingest after enrichment with external metadata."
6
+ },
7
+ "mocks": {
8
+ "http": {
9
+ "status": 200,
10
+ "statusText": "OK",
11
+ "headers": { "content-type": "application/json" },
12
+ "body": {
13
+ "title": "Getting Started Guide",
14
+ "author": "Jane Developer",
15
+ "category": "tutorials",
16
+ "timestamp": "2025-01-15T10:00:00Z"
17
+ },
18
+ "durationMs": 150
19
+ },
20
+ "ingest": {
21
+ "chunks": 2,
22
+ "source": "Getting Started Guide",
23
+ "collection": "default"
24
+ }
25
+ },
26
+ "expect": {
27
+ "steps": {
28
+ "fetch_metadata": { "status": "completed" },
29
+ "store": { "status": "completed" },
30
+ "notify": { "status": "completed" }
31
+ },
32
+ "output": {
33
+ "source": { "type": "string", "minLength": 1 },
34
+ "chunks": { "type": "number" }
35
+ },
36
+ "noErrors": true
37
+ }
38
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "enrich-and-ingest: notification failure (continueOnError)",
3
+ "inputs": {
4
+ "document_url": "https://api.example.com/documents/456/metadata",
5
+ "text": "Document text for ingestion even if notification fails."
6
+ },
7
+ "mocks": {
8
+ "http": {
9
+ "status": 200,
10
+ "statusText": "OK",
11
+ "headers": { "content-type": "application/json" },
12
+ "body": {
13
+ "title": "API Reference",
14
+ "author": "John Dev",
15
+ "category": "reference",
16
+ "timestamp": "2025-02-01T14:00:00Z"
17
+ },
18
+ "durationMs": 200
19
+ },
20
+ "ingest": {
21
+ "chunks": 5,
22
+ "source": "API Reference",
23
+ "collection": "default"
24
+ }
25
+ },
26
+ "expect": {
27
+ "steps": {
28
+ "fetch_metadata": { "status": "completed" },
29
+ "store": { "status": "completed" },
30
+ "notify": { "status": "completed" }
31
+ },
32
+ "output": {
33
+ "source": { "type": "string", "minLength": 1 },
34
+ "chunks": { "type": "number" }
35
+ },
36
+ "noErrors": true
37
+ }
38
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "intelligent-ingest: all chunks filtered out (too short)",
3
+ "inputs": {
4
+ "text": "Short. Tiny. Small text.",
5
+ "source": "tiny.md",
6
+ "similarity_threshold": 0.92
7
+ },
8
+ "mocks": {
9
+ "search": {
10
+ "results": [],
11
+ "resultCount": 0
12
+ }
13
+ },
14
+ "expect": {
15
+ "steps": {
16
+ "split": { "status": "completed" },
17
+ "filter_short": { "status": "completed" },
18
+ "check_each": { "status": "completed" },
19
+ "embed_novel": { "status": "completed" }
20
+ },
21
+ "output": {
22
+ "summary": { "type": "string" }
23
+ },
24
+ "noErrors": true
25
+ }
26
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "intelligent-ingest: happy path",
3
+ "inputs": {
4
+ "text": "This is a long document about vector databases and how they work. Vector databases store high-dimensional embeddings and support approximate nearest neighbor search for fast retrieval. They are essential for modern RAG applications. The key advantage is that semantic similarity can be computed efficiently at scale. Various indexing strategies like HNSW and IVF are used to speed up queries.",
5
+ "source": "vector-db-guide.md",
6
+ "similarity_threshold": 0.92
7
+ },
8
+ "mocks": {
9
+ "search": {
10
+ "results": [
11
+ { "text": "Some existing doc about databases", "score": 0.45 }
12
+ ],
13
+ "resultCount": 1
14
+ }
15
+ },
16
+ "expect": {
17
+ "steps": {
18
+ "split": { "status": "completed" },
19
+ "filter_short": { "status": "completed" },
20
+ "check_each": { "status": "completed" },
21
+ "embed_novel": { "status": "completed" }
22
+ },
23
+ "output": {
24
+ "summary": { "type": "string", "minLength": 1 }
25
+ },
26
+ "noErrors": true
27
+ }
28
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "kb-health-report: custom queries",
3
+ "inputs": {
4
+ "test_queries": ["vector search", "embeddings"]
5
+ },
6
+ "mocks": {
7
+ "query": {
8
+ "results": [],
9
+ "resultCount": 0
10
+ },
11
+ "generate": {
12
+ "text": "Knowledge Base Health Report: 2 topics tested. Low coverage detected across test queries.",
13
+ "model": "claude-3-haiku",
14
+ "tokensUsed": 60
15
+ }
16
+ },
17
+ "expect": {
18
+ "steps": {
19
+ "coverage_check": { "status": "completed" },
20
+ "report": { "status": "completed" }
21
+ },
22
+ "noErrors": true
23
+ }
24
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "kb-health-report: happy path",
3
+ "inputs": {
4
+ "test_queries": ["authentication", "deployment", "error handling"]
5
+ },
6
+ "mocks": {
7
+ "query": {
8
+ "results": [
9
+ { "text": "Auth docs available", "score": 0.9 }
10
+ ],
11
+ "resultCount": 1
12
+ },
13
+ "generate": {
14
+ "text": "Knowledge Base Health Report: 3 topics tested. Coverage looks good with results found for all test queries.",
15
+ "model": "claude-3-haiku",
16
+ "tokensUsed": 85
17
+ }
18
+ },
19
+ "expect": {
20
+ "steps": {
21
+ "coverage_check": { "status": "completed" },
22
+ "report": { "status": "completed" }
23
+ },
24
+ "noErrors": true
25
+ }
26
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "multi-collection-search: happy path",
3
+ "inputs": {
4
+ "query": "how to deploy",
5
+ "collection1": "api_docs",
6
+ "collection2": "tutorials",
7
+ "limit": 5
8
+ },
9
+ "mocks": {
10
+ "query": {
11
+ "results": [
12
+ { "text": "Deploy using Docker containers", "score": 0.92, "source": "deploy.md" },
13
+ { "text": "CI/CD pipeline setup guide", "score": 0.85, "source": "ci.md" }
14
+ ],
15
+ "resultCount": 2
16
+ },
17
+ "rerank": {
18
+ "results": [
19
+ { "text": "Deploy using Docker containers", "score": 0.96, "source": "deploy.md" },
20
+ { "text": "CI/CD pipeline setup guide", "score": 0.91, "source": "ci.md" },
21
+ { "text": "Deploy using Docker containers", "score": 0.89, "source": "deploy.md" },
22
+ { "text": "CI/CD pipeline setup guide", "score": 0.82, "source": "ci.md" }
23
+ ],
24
+ "resultCount": 4
25
+ }
26
+ },
27
+ "expect": {
28
+ "steps": {
29
+ "search_1": { "status": "completed" },
30
+ "search_2": { "status": "completed" },
31
+ "merge": { "status": "completed" },
32
+ "rerank_all": { "status": "completed" }
33
+ },
34
+ "output": {
35
+ "results": { "type": "array", "minLength": 1 },
36
+ "resultCount": { "type": "number" }
37
+ },
38
+ "noErrors": true
39
+ }
40
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "multi-collection-search: one collection empty",
3
+ "inputs": {
4
+ "query": "obscure feature",
5
+ "collection1": "api_docs",
6
+ "collection2": "tutorials",
7
+ "limit": 5
8
+ },
9
+ "mocks": {
10
+ "query": {
11
+ "results": [],
12
+ "resultCount": 0
13
+ },
14
+ "rerank": {
15
+ "results": [],
16
+ "resultCount": 0
17
+ }
18
+ },
19
+ "expect": {
20
+ "steps": {
21
+ "search_1": { "status": "completed" },
22
+ "search_2": { "status": "completed" },
23
+ "merge": { "status": "completed" },
24
+ "rerank_all": { "status": "completed" }
25
+ },
26
+ "noErrors": true
27
+ }
28
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "rag-chat: happy path with relevant results",
3
+ "inputs": {
4
+ "question": "How do I create a vector search index?",
5
+ "collection": "docs",
6
+ "collection2": "",
7
+ "limit": 5,
8
+ "min_score": 0.3,
9
+ "system_prompt": "You are a helpful assistant. Cite sources.",
10
+ "chat_history": ""
11
+ },
12
+ "mocks": {
13
+ "query": { "results": [{ "text": "To create a vector search index, use the Atlas UI or CLI...", "source": "atlas-docs.md", "score": 0.92 }, { "text": "Vector indexes support cosine, euclidean, and dotProduct similarity.", "source": "vector-guide.md", "score": 0.85 }], "resultCount": 2 },
14
+ "rerank": { "results": [{ "text": "To create a vector search index, use the Atlas UI or CLI...", "source": "atlas-docs.md", "score": 0.95 }, { "text": "Vector indexes support cosine, euclidean, and dotProduct similarity.", "source": "vector-guide.md", "score": 0.78 }], "resultCount": 2 },
15
+ "generate": { "text": "To create a vector search index, you can use the Atlas UI or the CLI. According to the documentation (atlas-docs.md), the process involves...", "model": "claude-sonnet", "provider": "anthropic" }
16
+ },
17
+ "expect": {
18
+ "steps": {
19
+ "search_primary": { "status": "completed" },
20
+ "rerank": { "status": "completed" },
21
+ "filter_relevant": { "status": "completed" },
22
+ "generate_answer": { "status": "completed" }
23
+ },
24
+ "noErrors": true
25
+ }
26
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "rag-chat: no results above relevance threshold",
3
+ "inputs": {
4
+ "question": "What is the meaning of life?",
5
+ "collection": "technical-docs",
6
+ "collection2": "",
7
+ "limit": 5,
8
+ "min_score": 0.5,
9
+ "system_prompt": "You are a helpful assistant.",
10
+ "chat_history": ""
11
+ },
12
+ "mocks": {
13
+ "query": { "results": [{ "text": "MongoDB Atlas provides cloud database services.", "source": "overview.md", "score": 0.15 }], "resultCount": 1 },
14
+ "rerank": { "results": [{ "text": "MongoDB Atlas provides cloud database services.", "source": "overview.md", "score": 0.12 }], "resultCount": 1 }
15
+ },
16
+ "expect": {
17
+ "steps": {
18
+ "search_primary": { "status": "completed" },
19
+ "rerank": { "status": "completed" },
20
+ "filter_relevant": { "status": "completed" },
21
+ "no_context_response": { "status": "completed" }
22
+ },
23
+ "noErrors": true
24
+ }
25
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "research-and-summarize: happy path",
3
+ "inputs": {
4
+ "question": "How does vector search work?",
5
+ "limit": 5
6
+ },
7
+ "mocks": {
8
+ "query": {
9
+ "results": [
10
+ { "text": "Vector search uses embeddings to find similar documents", "score": 0.95 },
11
+ { "text": "Approximate nearest neighbor algorithms power vector search", "score": 0.88 }
12
+ ],
13
+ "resultCount": 2
14
+ },
15
+ "generate": {
16
+ "text": "Vector search works by converting documents and queries into numerical embeddings and finding the closest matches using ANN algorithms.",
17
+ "model": "claude-3-haiku",
18
+ "tokensUsed": 120
19
+ }
20
+ },
21
+ "expect": {
22
+ "steps": {
23
+ "research": { "status": "completed" },
24
+ "summarize": { "status": "completed" }
25
+ },
26
+ "output": {
27
+ "summary": { "type": "string", "minLength": 1 },
28
+ "sources": { "type": "array", "minLength": 1 },
29
+ "sourceCount": { "type": "number" }
30
+ },
31
+ "noErrors": true
32
+ }
33
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "research-and-summarize: no search results",
3
+ "inputs": {
4
+ "question": "What is the meaning of life?",
5
+ "limit": 5
6
+ },
7
+ "mocks": {
8
+ "query": {
9
+ "results": [],
10
+ "resultCount": 0
11
+ },
12
+ "generate": {
13
+ "text": "No relevant documents were found in the knowledge base to answer this question.",
14
+ "model": "claude-3-haiku",
15
+ "tokensUsed": 45
16
+ }
17
+ },
18
+ "expect": {
19
+ "steps": {
20
+ "research": { "status": "completed" },
21
+ "summarize": { "status": "completed" }
22
+ },
23
+ "output": {
24
+ "summary": { "type": "string", "minLength": 1 },
25
+ "sourceCount": { "type": "number" }
26
+ },
27
+ "noErrors": true
28
+ }
29
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "search-with-fallback: both collections empty",
3
+ "inputs": {
4
+ "query": "nonexistent topic xyz",
5
+ "primary_collection": "api_docs",
6
+ "fallback_collection": "knowledge"
7
+ },
8
+ "mocks": {
9
+ "query": {
10
+ "results": [],
11
+ "resultCount": 0
12
+ }
13
+ },
14
+ "expect": {
15
+ "steps": {
16
+ "primary_search": { "status": "completed" },
17
+ "check_results": { "status": "completed" },
18
+ "format_primary": { "status": "skipped" },
19
+ "fallback_search": { "status": "completed" },
20
+ "format_fallback": { "status": "completed" }
21
+ },
22
+ "noErrors": true
23
+ }
24
+ }