aia 2.0.0.0.pre.beta2 → 2.0.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +152 -223
- data/README.md +41 -18
- data/bin/aia +8 -3
- data/lib/aia/aia_completion.bash +2 -3
- data/lib/aia/aia_completion.fish +6 -5
- data/lib/aia/aia_completion.zsh +2 -3
- data/lib/aia/chat_loop.rb +16 -14
- data/lib/aia/config/cli_parser.rb +123 -91
- data/lib/aia/config/defaults.yml +18 -40
- data/lib/aia/config/mcp_parser.rb +30 -36
- data/lib/aia/config/model_spec.rb +8 -14
- data/lib/aia/config/validator.rb +102 -103
- data/lib/aia/config/value_caster.rb +76 -0
- data/lib/aia/config.rb +70 -53
- data/lib/aia/crew.rb +29 -19
- data/lib/aia/debate_handler.rb +27 -10
- data/lib/aia/directives/configuration_directives.rb +55 -14
- data/lib/aia/directives/context_directives.rb +24 -12
- data/lib/aia/directives/execution_directives.rb +18 -23
- data/lib/aia/directives/model_directives.rb +41 -104
- data/lib/aia/directives/utility_directives.rb +16 -17
- data/lib/aia/directives/web_and_file_directives.rb +21 -14
- data/lib/aia/fact_asserter.rb +3 -3
- data/lib/aia/history_transfer.rb +64 -24
- data/lib/aia/logger.rb +14 -46
- data/lib/aia/mcp_config_normalizer.rb +27 -14
- data/lib/aia/mcp_connection_manager.rb +181 -184
- data/lib/aia/mcp_discovery.rb +43 -15
- data/lib/aia/mcp_grouper.rb +2 -1
- data/lib/aia/mcp_server_config.rb +20 -2
- data/lib/aia/mcp_utility.rb +24 -19
- data/lib/aia/mention_router.rb +15 -2
- data/lib/aia/modality_query.rb +36 -0
- data/lib/aia/model_alias_registry.rb +11 -11
- data/lib/aia/model_registry.rb +75 -0
- data/lib/aia/network_builder.rb +8 -7
- data/lib/aia/patches/mcp_stdio_stderr.rb +102 -0
- data/lib/aia/patches/ruby_llm_streaming_error.rb +21 -4
- data/lib/aia/patches/ruby_llm_tool_param_compat.rb +18 -0
- data/lib/aia/pipeline_orchestrator.rb +71 -38
- data/lib/aia/prompt_decomposer.rb +1 -1
- data/lib/aia/prompt_handler.rb +56 -29
- data/lib/aia/provider_registry.rb +105 -0
- data/lib/aia/robot_builder.rb +1 -1
- data/lib/aia/robot_factory.rb +67 -63
- data/lib/aia/robot_sync.rb +79 -0
- data/lib/aia/role_catalog.rb +89 -0
- data/lib/aia/session.rb +25 -11
- data/lib/aia/skill_utils.rb +60 -19
- data/lib/aia/spawn_handler.rb +16 -4
- data/lib/aia/spawn_spec_parser.rb +6 -7
- data/lib/aia/special_mode_handler.rb +28 -25
- data/lib/aia/speech.rb +70 -34
- data/lib/aia/startup_coordinator.rb +17 -92
- data/lib/aia/streaming_runner.rb +10 -2
- data/lib/aia/system_prompt_assembler.rb +12 -11
- data/lib/aia/task_board.rb +60 -0
- data/lib/aia/tool_approver.rb +205 -0
- data/lib/aia/tool_filter.rb +1 -10
- data/lib/aia/tool_filter_strategy.rb +12 -1
- data/lib/aia/tool_introspection.rb +9 -1
- data/lib/aia/tool_loader.rb +67 -33
- data/lib/aia/tool_utility.rb +6 -5
- data/lib/aia/tools/delegate_to_foreman_tool.rb +6 -4
- data/lib/aia/tools/recruit_robot_tool.rb +12 -12
- data/lib/aia/tools/reskill_robot_tool.rb +7 -7
- data/lib/aia/tools/task_board_tool.rb +16 -16
- data/lib/aia/trakflow_bridge.rb +14 -8
- data/lib/aia/turn_state.rb +31 -8
- data/lib/aia/ui_presenter.rb +16 -0
- data/lib/aia/utility.rb +6 -24
- data/lib/aia/variable_input_collector.rb +0 -3
- data/lib/aia/verification_network.rb +9 -10
- data/lib/aia/version.rb +1 -9
- data/lib/aia.rb +34 -8
- metadata +20 -161
- data/.better-commits.json +0 -150
- data/.config/tocer/configuration.yml +0 -6
- data/.envrc +0 -19
- data/.loki +0 -11
- data/.reek.yml +0 -160
- data/.rubocop.yml +0 -116
- data/.rubocop_strict.yml +0 -15
- data/.version +0 -1
- data/COMMITS.md +0 -196
- data/IMPLEMENTATION_PLAN.md +0 -506
- data/Rakefile +0 -47
- data/_typos.toml +0 -10
- data/aia.gemspec +0 -92
- data/architecture_review.md +0 -314
- data/config/aia.yml +0 -13
- data/docs/AGENTS.md +0 -40
- data/docs/advanced-prompting.md +0 -814
- data/docs/assets/images/aia.png +0 -0
- data/docs/cli-reference.md +0 -1241
- data/docs/configuration.md +0 -747
- data/docs/contributing.md +0 -386
- data/docs/directives-reference.md +0 -1145
- data/docs/examples/index.md +0 -277
- data/docs/examples/mcp/index.md +0 -475
- data/docs/examples/prompts/analysis/index.md +0 -78
- data/docs/examples/prompts/automation/index.md +0 -109
- data/docs/examples/prompts/development/index.md +0 -125
- data/docs/examples/prompts/index.md +0 -333
- data/docs/examples/prompts/learning/index.md +0 -127
- data/docs/examples/prompts/writing/index.md +0 -62
- data/docs/examples/tools/index.md +0 -282
- data/docs/faq.md +0 -578
- data/docs/guides/available-models.md +0 -366
- data/docs/guides/basic-usage.md +0 -478
- data/docs/guides/chat.md +0 -680
- data/docs/guides/crew.md +0 -239
- data/docs/guides/executable-prompts.md +0 -331
- data/docs/guides/first-prompt.md +0 -454
- data/docs/guides/getting-started.md +0 -455
- data/docs/guides/image-generation.md +0 -507
- data/docs/guides/index.md +0 -48
- data/docs/guides/local-models.md +0 -306
- data/docs/guides/migrate-prompts.md +0 -335
- data/docs/guides/models.md +0 -1017
- data/docs/guides/shared-tools.md +0 -254
- data/docs/guides/tools.md +0 -831
- data/docs/index.md +0 -259
- data/docs/installation.md +0 -274
- data/docs/mcp-integration.md +0 -603
- data/docs/prompt_management.md +0 -665
- data/docs/security.md +0 -674
- data/docs/special_projects_guide.md +0 -386
- data/docs/tools-and-mcp-examples.md +0 -1211
- data/docs/workflows-and-pipelines.md +0 -636
- data/examples/.gitignore +0 -2
- data/examples/00_setup_aia.sh +0 -111
- data/examples/01_basic_usage.sh +0 -23
- data/examples/02_frontmatter.sh +0 -33
- data/examples/03_shell_integration.sh +0 -55
- data/examples/04_erb_templating.sh +0 -56
- data/examples/05_shell_then_erb.sh +0 -38
- data/examples/06_prompt_chaining.sh +0 -59
- data/examples/07_pipeline.sh +0 -46
- data/examples/08_context_files.sh +0 -43
- data/examples/09_roles.sh +0 -67
- data/examples/10_stdin_piping.sh +0 -49
- data/examples/11_multi_model.sh +0 -65
- data/examples/12_token_usage.sh +0 -52
- data/examples/13_cost_tracking.sh +0 -68
- data/examples/14_output_file.sh +0 -91
- data/examples/15_parameters.sh +0 -68
- data/examples/16_directives.sh +0 -113
- data/examples/17_require_and_conditionals.sh +0 -68
- data/examples/18_tools.sh +0 -61
- data/examples/19_local_tools.sh +0 -34
- data/examples/20_mcp_servers.sh +0 -102
- data/examples/21_executable_prompts.sh +0 -78
- data/examples/22_chat_mode.sh +0 -217
- data/examples/23_verify.sh +0 -139
- data/examples/24_decompose.sh +0 -139
- data/examples/25_spawn.sh +0 -139
- data/examples/26_debate.sh +0 -97
- data/examples/27_mention_routing.sh +0 -157
- data/examples/28_model_switching.sh +0 -106
- data/examples/29_agent_harness.sh +0 -177
- data/examples/README.md +0 -321
- data/examples/advanced_multi_robot_capabilities_without_examples.md +0 -106
- data/examples/aia_config.yml +0 -22
- data/examples/aia_config_orchestrator.yml +0 -45
- data/examples/aia_config_with_mcp.yml +0 -21
- data/examples/common.sh +0 -39
- data/examples/context/project_goals.md +0 -6
- data/examples/context/tech_stack.md +0 -7
- data/examples/directives/timestamp_directive.rb +0 -22
- data/examples/mcp/filesystem.json +0 -9
- data/examples/prompts_dir/analyze.md +0 -2
- data/examples/prompts_dir/brainstorm.md +0 -2
- data/examples/prompts_dir/conditional.md +0 -17
- data/examples/prompts_dir/creative.md +0 -4
- data/examples/prompts_dir/erbinfo.md +0 -5
- data/examples/prompts_dir/erbinfo_raw.md +0 -8
- data/examples/prompts_dir/evaluate.md +0 -2
- data/examples/prompts_dir/explain_joke.md +0 -1
- data/examples/prompts_dir/explain_recursion.md +0 -1
- data/examples/prompts_dir/fun_fact +0 -3
- data/examples/prompts_dir/greeting.md +0 -8
- data/examples/prompts_dir/greeting_required.md +0 -7
- data/examples/prompts_dir/hello.md +0 -1
- data/examples/prompts_dir/includes/ruby_facts.md +0 -4
- data/examples/prompts_dir/limerick.md +0 -1
- data/examples/prompts_dir/list_with_mcp.md +0 -3
- data/examples/prompts_dir/pick_best.md +0 -2
- data/examples/prompts_dir/project_summary +0 -12
- data/examples/prompts_dir/quiz_with_include.md +0 -6
- data/examples/prompts_dir/require_demo.md +0 -5
- data/examples/prompts_dir/roles/formal.md +0 -3
- data/examples/prompts_dir/roles/orchestrator.md +0 -21
- data/examples/prompts_dir/roles/pirate.md +0 -3
- data/examples/prompts_dir/shell_then_erb.md +0 -6
- data/examples/prompts_dir/sort_compare.md +0 -2
- data/examples/prompts_dir/summarize_context.md +0 -2
- data/examples/prompts_dir/sysinfo.md +0 -5
- data/examples/prompts_dir/sysinfo_raw.md +0 -8
- data/examples/prompts_dir/tagline.md +0 -1
- data/examples/prompts_dir/tell_joke.md +0 -1
- data/examples/prompts_dir/tell_joke_with_next.md +0 -4
- data/examples/prompts_dir/use_local_tool.md +0 -8
- data/examples/prompts_dir/use_tools.md +0 -8
- data/examples/prompts_dir/weather.md +0 -2
- data/examples/prompts_dir/whats_new.md +0 -2
- data/examples/prompts_dir/with_timestamp.md +0 -5
- data/examples/requirements/sinatra_taskflow_app.md +0 -139
- data/examples/rules/01_classify_ruby.rb +0 -16
- data/examples/rules/02_prefer_claude_for_code.rb +0 -19
- data/examples/rules/03_gate_prompt_length.rb +0 -19
- data/examples/rules/04_tool_selection.rb +0 -41
- data/examples/rules/README.md +0 -30
- data/examples/run_all.sh +0 -294
- data/examples/tools/word_count_tool.rb +0 -30
- data/lib/AGENTS.md +0 -57
- data/lib/aia/model_switch_handler.rb +0 -100
- data/mcp_servers/README.md +0 -110
- data/mcp_servers/apple-mcp.json +0 -8
- data/mcp_servers/filesystem.json +0 -9
- data/mcp_servers/mcp_server_chart.json +0 -11
- data/mcp_servers/playwright_one.json +0 -8
- data/mcp_servers/playwright_server_definition.json +0 -9
- data/mcp_servers/playwright_two.json +0 -8
- data/mcp_servers/tavily_mcp_server.json +0 -8
- data/mkdocs.yml +0 -169
|
@@ -1,386 +0,0 @@
|
|
|
1
|
-
<!-- Tocer[start]: Auto-generated, don't remove. -->
|
|
2
|
-
|
|
3
|
-
## Table of Contents
|
|
4
|
-
|
|
5
|
-
- [Special Projects Guide](#special-projects-guide)
|
|
6
|
-
- [Table of Contents](#table-of-contents)
|
|
7
|
-
- [Dynamic Model Switching](#dynamic-model-switching)
|
|
8
|
-
- [@mention Routing](#mention-routing)
|
|
9
|
-
- [Supported Phrases](#supported-phrases)
|
|
10
|
-
- [How It Works](#how-it-works)
|
|
11
|
-
- [Model Aliases](#model-aliases)
|
|
12
|
-
- [Custom Aliases](#custom-aliases)
|
|
13
|
-
- [Conversation History on Switch](#conversation-history-on-switch)
|
|
14
|
-
- [MCP Server Concurrency](#mcp-server-concurrency)
|
|
15
|
-
- [Configuration](#configuration)
|
|
16
|
-
- [Three Ways to Trigger](#three-ways-to-trigger)
|
|
17
|
-
- [Server Grouping](#server-grouping)
|
|
18
|
-
- [TrakFlow Integration](#trakflow-integration)
|
|
19
|
-
- [Setup](#setup)
|
|
20
|
-
- [Chat Directives](#chat-directives)
|
|
21
|
-
- [Pipeline Tracking](#pipeline-tracking)
|
|
22
|
-
- [Session Continuity](#session-continuity)
|
|
23
|
-
- [Expert Routing](#expert-routing)
|
|
24
|
-
- [Enable](#enable)
|
|
25
|
-
- [How It Works](#how-it-works-1)
|
|
26
|
-
- [Example Flow](#example-flow)
|
|
27
|
-
- [Verification Networks](#verification-networks)
|
|
28
|
-
- [Usage](#usage)
|
|
29
|
-
- [How It Works](#how-it-works-2)
|
|
30
|
-
- [Prompt Decomposition](#prompt-decomposition)
|
|
31
|
-
- [Usage](#usage-1)
|
|
32
|
-
- [How It Works](#how-it-works-3)
|
|
33
|
-
- [Session Tracking and Learning](#session-tracking-and-learning)
|
|
34
|
-
- [What's Tracked](#whats-tracked)
|
|
35
|
-
- [Learning Rules](#learning-rules)
|
|
36
|
-
- [Configuration Reference](#configuration-reference)
|
|
37
|
-
- [New Config Sections](#new-config-sections)
|
|
38
|
-
- [MCP Server Metadata Fields](#mcp-server-metadata-fields)
|
|
39
|
-
|
|
40
|
-
<!-- Tocer[finish]: Auto-generated, don't remove. -->
|
|
41
|
-
|
|
42
|
-
# Special Projects Guide
|
|
43
|
-
|
|
44
|
-
This guide documents the advanced features implemented from the Special Projects roadmap. Each feature builds on AIA v2's architecture of RobotFactory, ChatLoop, and the directive system.
|
|
45
|
-
|
|
46
|
-
## Table of Contents
|
|
47
|
-
|
|
48
|
-
1. [Dynamic Model Switching](#dynamic-model-switching)
|
|
49
|
-
2. [MCP Server Concurrency](#mcp-server-concurrency)
|
|
50
|
-
3. [TrakFlow Integration](#trakflow-integration)
|
|
51
|
-
4. [Expert Routing](#expert-routing)
|
|
52
|
-
5. [Verification Networks](#verification-networks)
|
|
53
|
-
6. [Prompt Decomposition](#prompt-decomposition)
|
|
54
|
-
7. [Session Tracking and Learning](#session-tracking-and-learning)
|
|
55
|
-
8. [Configuration Reference](#configuration-reference)
|
|
56
|
-
|
|
57
|
-
---
|
|
58
|
-
|
|
59
|
-
## Dynamic Model Switching
|
|
60
|
-
|
|
61
|
-
Switch models mid-chat using natural language instead of the formal `/model` directive.
|
|
62
|
-
|
|
63
|
-
### @mention Routing
|
|
64
|
-
In a multi-model network, route a message to a specific robot by prefixing its registered name with `@`:
|
|
65
|
-
```
|
|
66
|
-
@tobor Explain your reasoning step by step.
|
|
67
|
-
```
|
|
68
|
-
Use `/robots` to see the active crew and their `@mention` handles. The mention router scans the input for `@name` tokens, matches them against robot names, and routes the prompt only to the mentioned robots.
|
|
69
|
-
|
|
70
|
-
### Supported Phrases
|
|
71
|
-
|
|
72
|
-
- **Switch**: "switch to claude", "use GPT-4o", "try gemini"
|
|
73
|
-
- **Compare**: "compare claude and gemini", "hear from both models"
|
|
74
|
-
- **Capability**: "use something cheaper", "switch to the best model"
|
|
75
|
-
|
|
76
|
-
### How It Works
|
|
77
|
-
|
|
78
|
-
1. The classification KB detects model-change intent
|
|
79
|
-
2. `ModelSwitchHandler` extracts model names from the text
|
|
80
|
-
3. Names are resolved through `ModelAliasRegistry`
|
|
81
|
-
4. User is asked to confirm before switching
|
|
82
|
-
5. Robot is rebuilt with the new model(s)
|
|
83
|
-
|
|
84
|
-
### Model Aliases
|
|
85
|
-
|
|
86
|
-
Short names, provider names, and capability descriptors all resolve to model IDs:
|
|
87
|
-
|
|
88
|
-
| Alias | Resolves To |
|
|
89
|
-
|-------|------------|
|
|
90
|
-
| claude, sonnet | claude-sonnet-4-20250514 |
|
|
91
|
-
| opus | claude-opus-4-20250514 |
|
|
92
|
-
| haiku, fast | claude-haiku-4-5-20251001 |
|
|
93
|
-
| gpt4, gpt4o | gpt-4o |
|
|
94
|
-
| cheap, gpt4mini | gpt-4o-mini |
|
|
95
|
-
| best | claude-opus-4-20250514 |
|
|
96
|
-
| gemini, flash | gemini-2.0-flash |
|
|
97
|
-
| llama | llama-3.1-70b |
|
|
98
|
-
| anthropic | claude-sonnet-4-20250514 |
|
|
99
|
-
| openai | gpt-4o |
|
|
100
|
-
| google | gemini-2.0-flash |
|
|
101
|
-
| meta | llama-3.1-70b |
|
|
102
|
-
| coding | claude-sonnet-4-20250514 |
|
|
103
|
-
| vision | gpt-4o |
|
|
104
|
-
|
|
105
|
-
### Custom Aliases
|
|
106
|
-
|
|
107
|
-
Add custom aliases in your config:
|
|
108
|
-
|
|
109
|
-
```yaml
|
|
110
|
-
# ~/.config/aia/aia.yml
|
|
111
|
-
model_aliases:
|
|
112
|
-
mymodel: my-custom-model-id
|
|
113
|
-
team: our-fine-tuned-model
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### Conversation History on Switch
|
|
117
|
-
|
|
118
|
-
Control what happens to conversation history when switching models:
|
|
119
|
-
|
|
120
|
-
```yaml
|
|
121
|
-
model_switch_history: clean # fresh start (default)
|
|
122
|
-
model_switch_history: replay # replay all messages to new model
|
|
123
|
-
model_switch_history: summarize # summarize and inject context
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
---
|
|
127
|
-
|
|
128
|
-
## MCP Server Concurrency
|
|
129
|
-
|
|
130
|
-
When a prompt needs multiple independent MCP servers, AIA can fan out to a robot-per-server and merge results.
|
|
131
|
-
|
|
132
|
-
### Configuration
|
|
133
|
-
|
|
134
|
-
Add `topics` to your MCP server configs for domain-driven routing:
|
|
135
|
-
|
|
136
|
-
```json
|
|
137
|
-
{
|
|
138
|
-
"mcpServers": {
|
|
139
|
-
"filesystem": {
|
|
140
|
-
"command": "npx",
|
|
141
|
-
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path"],
|
|
142
|
-
"topics": ["files", "code", "directory"]
|
|
143
|
-
},
|
|
144
|
-
"database": {
|
|
145
|
-
"command": "python",
|
|
146
|
-
"args": ["-m", "mcp_server_sqlite"],
|
|
147
|
-
"topics": ["data", "sql", "records"]
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
### Three Ways to Trigger
|
|
154
|
-
|
|
155
|
-
1. **Directive**: `/concurrent` before your prompt
|
|
156
|
-
2. **Auto-detection**: Set `concurrency.auto: true` in config
|
|
157
|
-
3. **Config-driven**: List independent servers in config
|
|
158
|
-
|
|
159
|
-
```yaml
|
|
160
|
-
# ~/.config/aia/aia.yml
|
|
161
|
-
concurrency:
|
|
162
|
-
auto: true
|
|
163
|
-
independent_servers: [filesystem, database, web_search]
|
|
164
|
-
threshold: 2 # minimum independent servers to trigger
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
### Server Grouping
|
|
168
|
-
|
|
169
|
-
Servers can be grouped for sequential access:
|
|
170
|
-
|
|
171
|
-
```json
|
|
172
|
-
{
|
|
173
|
-
"mcpServers": {
|
|
174
|
-
"db_reader": {
|
|
175
|
-
"command": "...",
|
|
176
|
-
"group": "database"
|
|
177
|
-
},
|
|
178
|
-
"db_writer": {
|
|
179
|
-
"command": "...",
|
|
180
|
-
"group": "database"
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
Grouped servers run sequentially within their group; different groups run concurrently.
|
|
187
|
-
|
|
188
|
-
---
|
|
189
|
-
|
|
190
|
-
## TrakFlow Integration
|
|
191
|
-
|
|
192
|
-
TrakFlow is a distributed task tracking system for AI agents. AIA connects to it as an MCP server.
|
|
193
|
-
|
|
194
|
-
### Setup
|
|
195
|
-
|
|
196
|
-
```bash
|
|
197
|
-
# Add TrakFlow MCP to your AIA config
|
|
198
|
-
aia --mcp mcp_servers/trak_flow.json --chat
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
### Chat Directives
|
|
202
|
-
|
|
203
|
-
| Directive | Description |
|
|
204
|
-
|-----------|-------------|
|
|
205
|
-
| `/tasks` | Show ready tasks |
|
|
206
|
-
| `/tasks summary` | Show project summary |
|
|
207
|
-
| `/tf` | Alias for `/tasks` |
|
|
208
|
-
| `/plan <description>` | Create a TrakFlow plan |
|
|
209
|
-
| `/task <title>` | Create a single task |
|
|
210
|
-
|
|
211
|
-
### Pipeline Tracking
|
|
212
|
-
|
|
213
|
-
Enable automatic pipeline tracking in TrakFlow:
|
|
214
|
-
|
|
215
|
-
```yaml
|
|
216
|
-
flags:
|
|
217
|
-
track_pipeline: true
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
When enabled, AIA creates a TrakFlow Plan for each pipeline and updates task status as steps complete:
|
|
221
|
-
|
|
222
|
-
```
|
|
223
|
-
Pipeline: summarize → analyze → recommend
|
|
224
|
-
|
|
225
|
-
TrakFlow Plan:
|
|
226
|
-
Step 1: summarize → started → completed ✓
|
|
227
|
-
Step 2: analyze → started → completed ✓
|
|
228
|
-
Step 3: recommend → started → in_progress...
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
### Session Continuity
|
|
232
|
-
|
|
233
|
-
When TrakFlow is connected and you start a chat session, AIA checks for open tasks from previous sessions:
|
|
234
|
-
|
|
235
|
-
```
|
|
236
|
-
Open tasks from previous sessions found:
|
|
237
|
-
- Step 4: Review auth module (blocked - needs user input)
|
|
238
|
-
- Task: Update documentation (ready)
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
---
|
|
242
|
-
|
|
243
|
-
## Expert Routing
|
|
244
|
-
|
|
245
|
-
Route different prompt types to specialist robots with different models and MCP servers.
|
|
246
|
-
|
|
247
|
-
### Enable
|
|
248
|
-
|
|
249
|
-
```yaml
|
|
250
|
-
flags:
|
|
251
|
-
expert_routing: true
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
### How It Works
|
|
255
|
-
|
|
256
|
-
1. The prompt is categorized by domain (code, data, image, planning)
|
|
257
|
-
2. The best model for that domain is selected
|
|
258
|
-
3. Relevant MCP servers are activated
|
|
259
|
-
4. `ExpertRouter` builds a specialist robot with those specifics
|
|
260
|
-
5. The specialist handles the prompt instead of the default robot
|
|
261
|
-
|
|
262
|
-
### Example Flow
|
|
263
|
-
|
|
264
|
-
```
|
|
265
|
-
User: "Refactor the auth module"
|
|
266
|
-
→ Classification: domain=code
|
|
267
|
-
→ Model Selection: claude-sonnet (code task)
|
|
268
|
-
→ MCP Routing: filesystem server activated
|
|
269
|
-
→ Expert robot built with claude-sonnet + filesystem MCP
|
|
270
|
-
→ Specialist handles the prompt
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
---
|
|
274
|
-
|
|
275
|
-
## Verification Networks
|
|
276
|
-
|
|
277
|
-
Use consensus for quality — two robots independently answer, then a third reconciles.
|
|
278
|
-
|
|
279
|
-
### Usage
|
|
280
|
-
|
|
281
|
-
```
|
|
282
|
-
/verify
|
|
283
|
-
How does quantum entanglement work?
|
|
284
|
-
```
|
|
285
|
-
|
|
286
|
-
### How It Works
|
|
287
|
-
|
|
288
|
-
1. Two verifier robots independently answer the question
|
|
289
|
-
2. A reconciler compares both answers
|
|
290
|
-
3. The reconciler produces a final, verified answer noting agreements and uncertainties
|
|
291
|
-
|
|
292
|
-
---
|
|
293
|
-
|
|
294
|
-
## Prompt Decomposition
|
|
295
|
-
|
|
296
|
-
For complex prompts, a coordinator breaks them into independent sub-tasks, executes them in parallel, then synthesizes.
|
|
297
|
-
|
|
298
|
-
### Usage
|
|
299
|
-
|
|
300
|
-
```
|
|
301
|
-
/decompose
|
|
302
|
-
Research current AI safety approaches, compare them with historical precedents,
|
|
303
|
-
and recommend a framework for our team.
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
### How It Works
|
|
307
|
-
|
|
308
|
-
1. The robot analyzes the prompt and identifies 2-5 independent sub-tasks
|
|
309
|
-
2. Each sub-task runs separately
|
|
310
|
-
3. Results are synthesized into a coherent response
|
|
311
|
-
|
|
312
|
-
If the prompt cannot be meaningfully decomposed, it falls back to normal execution.
|
|
313
|
-
|
|
314
|
-
---
|
|
315
|
-
|
|
316
|
-
## Session Tracking and Learning
|
|
317
|
-
|
|
318
|
-
AIA tracks session metrics for the post-response learning loop.
|
|
319
|
-
|
|
320
|
-
### What's Tracked
|
|
321
|
-
|
|
322
|
-
Per turn:
|
|
323
|
-
- Model used
|
|
324
|
-
- Input length
|
|
325
|
-
- Token counts
|
|
326
|
-
- Cost estimate
|
|
327
|
-
- Routing decisions
|
|
328
|
-
- Timestamp
|
|
329
|
-
|
|
330
|
-
Session-wide:
|
|
331
|
-
- Total turns
|
|
332
|
-
- Total cost
|
|
333
|
-
- Total tokens
|
|
334
|
-
- Model switch events
|
|
335
|
-
- User feedback signals
|
|
336
|
-
|
|
337
|
-
### Learning Rules
|
|
338
|
-
|
|
339
|
-
The post-response learning step fires after each response:
|
|
340
|
-
|
|
341
|
-
| Rule | Signal | Meaning |
|
|
342
|
-
|------|--------|---------|
|
|
343
|
-
| `track_model_switch` | model_dissatisfaction | User switched models after a response |
|
|
344
|
-
| `track_success` | model_success | User accepted the response |
|
|
345
|
-
| `cost_tracking` | cost_update | Running cost total |
|
|
346
|
-
|
|
347
|
-
These signals are currently informational. Future versions can use them to automatically adjust routing rules.
|
|
348
|
-
|
|
349
|
-
---
|
|
350
|
-
|
|
351
|
-
## Configuration Reference
|
|
352
|
-
|
|
353
|
-
### New Config Sections
|
|
354
|
-
|
|
355
|
-
```yaml
|
|
356
|
-
# ~/.config/aia/aia.yml
|
|
357
|
-
|
|
358
|
-
# Model aliases (custom overrides)
|
|
359
|
-
model_aliases:
|
|
360
|
-
mymodel: my-custom-model-id
|
|
361
|
-
|
|
362
|
-
# History mode on model switch
|
|
363
|
-
model_switch_history: clean # clean | replay | summarize
|
|
364
|
-
|
|
365
|
-
# MCP concurrency
|
|
366
|
-
concurrency:
|
|
367
|
-
auto: false
|
|
368
|
-
independent_servers: []
|
|
369
|
-
threshold: 2
|
|
370
|
-
|
|
371
|
-
# New flags
|
|
372
|
-
flags:
|
|
373
|
-
track_pipeline: false # Track pipelines in TrakFlow
|
|
374
|
-
expert_routing: false # Per-turn expert routing
|
|
375
|
-
```
|
|
376
|
-
|
|
377
|
-
### MCP Server Metadata Fields
|
|
378
|
-
|
|
379
|
-
```json
|
|
380
|
-
{
|
|
381
|
-
"topics": ["code", "files"],
|
|
382
|
-
"independent": true,
|
|
383
|
-
"group": "database"
|
|
384
|
-
}
|
|
385
|
-
```
|
|
386
|
-
|