tachibot-mcp 2.0.2

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 (214) hide show
  1. package/.env.example +260 -0
  2. package/CHANGELOG.md +54 -0
  3. package/CODE_OF_CONDUCT.md +56 -0
  4. package/CONTRIBUTING.md +54 -0
  5. package/Dockerfile +36 -0
  6. package/LICENSE +644 -0
  7. package/README.md +201 -0
  8. package/SECURITY.md +95 -0
  9. package/dist/personality/komaai-expressions.js +12 -0
  10. package/dist/profiles/balanced.json +33 -0
  11. package/dist/profiles/code_focus.json +33 -0
  12. package/dist/profiles/full.json +33 -0
  13. package/dist/profiles/minimal.json +33 -0
  14. package/dist/profiles/research_power.json +33 -0
  15. package/dist/scripts/build-profiles.js +46 -0
  16. package/dist/src/application/services/focus/FocusModeRegistry.js +46 -0
  17. package/dist/src/application/services/focus/FocusTool.service.js +109 -0
  18. package/dist/src/application/services/focus/ModeRegistry.js +46 -0
  19. package/dist/src/application/services/focus/modes/focus-deep.mode.js +27 -0
  20. package/dist/src/application/services/focus/modes/status.mode.js +50 -0
  21. package/dist/src/application/services/focus/modes/tachibot-status.mode.js +50 -0
  22. package/dist/src/collaborative-orchestrator.js +391 -0
  23. package/dist/src/config/model-constants.js +188 -0
  24. package/dist/src/config/model-defaults.js +57 -0
  25. package/dist/src/config/model-preferences.js +382 -0
  26. package/dist/src/config/timeout-config.js +130 -0
  27. package/dist/src/config.js +173 -0
  28. package/dist/src/domain/interfaces/IFocusMode.js +5 -0
  29. package/dist/src/domain/interfaces/IProvider.js +6 -0
  30. package/dist/src/domain/interfaces/ITool.js +5 -0
  31. package/dist/src/focus-deep.js +245 -0
  32. package/dist/src/infrastructure/ascii/art/robots.ascii.js +16 -0
  33. package/dist/src/mcp-client.js +90 -0
  34. package/dist/src/memory/index.js +17 -0
  35. package/dist/src/memory/memory-config.js +135 -0
  36. package/dist/src/memory/memory-interface.js +174 -0
  37. package/dist/src/memory/memory-manager.js +383 -0
  38. package/dist/src/memory/providers/devlog-provider.js +385 -0
  39. package/dist/src/memory/providers/hybrid-provider.js +399 -0
  40. package/dist/src/memory/providers/local-provider.js +388 -0
  41. package/dist/src/memory/providers/mem0-provider.js +337 -0
  42. package/dist/src/modes/architect.js +477 -0
  43. package/dist/src/modes/auditor.js +362 -0
  44. package/dist/src/modes/challenger.js +841 -0
  45. package/dist/src/modes/code-reviewer.js +382 -0
  46. package/dist/src/modes/commit-guardian.js +424 -0
  47. package/dist/src/modes/documentation-writer.js +572 -0
  48. package/dist/src/modes/scout.js +587 -0
  49. package/dist/src/modes/shared/helpers/challenger-helpers.js +454 -0
  50. package/dist/src/modes/shared/helpers/index.js +17 -0
  51. package/dist/src/modes/shared/helpers/scout-helpers.js +270 -0
  52. package/dist/src/modes/shared/helpers/verifier-helpers.js +332 -0
  53. package/dist/src/modes/test-architect.js +767 -0
  54. package/dist/src/modes/verifier.js +378 -0
  55. package/dist/src/monitoring/performance-monitor.js +435 -0
  56. package/dist/src/optimization/batch-executor.js +121 -0
  57. package/dist/src/optimization/context-pruner.js +196 -0
  58. package/dist/src/optimization/cost-monitor.js +338 -0
  59. package/dist/src/optimization/index.js +65 -0
  60. package/dist/src/optimization/model-router.js +264 -0
  61. package/dist/src/optimization/result-cache.js +114 -0
  62. package/dist/src/optimization/token-optimizer.js +257 -0
  63. package/dist/src/optimization/token-tracker.js +118 -0
  64. package/dist/src/orchestrator-instructions.js +128 -0
  65. package/dist/src/orchestrator-lite.js +139 -0
  66. package/dist/src/orchestrator.js +191 -0
  67. package/dist/src/orchestrators/collaborative/interfaces/IToolExecutionEngine.js +1 -0
  68. package/dist/src/orchestrators/collaborative/interfaces/IToolExecutionStrategy.js +5 -0
  69. package/dist/src/orchestrators/collaborative/interfaces/IVisualizationRenderer.js +1 -0
  70. package/dist/src/orchestrators/collaborative/registries/ModelProviderRegistry.js +95 -0
  71. package/dist/src/orchestrators/collaborative/registries/ToolAdapterRegistry.js +64 -0
  72. package/dist/src/orchestrators/collaborative/services/tool-execution/ToolExecutionService.js +502 -0
  73. package/dist/src/orchestrators/collaborative/services/visualization/VisualizationService.js +206 -0
  74. package/dist/src/orchestrators/collaborative/types/session-types.js +5 -0
  75. package/dist/src/profiles/balanced.js +37 -0
  76. package/dist/src/profiles/code_focus.js +37 -0
  77. package/dist/src/profiles/debug_intensive.js +59 -0
  78. package/dist/src/profiles/full.js +37 -0
  79. package/dist/src/profiles/minimal.js +37 -0
  80. package/dist/src/profiles/research_code.js +59 -0
  81. package/dist/src/profiles/research_power.js +37 -0
  82. package/dist/src/profiles/types.js +5 -0
  83. package/dist/src/profiles/workflow_builder.js +53 -0
  84. package/dist/src/prompt-engineer-lite.js +78 -0
  85. package/dist/src/prompt-engineer.js +399 -0
  86. package/dist/src/reasoning-chain.js +508 -0
  87. package/dist/src/sequential-thinking.js +291 -0
  88. package/dist/src/server-diagnostic.js +74 -0
  89. package/dist/src/server-raw.js +158 -0
  90. package/dist/src/server-simple.js +58 -0
  91. package/dist/src/server.js +514 -0
  92. package/dist/src/session/session-logger.js +617 -0
  93. package/dist/src/session/session-manager.js +571 -0
  94. package/dist/src/session/session-tools.js +400 -0
  95. package/dist/src/tools/advanced-modes.js +200 -0
  96. package/dist/src/tools/claude-integration.js +356 -0
  97. package/dist/src/tools/consolidated/ai-router.js +174 -0
  98. package/dist/src/tools/consolidated/ai-tool.js +48 -0
  99. package/dist/src/tools/consolidated/brainstorm-tool.js +87 -0
  100. package/dist/src/tools/consolidated/environment-detector.js +80 -0
  101. package/dist/src/tools/consolidated/index.js +50 -0
  102. package/dist/src/tools/consolidated/search-tool.js +110 -0
  103. package/dist/src/tools/consolidated/workflow-tool.js +238 -0
  104. package/dist/src/tools/gemini-tools.js +329 -0
  105. package/dist/src/tools/grok-enhanced.js +376 -0
  106. package/dist/src/tools/grok-tools.js +299 -0
  107. package/dist/src/tools/lmstudio-tools.js +223 -0
  108. package/dist/src/tools/openai-tools.js +498 -0
  109. package/dist/src/tools/openrouter-tools.js +317 -0
  110. package/dist/src/tools/optimized-wrapper.js +204 -0
  111. package/dist/src/tools/perplexity-tools.js +294 -0
  112. package/dist/src/tools/pingpong-tool.js +343 -0
  113. package/dist/src/tools/qwen-wrapper.js +74 -0
  114. package/dist/src/tools/tool-router.js +444 -0
  115. package/dist/src/tools/unified-ai-provider.js +260 -0
  116. package/dist/src/tools/workflow-runner.js +425 -0
  117. package/dist/src/tools/workflow-validator-tool.js +107 -0
  118. package/dist/src/types.js +23 -0
  119. package/dist/src/utils/input-validator.js +130 -0
  120. package/dist/src/utils/model-router.js +91 -0
  121. package/dist/src/utils/progress-stream.js +255 -0
  122. package/dist/src/utils/provider-router.js +88 -0
  123. package/dist/src/utils/smart-api-client.js +146 -0
  124. package/dist/src/utils/table-builder.js +218 -0
  125. package/dist/src/utils/timestamp-formatter.js +134 -0
  126. package/dist/src/utils/tool-compressor.js +257 -0
  127. package/dist/src/utils/tool-config.js +201 -0
  128. package/dist/src/validators/dependency-graph-validator.js +147 -0
  129. package/dist/src/validators/interpolation-validator.js +222 -0
  130. package/dist/src/validators/output-usage-validator.js +151 -0
  131. package/dist/src/validators/syntax-validator.js +102 -0
  132. package/dist/src/validators/tool-registry-validator.js +123 -0
  133. package/dist/src/validators/tool-types.js +97 -0
  134. package/dist/src/validators/types.js +8 -0
  135. package/dist/src/validators/workflow-validator.js +134 -0
  136. package/dist/src/visualizer-lite.js +42 -0
  137. package/dist/src/visualizer.js +179 -0
  138. package/dist/src/workflows/circuit-breaker.js +199 -0
  139. package/dist/src/workflows/custom-workflows.js +451 -0
  140. package/dist/src/workflows/engine/AutoSynthesizer.js +97 -0
  141. package/dist/src/workflows/engine/StepParameterResolver.js +74 -0
  142. package/dist/src/workflows/engine/VariableInterpolator.js +123 -0
  143. package/dist/src/workflows/engine/WorkflowDiscovery.js +125 -0
  144. package/dist/src/workflows/engine/WorkflowExecutionEngine.js +485 -0
  145. package/dist/src/workflows/engine/WorkflowExecutor.js +113 -0
  146. package/dist/src/workflows/engine/WorkflowFileManager.js +244 -0
  147. package/dist/src/workflows/engine/WorkflowHelpers.js +114 -0
  148. package/dist/src/workflows/engine/WorkflowOutputFormatter.js +83 -0
  149. package/dist/src/workflows/engine/events/WorkflowEventBus.js +132 -0
  150. package/dist/src/workflows/engine/events/interfaces/IEventBus.js +5 -0
  151. package/dist/src/workflows/engine/handlers/ErrorRecoveryHandler.js +162 -0
  152. package/dist/src/workflows/engine/handlers/PromptEnhancementHandler.js +115 -0
  153. package/dist/src/workflows/engine/handlers/SessionPersistenceHandler.js +167 -0
  154. package/dist/src/workflows/engine/handlers/StepExecutionHandler.js +231 -0
  155. package/dist/src/workflows/engine/handlers/ToolInvocationHandler.js +46 -0
  156. package/dist/src/workflows/engine/interfaces/IAutoSynthesizer.js +5 -0
  157. package/dist/src/workflows/engine/interfaces/IStepParameterResolver.js +5 -0
  158. package/dist/src/workflows/engine/interfaces/IVariableInterpolator.js +5 -0
  159. package/dist/src/workflows/engine/interfaces/IWorkflowDiscovery.js +4 -0
  160. package/dist/src/workflows/engine/interfaces/IWorkflowFileManager.js +5 -0
  161. package/dist/src/workflows/engine/interfaces/IWorkflowOutputFormatter.js +5 -0
  162. package/dist/src/workflows/engine/state/WorkflowStateMachine.js +194 -0
  163. package/dist/src/workflows/engine/state/interfaces/IStateMachine.js +17 -0
  164. package/dist/src/workflows/fallback-strategies.js +373 -0
  165. package/dist/src/workflows/message-queue.js +455 -0
  166. package/dist/src/workflows/model-router.js +189 -0
  167. package/dist/src/workflows/orchestrator-examples.js +174 -0
  168. package/dist/src/workflows/orchestrator-integration.js +200 -0
  169. package/dist/src/workflows/self-healing.js +524 -0
  170. package/dist/src/workflows/tool-mapper.js +407 -0
  171. package/dist/src/workflows/tool-orchestrator.js +796 -0
  172. package/dist/src/workflows/workflow-engine.js +573 -0
  173. package/dist/src/workflows/workflow-parser.js +283 -0
  174. package/dist/src/workflows/workflow-types.js +95 -0
  175. package/dist/src/workflows.js +568 -0
  176. package/dist/test-workflow-file-output.js +93 -0
  177. package/docs/API_KEYS.md +570 -0
  178. package/docs/CLAUDE_CODE_SETUP.md +181 -0
  179. package/docs/CLAUDE_DESKTOP_MANUAL.md +127 -0
  180. package/docs/CONFIGURATION.md +745 -0
  181. package/docs/FOCUS_MODES.md +240 -0
  182. package/docs/INSTALLATION_BOTH.md +145 -0
  183. package/docs/TERMS.md +352 -0
  184. package/docs/TOOLS_REFERENCE.md +1622 -0
  185. package/docs/TOOL_PARAMETERS.md +496 -0
  186. package/docs/TOOL_PROFILES.md +236 -0
  187. package/docs/WORKFLOWS.md +987 -0
  188. package/docs/WORKFLOW_OUTPUT.md +198 -0
  189. package/docs/WORKFLOW_PROGRESS_TRACKING.md +305 -0
  190. package/docs/workflows/design-brainstorm.md +335 -0
  191. package/package.json +97 -0
  192. package/profiles/balanced.json +37 -0
  193. package/profiles/code_focus.json +37 -0
  194. package/profiles/debug_intensive.json +34 -0
  195. package/profiles/full.json +37 -0
  196. package/profiles/minimal.json +37 -0
  197. package/profiles/research_power.json +37 -0
  198. package/profiles/workflow_builder.json +37 -0
  199. package/smithery.yaml +66 -0
  200. package/start.sh +8 -0
  201. package/tools.config.json +81 -0
  202. package/tsconfig.json +18 -0
  203. package/workflows/accessibility-code-audit.yaml +92 -0
  204. package/workflows/code-architecture-review.yaml +202 -0
  205. package/workflows/code-review.yaml +142 -0
  206. package/workflows/core/iterative-problem-solver.yaml +283 -0
  207. package/workflows/creative-brainstorm-yaml.yaml +215 -0
  208. package/workflows/pingpong.yaml +141 -0
  209. package/workflows/system/README.md +412 -0
  210. package/workflows/system/challenger.yaml +175 -0
  211. package/workflows/system/scout.yaml +164 -0
  212. package/workflows/system/verifier.yaml +133 -0
  213. package/workflows/ultra-creative-brainstorm.yaml +318 -0
  214. package/workflows/ux-research-flow.yaml +92 -0
@@ -0,0 +1,745 @@
1
+ # Configuration Guide
2
+
3
+ Complete guide to configuring TachiBot MCP for optimal performance, cost control, and feature selection.
4
+
5
+ ---
6
+
7
+ ## Table of Contents
8
+
9
+ - [Quick Start](#quick-start)
10
+ - [Profile System](#profile-system)
11
+ - [Environment Variables](#environment-variables)
12
+ - [API Configuration](#api-configuration)
13
+ - [Cost & Usage Controls](#cost--usage-controls)
14
+ - [Performance Tuning](#performance-tuning)
15
+ - [Tool Management](#tool-management)
16
+ - [Advanced Configuration](#advanced-configuration)
17
+ - [Configuration Examples](#configuration-examples)
18
+ - [Troubleshooting](#troubleshooting)
19
+
20
+ ---
21
+
22
+ ## Quick Start
23
+
24
+ ### Minimal Setup
25
+
26
+ 1. **Create `.env` file:**
27
+ ```bash
28
+ cp .env.example .env
29
+ ```
30
+
31
+ 2. **Add at least one API key:**
32
+ ```bash
33
+ PERPLEXITY_API_KEY=your-key-here
34
+ ```
35
+
36
+ 3. **Choose a profile (optional):**
37
+ ```bash
38
+ TACHIBOT_PROFILE=minimal
39
+ ```
40
+
41
+ 4. **Start using TachiBot!**
42
+
43
+ ---
44
+
45
+ ## Profile System
46
+
47
+ Profiles control which tools are loaded, affecting both functionality and token usage.
48
+
49
+ ### Available Profiles
50
+
51
+ | Profile | Tools | Tokens | Use Case |
52
+ |---------|-------|--------|----------|
53
+ | `minimal` | 8 | ~4-5k | Basic tasks, learning, token constraints |
54
+ | `research_power` | 15 | ~9-10k | Research, fact-checking, verification (DEFAULT) |
55
+ | `code_focus` | 13 | ~8-9k | Software development, debugging |
56
+ | `balanced` | 17 | ~10-11k | General-purpose daily work |
57
+ | `full` | 26 | ~18-19k | Maximum capability |
58
+
59
+ ### Switching Profiles
60
+
61
+ #### Method 1: Environment Variable (Recommended)
62
+
63
+ Set `TACHIBOT_PROFILE` in your Claude/Cursor config:
64
+
65
+ **Claude Desktop** (`~/Library/Application Support/Claude/claude_desktop_config.json`):
66
+ ```json
67
+ {
68
+ "mcpServers": {
69
+ "tachibot": {
70
+ "command": "tachibot",
71
+ "env": {
72
+ "TACHIBOT_PROFILE": "minimal",
73
+ "PERPLEXITY_API_KEY": "your-key"
74
+ }
75
+ }
76
+ }
77
+ }
78
+ ```
79
+
80
+ **Cursor** (MCP settings):
81
+ ```json
82
+ {
83
+ "mcpServers": {
84
+ "tachibot": {
85
+ "command": "tachi",
86
+ "env": {
87
+ "TACHIBOT_PROFILE": "code_focus",
88
+ "OPENAI_API_KEY": "your-key"
89
+ }
90
+ }
91
+ }
92
+ }
93
+ ```
94
+
95
+ #### Method 2: Edit `tools.config.json`
96
+
97
+ ```json
98
+ {
99
+ "activeProfile": "balanced"
100
+ }
101
+ ```
102
+
103
+ Restart TachiBot after changing.
104
+
105
+ #### Method 3: Custom Profile
106
+
107
+ Create your own tool selection:
108
+
109
+ ```json
110
+ {
111
+ "customProfile": {
112
+ "enabled": true,
113
+ "description": "My custom research setup",
114
+ "tools": {
115
+ "think": true,
116
+ "focus": true,
117
+ "perplexity_ask": true,
118
+ "perplexity_research": true,
119
+ "grok_search": true,
120
+ "scout": true,
121
+ "verifier": true,
122
+ "gemini_brainstorm": true,
123
+ "qwen_coder": true,
124
+ "workflow": true
125
+ }
126
+ }
127
+ }
128
+ ```
129
+
130
+ ### Profile Precedence
131
+
132
+ 1. **Highest:** `customProfile.enabled = true` in `tools.config.json`
133
+ 2. **Medium:** `TACHIBOT_PROFILE` environment variable
134
+ 3. **Low:** `activeProfile` in `tools.config.json`
135
+ 4. **Fallback:** All tools enabled
136
+
137
+ ### Profile Details
138
+
139
+ See [TOOL_PROFILES.md](TOOL_PROFILES.md) for detailed profile documentation.
140
+
141
+ ---
142
+
143
+ ## Environment Variables
144
+
145
+ ### Profile Selection
146
+
147
+ ```bash
148
+ # Choose your tool profile
149
+ TACHIBOT_PROFILE=research_power
150
+ ```
151
+
152
+ ### API Keys
153
+
154
+ ```bash
155
+ # Core providers
156
+ PERPLEXITY_API_KEY=pplx-...
157
+ GROK_API_KEY=xai-...
158
+ OPENAI_API_KEY=sk-...
159
+ GOOGLE_API_KEY=AIza...
160
+ OPENROUTER_API_KEY=sk-or-...
161
+
162
+ # Alternative naming
163
+ XAI_API_KEY=xai-... # Alternative to GROK_API_KEY
164
+
165
+ # Optional
166
+ ANTHROPIC_API_KEY=sk-ant-...
167
+ QWEN_API_KEY=...
168
+ ```
169
+
170
+ ### Search Configuration
171
+
172
+ ```bash
173
+ # Default search provider for scout/research
174
+ # Options: perplexity, grok, both
175
+ DEFAULT_SEARCH_PROVIDER=perplexity
176
+
177
+ # Enable Grok-4 live search (costs extra per 1k sources)
178
+ ENABLE_GROK_LIVE_SEARCH=false
179
+
180
+ # Max sources for Grok searches (default: 100)
181
+ # Lower = cheaper, Higher = more comprehensive
182
+ GROK_SEARCH_SOURCES_LIMIT=100
183
+
184
+ # Prefer Perplexity in scout (recommended for cost)
185
+ SCOUT_PREFER_PERPLEXITY=true
186
+ ```
187
+
188
+ ### Cost & Usage Limits
189
+
190
+ **⚠️ IMPORTANT:** These environment variables are NOT currently enforced by TachiBot. Dollar-based cost tracking is not implemented. To control costs:
191
+ - Use `maxTokens` parameter in workflows to limit output size
192
+ - Set hard limits in provider dashboards (OpenAI, Grok, Perplexity, etc.)
193
+ - Choose cheaper models via `smartRouting` optimization
194
+ - Enable caching to reduce duplicate API calls
195
+
196
+ ### Performance
197
+
198
+ ```bash
199
+ # Enable result caching
200
+ TACHI_ENABLE_CACHE=true
201
+
202
+ # Cache TTL (seconds)
203
+ TACHI_CACHE_TTL=3600
204
+
205
+ # Enable request batching
206
+ TACHI_ENABLE_BATCHING=true
207
+
208
+ # Max ping-pong rounds
209
+ MAX_PINGPONG_ROUNDS=24
210
+
211
+ # Max reasoning rounds
212
+ MAX_REASONING_ROUNDS=5
213
+ ```
214
+
215
+ ### Tool Overrides
216
+
217
+ ```bash
218
+ # Force enable a tool (overrides profile)
219
+ ENABLE_TOOL_HUNTER=true
220
+ ENABLE_TOOL_PINGPONG=true
221
+
222
+ # Force disable a tool (overrides profile)
223
+ DISABLE_TOOL_GROK_SEARCH=true
224
+ DISABLE_TOOL_QWEN_COMPETITIVE=true
225
+
226
+ # Disable ALL tools (testing only)
227
+ DISABLE_ALL_TOOLS=false
228
+ ```
229
+
230
+ ### Model Preferences
231
+
232
+ ```bash
233
+ # Primary reasoning model
234
+ PRIMARY_REASONING_MODEL=grok_reason
235
+
236
+ # Backup reasoning models (comma-separated)
237
+ BACKUP_REASONING_MODELS=openai_brainstorm,qwq_reason
238
+
239
+ # Primary research model
240
+ PRIMARY_RESEARCH_MODEL=perplexity_research
241
+
242
+ # Primary analysis model
243
+ PRIMARY_ANALYSIS_MODEL=gemini_analyze_code
244
+ ```
245
+
246
+ ### Model Selection (Multi-Model Tools)
247
+
248
+ Configure which models are used for Scout, Challenger, and Verifier tools. These tools run multiple models in parallel for consensus/verification.
249
+
250
+ ```bash
251
+ # Scout model configuration
252
+ SCOUT_QUICK_MODELS=qwen/qwen3-coder-plus,gemini-2.5-flash,gpt-5-mini
253
+ SCOUT_RESEARCH_MODELS=qwen/qwen3-coder-plus,gemini-2.5-pro,gpt-5-mini
254
+
255
+ # Challenger model configuration
256
+ CHALLENGER_MODELS=qwen/qwen3-coder-plus,gemini-2.5-pro,gpt-5-mini
257
+
258
+ # Verifier model configuration
259
+ VERIFIER_QUICK_MODELS=qwen/qwen3-coder-plus,gemini-2.5-flash,gpt-5-mini
260
+ VERIFIER_STANDARD_MODELS=qwen/qwen3-coder-plus,gemini-2.5-pro,gpt-5-mini
261
+ VERIFIER_DEEP_MODELS=qwen/qwen3-coder-plus,gemini-2.5-pro,gpt-5
262
+
263
+ # Default models for fallback
264
+ DEFAULT_MODELS=qwen/qwen3-coder-plus,gemini-2.5-pro,gpt-5-mini
265
+ ```
266
+
267
+ **Cost Optimization:**
268
+ - **gpt-5-mini**: 60% cheaper (~$0.50/$1.00 per 1M tokens), faster, good for most tasks
269
+ - **gpt-5**: Full quality (~$1.25/$2.50 per 1M tokens), best for critical decisions
270
+ - **gemini-2.5-flash**: Faster, cheaper, good for quick checks
271
+ - **gemini-2.5-pro**: Better reasoning/accuracy, recommended for verification
272
+
273
+ **Recommendation:** Use defaults (gpt-5-mini) for 60% cost savings. Upgrade to gpt-5 only for `deep_verify` or critical workflows.
274
+
275
+ ### Model-Specific Settings
276
+
277
+ ```bash
278
+ # Grok Heavy (256k context, requires ENABLE_EXPENSIVE_MODELS=true)
279
+ ENABLE_GROK_HEAVY=false
280
+ GROK_PRIORITY=2
281
+ GROK_MAX_TOKENS=100000
282
+ GROK_COST_LIMIT=1.0
283
+ ```
284
+
285
+ ### Miscellaneous
286
+
287
+ ```bash
288
+ # Default technical domain
289
+ DEFAULT_DOMAIN=architecture
290
+
291
+ # Enable visual ASCII art
292
+ ENABLE_VISUALS=true
293
+
294
+ # Cost optimization
295
+ COST_OPTIMIZATION=true
296
+
297
+ # Debug logging
298
+ DEBUG=false
299
+ ```
300
+
301
+ ---
302
+
303
+ ## API Configuration
304
+
305
+ ### Required APIs
306
+
307
+ Different profiles require different API keys:
308
+
309
+ **minimal profile:**
310
+ - ✅ Perplexity OR Grok (for search)
311
+ - ✅ Gemini OR OpenAI (for brainstorming)
312
+
313
+ **research_power profile:**
314
+ - ✅ Perplexity (for research)
315
+ - ✅ Grok (for live search)
316
+ - ✅ OpenAI (for brainstorming)
317
+ - ✅ Gemini (for brainstorming)
318
+
319
+ **code_focus profile:**
320
+ - ✅ Grok (for code tools)
321
+ - ✅ Gemini (for code analysis)
322
+ - ✅ Qwen via OpenRouter (for code generation)
323
+
324
+ **full profile:**
325
+ - ✅ All API keys for maximum capability
326
+
327
+ ### Where to Get API Keys
328
+
329
+ See [API_KEYS.md](API_KEYS.md) for detailed instructions on obtaining API keys from each provider.
330
+
331
+ Quick links:
332
+ - Perplexity: https://www.perplexity.ai/settings/api
333
+ - Grok/xAI: https://console.x.ai/
334
+ - OpenAI: https://platform.openai.com/api-keys
335
+ - Google Gemini: https://aistudio.google.com/apikey
336
+ - OpenRouter: https://openrouter.ai/keys
337
+
338
+ ---
339
+
340
+ ## Cost & Usage Controls
341
+
342
+ **⚠️ IMPORTANT:** TachiBot does NOT enforce dollar-based cost limits internally.
343
+
344
+ ### Setting Spending Limits
345
+
346
+ **Method 1: Provider Dashboard Limits (RECOMMENDED)**
347
+
348
+ Set hard limits in each provider's dashboard - these are the ONLY enforced limits:
349
+ - **OpenAI:** https://platform.openai.com/settings/organization/limits
350
+ - **Google Cloud:** Budget alerts in billing console
351
+ - **OpenRouter:** Budget limits in settings
352
+ - **Perplexity:** Check usage at https://www.perplexity.ai/settings/billing
353
+ - **Grok/xAI:** Check usage at https://console.x.ai/billing
354
+
355
+ **Method 2: Token Limits in Workflows**
356
+
357
+ Control costs by limiting tokens per workflow step:
358
+ ```yaml
359
+ steps:
360
+ - tool: openai_brainstorm
361
+ input:
362
+ problem: "${query}"
363
+ maxTokens: 500 # Limits output to 500 tokens
364
+ ```
365
+
366
+ ### Cost Optimization Strategies
367
+
368
+ #### 1. Choose Right Profile
369
+
370
+ ```bash
371
+ TACHIBOT_PROFILE=minimal # Lowest cost
372
+ ```
373
+
374
+ #### 2. Disable Expensive Tools
375
+
376
+ ```bash
377
+ DISABLE_TOOL_GROK_SEARCH=true
378
+ DISABLE_TOOL_PERPLEXITY_RESEARCH=true
379
+ ```
380
+
381
+ #### 3. Limit Grok Search Sources
382
+
383
+ ```bash
384
+ GROK_SEARCH_SOURCES_LIMIT=20 # Lower = cheaper
385
+ ```
386
+
387
+ #### 4. Prefer Cheaper Providers
388
+
389
+ ```bash
390
+ DEFAULT_SEARCH_PROVIDER=perplexity # Cheaper than Grok
391
+ SCOUT_PREFER_PERPLEXITY=true
392
+ ```
393
+
394
+ #### 5. Enable Caching
395
+
396
+ ```bash
397
+ TACHI_ENABLE_CACHE=true
398
+ TACHI_CACHE_TTL=3600 # Cache for 1 hour
399
+ ```
400
+
401
+ #### 6. Use Cost Optimization Mode
402
+
403
+ ```bash
404
+ COST_OPTIMIZATION=true # Prefer cheaper models
405
+ ```
406
+
407
+ ### Monitoring Costs
408
+
409
+ Check usage in provider dashboards:
410
+ - Perplexity: https://www.perplexity.ai/settings/billing
411
+ - Grok: https://console.x.ai/billing
412
+ - OpenAI: https://platform.openai.com/usage
413
+ - Google: https://console.cloud.google.com/billing
414
+ - OpenRouter: https://openrouter.ai/activity
415
+
416
+ ---
417
+
418
+ ## Performance Tuning
419
+
420
+ ### Caching
421
+
422
+ Enable caching to avoid duplicate API calls:
423
+
424
+ ```bash
425
+ TACHI_ENABLE_CACHE=true
426
+ TACHI_CACHE_TTL=3600 # 1 hour in seconds
427
+ ```
428
+
429
+ **Benefits:**
430
+ - Saves money on duplicate requests
431
+ - Faster responses for cached queries
432
+ - Reduces API rate limit pressure
433
+
434
+ **Caveats:**
435
+ - Cached results may be stale
436
+ - Increase TTL for static data, decrease for real-time
437
+
438
+ ### Batching
439
+
440
+ Enable request batching for parallel execution:
441
+
442
+ ```bash
443
+ TACHI_ENABLE_BATCHING=true
444
+ ```
445
+
446
+ **Benefits:**
447
+ - Faster parallel tool execution
448
+ - Better resource utilization
449
+
450
+ ### Reasoning Rounds
451
+
452
+ Control depth vs speed tradeoff:
453
+
454
+ ```bash
455
+ MAX_REASONING_ROUNDS=5 # For focus tool
456
+ MAX_PINGPONG_ROUNDS=24 # For pingpong tool
457
+ ```
458
+
459
+ **Lower rounds = Faster + Cheaper**
460
+ **Higher rounds = Deeper reasoning + More expensive**
461
+
462
+ ### Model Priority
463
+
464
+ Control which models are used first:
465
+
466
+ ```bash
467
+ GROK_PRIORITY=1 # Lower = higher priority
468
+ QWEN_CODER_PRIORITY=2
469
+ ```
470
+
471
+ ---
472
+
473
+ ## Tool Management
474
+
475
+ ### Viewing Active Tools
476
+
477
+ On startup, TachiBot shows:
478
+ ```
479
+ 📋 Using profile 'research_power'
480
+ Research-focused with Grok search + all Perplexity + brainstorming (~9-10k tokens, 15 tools)
481
+ 🚀 TachiBot MCP Server v5.0
482
+ Tools registered: 15 active
483
+ ```
484
+
485
+ ### Disabling Specific Tools
486
+
487
+ #### Via Environment Variable
488
+
489
+ ```bash
490
+ DISABLE_TOOL_GROK_SEARCH=true
491
+ DISABLE_TOOL_HUNTER=true
492
+ ```
493
+
494
+ #### Via Custom Profile
495
+
496
+ In `tools.config.json`:
497
+ ```json
498
+ {
499
+ "customProfile": {
500
+ "enabled": true,
501
+ "tools": {
502
+ "think": true,
503
+ "focus": true,
504
+ "grok_search": false, // Disabled
505
+ "hunter": false // Disabled
506
+ }
507
+ }
508
+ }
509
+ ```
510
+
511
+ ### Enabling Specific Tools
512
+
513
+ ```bash
514
+ ENABLE_TOOL_PINGPONG=true
515
+ ENABLE_TOOL_CHALLENGER=true
516
+ ```
517
+
518
+ ### Tool Override Precedence
519
+
520
+ 1. **Highest:** `ENABLE_TOOL_*` environment variable
521
+ 2. **High:** `DISABLE_TOOL_*` environment variable
522
+ 3. **Medium:** Custom profile in `tools.config.json`
523
+ 4. **Low:** Selected profile
524
+ 5. **Fallback:** All tools enabled
525
+
526
+ ---
527
+
528
+ ## Advanced Configuration
529
+
530
+ ### Local Model Support (LM Studio)
531
+
532
+ ```bash
533
+ # LM Studio configuration
534
+ LMSTUDIO_BASE_URL=http://localhost:1234/v1
535
+ LMSTUDIO_MODEL=your-model-name
536
+ ```
537
+
538
+ ### Multiple Environments
539
+
540
+ Create different `.env` files for different use cases:
541
+
542
+ ```bash
543
+ # Development
544
+ .env.dev
545
+ TACHIBOT_PROFILE=minimal
546
+ DEBUG=true
547
+
548
+ # Production
549
+ .env.prod
550
+ TACHIBOT_PROFILE=balanced
551
+ DEBUG=false
552
+ ```
553
+
554
+ Use with:
555
+ ```bash
556
+ cp .env.dev .env # For development
557
+ cp .env.prod .env # For production
558
+ ```
559
+
560
+ ### CI/CD Integration
561
+
562
+ For automated testing:
563
+
564
+ ```bash
565
+ DISABLE_ALL_TOOLS=true # Disable real API calls
566
+ ENABLE_TOOL_THINK=true # Enable only local tools
567
+ ENABLE_TOOL_FOCUS=true
568
+ ```
569
+
570
+ ---
571
+
572
+ ## Configuration Examples
573
+
574
+ ### Example 1: Budget-Conscious Setup
575
+
576
+ ```bash
577
+ # Minimal profile for lowest token count
578
+ TACHIBOT_PROFILE=minimal
579
+
580
+ # Only free tier API keys
581
+ PERPLEXITY_API_KEY=...
582
+ GOOGLE_API_KEY=...
583
+
584
+ # Disable expensive tools
585
+ DISABLE_TOOL_GROK_SEARCH=true
586
+ DISABLE_TOOL_PERPLEXITY_RESEARCH=true
587
+
588
+ # Optimize for cost
589
+ COST_OPTIMIZATION=true
590
+ GROK_SEARCH_SOURCES_LIMIT=10
591
+ DEFAULT_SEARCH_PROVIDER=perplexity
592
+
593
+ # Enable caching
594
+ TACHI_ENABLE_CACHE=true
595
+ TACHI_CACHE_TTL=7200 # 2 hours
596
+ ```
597
+
598
+ **Expected monthly cost:** $10-30
599
+
600
+ ### Example 2: Research Power User
601
+
602
+ ```bash
603
+ # Research-focused profile
604
+ TACHIBOT_PROFILE=research_power
605
+
606
+ # All research API keys
607
+ PERPLEXITY_API_KEY=...
608
+ GROK_API_KEY=...
609
+ OPENAI_API_KEY=...
610
+ GOOGLE_API_KEY=...
611
+
612
+ # Enable Grok live search
613
+ ENABLE_GROK_LIVE_SEARCH=true
614
+ GROK_SEARCH_SOURCES_LIMIT=100
615
+
616
+ # Both search providers
617
+ DEFAULT_SEARCH_PROVIDER=both
618
+
619
+ # Enable all features
620
+ TACHI_ENABLE_CACHE=true
621
+ TACHI_ENABLE_BATCHING=true
622
+ ```
623
+
624
+ **Expected monthly cost:** $200-500
625
+
626
+ ### Example 3: Code Development Focus
627
+
628
+ ```bash
629
+ # Code-focused profile
630
+ TACHIBOT_PROFILE=code_focus
631
+
632
+ # Code-related API keys
633
+ GROK_API_KEY=...
634
+ GOOGLE_API_KEY=...
635
+ OPENROUTER_API_KEY=...
636
+
637
+ # Disable research tools
638
+ DISABLE_TOOL_PERPLEXITY_RESEARCH=true
639
+ DISABLE_TOOL_SCOUT=true
640
+
641
+ # Enable code tools
642
+ ENABLE_TOOL_QWEN_CODER=true
643
+
644
+ # Code domain default
645
+ DEFAULT_DOMAIN=backend
646
+ ```
647
+
648
+ **Expected monthly cost:** $50-200
649
+
650
+ ### Example 4: Maximum Capability
651
+
652
+ ```bash
653
+ # Full profile
654
+ TACHIBOT_PROFILE=full
655
+
656
+ # All API keys
657
+ PERPLEXITY_API_KEY=...
658
+ GROK_API_KEY=...
659
+ OPENAI_API_KEY=...
660
+ GOOGLE_API_KEY=...
661
+ OPENROUTER_API_KEY=...
662
+
663
+ # Enable expensive models (Grok Heavy - 256k context)
664
+ ENABLE_EXPENSIVE_MODELS=true
665
+ ENABLE_GROK_HEAVY=true
666
+
667
+ # All features enabled
668
+ ENABLE_GROK_LIVE_SEARCH=true
669
+ TACHI_ENABLE_CACHE=true
670
+ TACHI_ENABLE_BATCHING=true
671
+ MAX_PINGPONG_ROUNDS=48
672
+ MAX_REASONING_ROUNDS=10
673
+ ```
674
+
675
+ **Expected monthly cost:** $500-2000+
676
+
677
+ ---
678
+
679
+ ## Troubleshooting
680
+
681
+ ### Profile Not Loading
682
+
683
+ **Problem:** Tools from profile not appearing
684
+
685
+ **Solutions:**
686
+ 1. Check `TACHIBOT_PROFILE` spelling
687
+ 2. Restart TachiBot server
688
+ 3. Check startup logs for profile name
689
+ 4. Verify profile file exists in `profiles/`
690
+
691
+ ### Tool Still Appearing After Disable
692
+
693
+ **Problem:** Disabled tool still shows up
694
+
695
+ **Solutions:**
696
+ 1. Check tool name spelling
697
+ 2. Restart TachiBot server
698
+ 3. Verify environment variable set correctly
699
+ 4. Check for conflicting `ENABLE_TOOL_*` variable
700
+
701
+ ### Cost Limits Not Working
702
+
703
+ **Problem:** Spending exceeds limits
704
+
705
+ **Solutions:**
706
+ 1. Check provider dashboards for hard limits
707
+ 2. Reduce `GROK_SEARCH_SOURCES_LIMIT`
708
+ 3. Switch to cheaper profile
709
+ 4. Disable expensive tools
710
+
711
+ ### API Key Not Working
712
+
713
+ **Problem:** "Invalid API key" errors
714
+
715
+ **Solutions:**
716
+ 1. Verify key is correct in `.env`
717
+ 2. Check no extra spaces around key
718
+ 3. Restart TachiBot server
719
+ 4. Regenerate key in provider dashboard
720
+ 5. Check key hasn't expired
721
+
722
+ ### High Token Usage
723
+
724
+ **Problem:** Using too many tokens
725
+
726
+ **Solutions:**
727
+ 1. Switch to `minimal` profile
728
+ 2. Disable unused tools
729
+ 3. Reduce `MAX_REASONING_ROUNDS`
730
+ 4. Reduce `MAX_PINGPONG_ROUNDS`
731
+ 5. Use custom profile with only needed tools
732
+
733
+ ---
734
+
735
+ ## See Also
736
+
737
+ - [Tool Profiles](TOOL_PROFILES.md) - Detailed profile descriptions
738
+ - [API Keys](API_KEYS.md) - Getting and managing API keys
739
+ - [Tools Reference](TOOLS_REFERENCE.md) - Complete tool schemas
740
+ - [Installation](INSTALLATION.md) - Installation guide
741
+ - [Quickstart](QUICKSTART.md) - 5-minute setup
742
+
743
+ ---
744
+
745
+ **Need help?** Open an issue at https://github.com/byPawel/tachibot-mcp/issues