@moorchehai/mcp 1.3.2 → 1.3.4

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.
@@ -1,359 +1,359 @@
1
- import { z } from 'zod';
2
-
3
- // Search optimization prompt
4
- export const searchOptimizationPrompt = {
5
- name: 'search-optimization',
6
- description: 'Tips for optimizing search queries in Moorcheh',
7
- argsSchema: {
8
- search_type: z.enum(['text','vector']).optional().describe('Type of search (text or vector)'),
9
- domain: z.string().optional().describe('Domain or topic area of your content')
10
- },
11
- handler: async (args) => {
12
- const searchType = args?.search_type || 'text';
13
- const domain = args?.domain || 'general';
14
-
15
- const text = `# Moorcheh Search Optimization Guide
16
-
17
- ## Optimizing ${searchType} search for ${domain} content
18
-
19
- ### Request Format Examples:
20
-
21
- **Text Search Request:**
22
- \`\`\`json
23
- {
24
- "query": "your search text here",
25
- "namespaces": ["your-namespace"],
26
- "top_k": 10,
27
- "kiosk_mode": false
28
- }
29
- \`\`\`
30
-
31
- **Vector Search Request:**
32
- \`\`\`json
33
- {
34
- "query": [0.1, 0.2, 0.3, ..., 0.768],
35
- "namespaces": ["vector-embeddings"],
36
- "top_k": 5,
37
- "kiosk_mode": true,
38
- "threshold": 0.1
39
- }
40
- \`\`\`
41
-
42
- **cURL Example for Vector Search:**
43
- \`\`\`bash
44
- curl -X POST "https://api.moorcheh.ai/v1/search" \\
45
- -H "Content-Type: application/json" \\
46
- -H "x-api-key: your-api-key-here" \\
47
- -d '{
48
- "query": [0.1, 0.2, 0.3, ..., 0.768],
49
- "namespaces": ["vector-embeddings"],
50
- "top_k": 5,
51
- "kiosk_mode": true,
52
- "threshold": 0.1
53
- }'
54
- \`\`\`
55
-
56
- ### Search Strategy:
57
-
58
- ${searchType === 'text' ? `
59
- **Text Search Best Practices:**
60
- - Use specific, descriptive terms rather than generic ones
61
- - Include key domain terminology from your ${domain} field
62
- - Try both short keywords and longer phrases
63
- - Use synonyms if initial searches don't return good results
64
- - Natural language queries work well for semantic search
65
-
66
- **Query Examples:**
67
- - Instead of: "help"
68
- - Try: "troubleshooting guide", "how to resolve", "step by step"
69
- - Use complete sentences: "How do I configure authentication?"
70
- - Include context: "Python authentication setup for web applications"
71
- ` : `
72
- **Vector Search Best Practices:**
73
- - Ensure your query embeddings use the same model as your stored vectors
74
- - Vector search works well with semantic similarity
75
- - Natural language queries often work better than keywords
76
- - Consider the context and intent behind your search
77
- - Match vector dimensions with your namespace configuration
78
-
79
- **Query Optimization:**
80
- - Use complete sentences or questions for better semantic matching
81
- - Include relevant context in your query
82
- - Test with variations of the same concept
83
- - Ensure vector dimensions match your namespace (e.g., 768 for many models)
84
- `}
85
-
86
- ### Parameter Tuning:
87
-
88
- 1. **top_k**: Number of results to return (default: 10)
89
- - Start with 5-10 for most use cases
90
- - Increase for broader exploration
91
- - Decrease for highly targeted results
92
-
93
- 2. **threshold**: Similarity threshold (0-1, optional)
94
- - 0.7-0.8: High similarity, fewer but more relevant results
95
- - 0.5-0.7: Moderate similarity, balanced results
96
- - 0.3-0.5: Lower similarity, more comprehensive results
97
- - **Important**: When kiosk_mode is true, threshold becomes mandatory
98
-
99
- 3. **kiosk_mode**: Boolean (default: false)
100
- - true: Restrict search to specific namespace(s) with threshold filtering
101
- - false: Search across all specified namespaces
102
- - **Note**: When kiosk_mode is enabled, threshold parameter is required
103
-
104
- ### Kiosk Mode Requirements:
105
-
106
- When using kiosk_mode=true:
107
- - **threshold parameter is mandatory**
108
- - Results are filtered by the specified threshold
109
- - Useful for production environments with strict relevance requirements
110
- - Example: kiosk_mode=true with threshold=0.7 ensures only high-confidence results
111
-
112
- ### Domain-Specific Tips for ${domain}:
113
- - Use terminology specific to ${domain}
114
- - Consider the typical language patterns in your content
115
- - Test with actual user queries from your ${domain} context
116
- - Monitor search performance and adjust parameters accordingly
117
- - For technical content, include specific technology names and versions
118
-
119
- ### Troubleshooting:
120
- - If no results: Lower threshold, check spelling, try synonyms
121
- - If too many irrelevant results: Raise threshold, use more specific terms
122
- - If results seem random: Check your embeddings model compatibility
123
- - For vector search: Verify vector dimensions match namespace configuration
124
- - For kiosk mode: Ensure threshold is provided when kiosk_mode=true
125
-
126
- ### Response Format:
127
- The search returns results with:
128
- - **id**: Document identifier
129
- - **score**: Similarity score (0-1, higher is better)
130
- - **label**: Relevance label (Close Match, Very High Relevance, etc.)
131
- - **text**: Original text content (for text namespaces)
132
- - **metadata**: Associated metadata
133
- `;
134
-
135
- return {
136
- messages: [
137
- {
138
- role: 'assistant',
139
- content: { type: 'text', text }
140
- }
141
- ]
142
- };
143
- }
144
- };
145
-
146
- // Data organization prompt
147
- export const dataOrganizationPrompt = {
148
- name: 'data-organization',
149
- description: 'Best practices for organizing data in Moorcheh namespaces',
150
- argsSchema: {
151
- content_type: z.string().optional().describe("Type of content you're organizing"),
152
- team_size: z.enum(['small','large']).optional().describe('Size of your team using this data')
153
- },
154
- handler: async (args) => {
155
- const contentType = args?.content_type || 'documents';
156
- const teamSize = args?.team_size || 'small';
157
-
158
- const text = `# Moorcheh Data Organization Guide
159
-
160
- ## Organizing ${contentType} for a ${teamSize} team
161
-
162
- ### Namespace Strategy:
163
-
164
- ${teamSize === 'large' ? `
165
- **Large Team Considerations:**
166
- - Create separate namespaces by department or project
167
- - Use consistent naming conventions across teams
168
- - Implement clear metadata standards
169
- - Consider access control and permissions
170
- ` : `
171
- **Small Team Approach:**
172
- - Fewer namespaces with more content per namespace
173
- - Flexible organization that can evolve
174
- - Focus on clear naming and good metadata
175
- - Regular cleanup and maintenance
176
- `}
177
-
178
- ### Content Organization for ${contentType}:
179
-
180
- 1. **Metadata Schema:**
181
- \`\`\`json
182
- {
183
- "category": "primary classification",
184
- "tags": ["tag1", "tag2", "tag3"],
185
- "author": "content creator",
186
- "created_date": "2024-01-01",
187
- "department": "relevant team",
188
- "priority": "high/medium/low",
189
- "status": "draft/review/published"
190
- }
191
- \`\`\`
192
-
193
- 2. **Document ID Conventions:**
194
- - Use descriptive, hierarchical IDs
195
- - Include date/version when relevant
196
- - Examples: "support-faq-login-2024", "product-spec-v2-auth"
197
-
198
- 3. **Content Chunking:**
199
- - Break large documents into logical sections
200
- - Each chunk should be self-contained
201
- - Include context in metadata
202
-
203
- ### Maintenance Workflow:
204
-
205
- 1. **Regular Reviews:**
206
- - Monthly metadata cleanup
207
- - Remove outdated content
208
- - Update tags and categories
209
-
210
- 2. **Quality Control:**
211
- - Standardize formatting before upload
212
- - Validate metadata completeness
213
- - Test search functionality after major updates
214
-
215
- 3. **Growth Planning:**
216
- - Monitor namespace size and performance
217
- - Plan for content archival strategy
218
- - Consider splitting namespaces as they grow
219
-
220
- ### Search-Friendly Organization:
221
- - Use consistent terminology in your ${contentType}
222
- - Include alternative phrasings in metadata
223
- - Create logical content hierarchies
224
- - Tag content with multiple relevant categories
225
-
226
- This organization will help your ${teamSize} team efficiently manage and search through your ${contentType}.
227
- `;
228
-
229
- return {
230
- messages: [
231
- {
232
- role: 'assistant',
233
- content: { type: 'text', text }
234
- }
235
- ]
236
- };
237
- }
238
- };
239
-
240
- // AI answer setup prompt
241
- export const aiAnswerSetupPrompt = {
242
- name: 'ai-answer-setup',
243
- description: 'Guide for configuring AI-powered answers in Moorcheh',
244
- argsSchema: {
245
- answer_style: z.enum(['concise','detailed','technical','friendly','balanced']).optional().describe('Desired style for AI answers'),
246
- context_type: z.string().optional().describe('Type of context/domain for answers')
247
- },
248
- handler: async (args) => {
249
- const answerStyle = args?.answer_style || 'balanced';
250
- const contextType = args?.context_type || 'general';
251
-
252
- const text = `# Moorcheh AI Answer Configuration Guide
253
-
254
- ## Setting up ${answerStyle} AI answers for ${contextType} content
255
-
256
- ### Header Prompt Configuration:
257
-
258
- \`\`\`
259
- You are an AI assistant specialized in ${contextType}.
260
- Your role is to provide ${answerStyle} answers based on the provided context.
261
-
262
- Style Guidelines:
263
- ${answerStyle === 'concise' ? `
264
- - Keep answers brief and to the point
265
- - Use bullet points for multiple items
266
- - Avoid unnecessary explanations
267
- - Focus on actionable information
268
- ` : answerStyle === 'detailed' ? `
269
- - Provide comprehensive explanations
270
- - Include relevant background information
271
- - Use examples where helpful
272
- - Structure answers with clear sections
273
- ` : answerStyle === 'technical' ? `
274
- - Use precise technical terminology
275
- - Include code examples when relevant
276
- - Explain complex concepts step-by-step
277
- - Reference specific technical details
278
- ` : answerStyle === 'friendly' ? `
279
- - Use conversational, approachable language
280
- - Include encouraging phrases
281
- - Explain concepts in simple terms
282
- - Ask clarifying questions when needed
283
- ` : `
284
- - Balance brevity with completeness
285
- - Use clear, professional language
286
- - Structure information logically
287
- - Include key details without overwhelming
288
- `}
289
-
290
- Context: You have access to ${contextType} documentation and resources.
291
- \`\`\`
292
-
293
- ### Footer Prompt Configuration:
294
-
295
- \`\`\`
296
- Additional Guidelines:
297
- - Always cite specific sources when possible
298
- - If information is incomplete, acknowledge limitations
299
- - Suggest follow-up questions for complex topics
300
- - ${contextType === 'technical' ? 'Include relevant code snippets or examples' : 'Provide practical next steps'}
301
-
302
- Response Format:
303
- - Start with a direct answer to the question
304
- - Support with relevant context from the knowledge base
305
- - End with helpful next steps or related information
306
- \`\`\`
307
-
308
- ### Parameter Recommendations:
309
-
310
- 1. **Temperature**:
311
- ${answerStyle === 'technical' ? '0.3-0.5 (more precise, less creative)' : answerStyle === 'friendly' ? '0.7-0.9 (more conversational)' : '0.5-0.7 (balanced)'}
312
-
313
- 2. **top_k**:
314
- - 3-5 for focused answers
315
- - 5-8 for comprehensive responses
316
- - 8-10 for exploratory questions
317
-
318
- 3. **threshold**:
319
- - 0.7+ for high confidence answers
320
- - 0.5-0.7 for broader context inclusion
321
-
322
- ### Chat History Usage:
323
-
324
- Include previous conversation context to:
325
- - Maintain conversation flow
326
- - Reference previous questions
327
- - Build on established context
328
- - Avoid repeating information
329
-
330
- ### Example Usage:
331
-
332
- \`\`\`javascript
333
- {
334
- "namespace": "your-namespace",
335
- "query": "How do I configure authentication?",
336
- "header_prompt": "You are a technical assistant...",
337
- "footer_prompt": "Always include code examples...",
338
- "temperature": 0.5,
339
- "top_k": 5,
340
- "chat_history": [
341
- {"role": "user", "content": "Previous question..."},
342
- {"role": "assistant", "content": "Previous answer..."}
343
- ]
344
- }
345
- \`\`\`
346
-
347
- This configuration will provide ${answerStyle} answers tailored to your ${contextType} use case.
348
- `;
349
-
350
- return {
351
- messages: [
352
- {
353
- role: 'assistant',
354
- content: { type: 'text', text }
355
- }
356
- ]
357
- };
358
- }
1
+ import { z } from 'zod';
2
+
3
+ // Search optimization prompt
4
+ export const searchOptimizationPrompt = {
5
+ name: 'search-optimization',
6
+ description: 'Tips for optimizing search queries in Moorcheh',
7
+ argsSchema: {
8
+ search_type: z.enum(['text','vector']).optional().describe('Type of search (text or vector)'),
9
+ domain: z.string().optional().describe('Domain or topic area of your content')
10
+ },
11
+ handler: async (args) => {
12
+ const searchType = args?.search_type || 'text';
13
+ const domain = args?.domain || 'general';
14
+
15
+ const text = `# Moorcheh Search Optimization Guide
16
+
17
+ ## Optimizing ${searchType} search for ${domain} content
18
+
19
+ ### Request Format Examples:
20
+
21
+ **Text Search Request:**
22
+ \`\`\`json
23
+ {
24
+ "query": "your search text here",
25
+ "namespaces": ["your-namespace"],
26
+ "top_k": 10,
27
+ "kiosk_mode": false
28
+ }
29
+ \`\`\`
30
+
31
+ **Vector Search Request:**
32
+ \`\`\`json
33
+ {
34
+ "query": [0.1, 0.2, 0.3, ..., 0.768],
35
+ "namespaces": ["vector-embeddings"],
36
+ "top_k": 5,
37
+ "kiosk_mode": true,
38
+ "threshold": 0.1
39
+ }
40
+ \`\`\`
41
+
42
+ **cURL Example for Vector Search:**
43
+ \`\`\`bash
44
+ curl -X POST "https://api.moorcheh.ai/v1/search" \\
45
+ -H "Content-Type: application/json" \\
46
+ -H "x-api-key: your-api-key-here" \\
47
+ -d '{
48
+ "query": [0.1, 0.2, 0.3, ..., 0.768],
49
+ "namespaces": ["vector-embeddings"],
50
+ "top_k": 5,
51
+ "kiosk_mode": true,
52
+ "threshold": 0.1
53
+ }'
54
+ \`\`\`
55
+
56
+ ### Search Strategy:
57
+
58
+ ${searchType === 'text' ? `
59
+ **Text Search Best Practices:**
60
+ - Use specific, descriptive terms rather than generic ones
61
+ - Include key domain terminology from your ${domain} field
62
+ - Try both short keywords and longer phrases
63
+ - Use synonyms if initial searches don't return good results
64
+ - Natural language queries work well for semantic search
65
+
66
+ **Query Examples:**
67
+ - Instead of: "help"
68
+ - Try: "troubleshooting guide", "how to resolve", "step by step"
69
+ - Use complete sentences: "How do I configure authentication?"
70
+ - Include context: "Python authentication setup for web applications"
71
+ ` : `
72
+ **Vector Search Best Practices:**
73
+ - Ensure your query embeddings use the same model as your stored vectors
74
+ - Vector search works well with semantic similarity
75
+ - Natural language queries often work better than keywords
76
+ - Consider the context and intent behind your search
77
+ - Match vector dimensions with your namespace configuration
78
+
79
+ **Query Optimization:**
80
+ - Use complete sentences or questions for better semantic matching
81
+ - Include relevant context in your query
82
+ - Test with variations of the same concept
83
+ - Ensure vector dimensions match your namespace (e.g., 768 for many models)
84
+ `}
85
+
86
+ ### Parameter Tuning:
87
+
88
+ 1. **top_k**: Number of results to return (default: 10)
89
+ - Start with 5-10 for most use cases
90
+ - Increase for broader exploration
91
+ - Decrease for highly targeted results
92
+
93
+ 2. **threshold**: Similarity threshold (0-1, optional)
94
+ - 0.7-0.8: High similarity, fewer but more relevant results
95
+ - 0.5-0.7: Moderate similarity, balanced results
96
+ - 0.3-0.5: Lower similarity, more comprehensive results
97
+ - **Important**: When kiosk_mode is true, threshold becomes mandatory
98
+
99
+ 3. **kiosk_mode**: Boolean (default: false)
100
+ - true: Restrict search to specific namespace(s) with threshold filtering
101
+ - false: Search across all specified namespaces
102
+ - **Note**: When kiosk_mode is enabled, threshold parameter is required
103
+
104
+ ### Kiosk Mode Requirements:
105
+
106
+ When using kiosk_mode=true:
107
+ - **threshold parameter is mandatory**
108
+ - Results are filtered by the specified threshold
109
+ - Useful for production environments with strict relevance requirements
110
+ - Example: kiosk_mode=true with threshold=0.7 ensures only high-confidence results
111
+
112
+ ### Domain-Specific Tips for ${domain}:
113
+ - Use terminology specific to ${domain}
114
+ - Consider the typical language patterns in your content
115
+ - Test with actual user queries from your ${domain} context
116
+ - Monitor search performance and adjust parameters accordingly
117
+ - For technical content, include specific technology names and versions
118
+
119
+ ### Troubleshooting:
120
+ - If no results: Lower threshold, check spelling, try synonyms
121
+ - If too many irrelevant results: Raise threshold, use more specific terms
122
+ - If results seem random: Check your embeddings model compatibility
123
+ - For vector search: Verify vector dimensions match namespace configuration
124
+ - For kiosk mode: Ensure threshold is provided when kiosk_mode=true
125
+
126
+ ### Response Format:
127
+ The search returns results with:
128
+ - **id**: Document identifier
129
+ - **score**: Similarity score (0-1, higher is better)
130
+ - **label**: Relevance label (Close Match, Very High Relevance, etc.)
131
+ - **text**: Original text content (for text namespaces)
132
+ - **metadata**: Associated metadata
133
+ `;
134
+
135
+ return {
136
+ messages: [
137
+ {
138
+ role: 'assistant',
139
+ content: { type: 'text', text }
140
+ }
141
+ ]
142
+ };
143
+ }
144
+ };
145
+
146
+ // Data organization prompt
147
+ export const dataOrganizationPrompt = {
148
+ name: 'data-organization',
149
+ description: 'Best practices for organizing data in Moorcheh namespaces',
150
+ argsSchema: {
151
+ content_type: z.string().optional().describe("Type of content you're organizing"),
152
+ team_size: z.enum(['small','large']).optional().describe('Size of your team using this data')
153
+ },
154
+ handler: async (args) => {
155
+ const contentType = args?.content_type || 'documents';
156
+ const teamSize = args?.team_size || 'small';
157
+
158
+ const text = `# Moorcheh Data Organization Guide
159
+
160
+ ## Organizing ${contentType} for a ${teamSize} team
161
+
162
+ ### Namespace Strategy:
163
+
164
+ ${teamSize === 'large' ? `
165
+ **Large Team Considerations:**
166
+ - Create separate namespaces by department or project
167
+ - Use consistent naming conventions across teams
168
+ - Implement clear metadata standards
169
+ - Consider access control and permissions
170
+ ` : `
171
+ **Small Team Approach:**
172
+ - Fewer namespaces with more content per namespace
173
+ - Flexible organization that can evolve
174
+ - Focus on clear naming and good metadata
175
+ - Regular cleanup and maintenance
176
+ `}
177
+
178
+ ### Content Organization for ${contentType}:
179
+
180
+ 1. **Metadata Schema:**
181
+ \`\`\`json
182
+ {
183
+ "category": "primary classification",
184
+ "tags": ["tag1", "tag2", "tag3"],
185
+ "author": "content creator",
186
+ "created_date": "2024-01-01",
187
+ "department": "relevant team",
188
+ "priority": "high/medium/low",
189
+ "status": "draft/review/published"
190
+ }
191
+ \`\`\`
192
+
193
+ 2. **Document ID Conventions:**
194
+ - Use descriptive, hierarchical IDs
195
+ - Include date/version when relevant
196
+ - Examples: "support-faq-login-2024", "product-spec-v2-auth"
197
+
198
+ 3. **Content Chunking:**
199
+ - Break large documents into logical sections
200
+ - Each chunk should be self-contained
201
+ - Include context in metadata
202
+
203
+ ### Maintenance Workflow:
204
+
205
+ 1. **Regular Reviews:**
206
+ - Monthly metadata cleanup
207
+ - Remove outdated content
208
+ - Update tags and categories
209
+
210
+ 2. **Quality Control:**
211
+ - Standardize formatting before upload
212
+ - Validate metadata completeness
213
+ - Test search functionality after major updates
214
+
215
+ 3. **Growth Planning:**
216
+ - Monitor namespace size and performance
217
+ - Plan for content archival strategy
218
+ - Consider splitting namespaces as they grow
219
+
220
+ ### Search-Friendly Organization:
221
+ - Use consistent terminology in your ${contentType}
222
+ - Include alternative phrasings in metadata
223
+ - Create logical content hierarchies
224
+ - Tag content with multiple relevant categories
225
+
226
+ This organization will help your ${teamSize} team efficiently manage and search through your ${contentType}.
227
+ `;
228
+
229
+ return {
230
+ messages: [
231
+ {
232
+ role: 'assistant',
233
+ content: { type: 'text', text }
234
+ }
235
+ ]
236
+ };
237
+ }
238
+ };
239
+
240
+ // AI answer setup prompt
241
+ export const aiAnswerSetupPrompt = {
242
+ name: 'ai-answer-setup',
243
+ description: 'Guide for configuring AI-powered answers in Moorcheh',
244
+ argsSchema: {
245
+ answer_style: z.enum(['concise','detailed','technical','friendly','balanced']).optional().describe('Desired style for AI answers'),
246
+ context_type: z.string().optional().describe('Type of context/domain for answers')
247
+ },
248
+ handler: async (args) => {
249
+ const answerStyle = args?.answer_style || 'balanced';
250
+ const contextType = args?.context_type || 'general';
251
+
252
+ const text = `# Moorcheh AI Answer Configuration Guide
253
+
254
+ ## Setting up ${answerStyle} AI answers for ${contextType} content
255
+
256
+ ### Header Prompt Configuration:
257
+
258
+ \`\`\`
259
+ You are an AI assistant specialized in ${contextType}.
260
+ Your role is to provide ${answerStyle} answers based on the provided context.
261
+
262
+ Style Guidelines:
263
+ ${answerStyle === 'concise' ? `
264
+ - Keep answers brief and to the point
265
+ - Use bullet points for multiple items
266
+ - Avoid unnecessary explanations
267
+ - Focus on actionable information
268
+ ` : answerStyle === 'detailed' ? `
269
+ - Provide comprehensive explanations
270
+ - Include relevant background information
271
+ - Use examples where helpful
272
+ - Structure answers with clear sections
273
+ ` : answerStyle === 'technical' ? `
274
+ - Use precise technical terminology
275
+ - Include code examples when relevant
276
+ - Explain complex concepts step-by-step
277
+ - Reference specific technical details
278
+ ` : answerStyle === 'friendly' ? `
279
+ - Use conversational, approachable language
280
+ - Include encouraging phrases
281
+ - Explain concepts in simple terms
282
+ - Ask clarifying questions when needed
283
+ ` : `
284
+ - Balance brevity with completeness
285
+ - Use clear, professional language
286
+ - Structure information logically
287
+ - Include key details without overwhelming
288
+ `}
289
+
290
+ Context: You have access to ${contextType} documentation and resources.
291
+ \`\`\`
292
+
293
+ ### Footer Prompt Configuration:
294
+
295
+ \`\`\`
296
+ Additional Guidelines:
297
+ - Always cite specific sources when possible
298
+ - If information is incomplete, acknowledge limitations
299
+ - Suggest follow-up questions for complex topics
300
+ - ${contextType === 'technical' ? 'Include relevant code snippets or examples' : 'Provide practical next steps'}
301
+
302
+ Response Format:
303
+ - Start with a direct answer to the question
304
+ - Support with relevant context from the knowledge base
305
+ - End with helpful next steps or related information
306
+ \`\`\`
307
+
308
+ ### Parameter Recommendations:
309
+
310
+ 1. **Temperature**:
311
+ ${answerStyle === 'technical' ? '0.3-0.5 (more precise, less creative)' : answerStyle === 'friendly' ? '0.7-0.9 (more conversational)' : '0.5-0.7 (balanced)'}
312
+
313
+ 2. **top_k**:
314
+ - 3-5 for focused answers
315
+ - 5-8 for comprehensive responses
316
+ - 8-10 for exploratory questions
317
+
318
+ 3. **threshold**:
319
+ - 0.7+ for high confidence answers
320
+ - 0.5-0.7 for broader context inclusion
321
+
322
+ ### Chat History Usage:
323
+
324
+ Include previous conversation context to:
325
+ - Maintain conversation flow
326
+ - Reference previous questions
327
+ - Build on established context
328
+ - Avoid repeating information
329
+
330
+ ### Example Usage:
331
+
332
+ \`\`\`javascript
333
+ {
334
+ "namespace": "your-namespace",
335
+ "query": "How do I configure authentication?",
336
+ "header_prompt": "You are a technical assistant...",
337
+ "footer_prompt": "Always include code examples...",
338
+ "temperature": 0.5,
339
+ "top_k": 5,
340
+ "chat_history": [
341
+ {"role": "user", "content": "Previous question..."},
342
+ {"role": "assistant", "content": "Previous answer..."}
343
+ ]
344
+ }
345
+ \`\`\`
346
+
347
+ This configuration will provide ${answerStyle} answers tailored to your ${contextType} use case.
348
+ `;
349
+
350
+ return {
351
+ messages: [
352
+ {
353
+ role: 'assistant',
354
+ content: { type: 'text', text }
355
+ }
356
+ ]
357
+ };
358
+ }
359
359
  };