checking system…
Docs / back / config/arenas/intent_router.yaml · line 1
YAML · 78 lines
 1name: intent_router
 2description: |
 3  Free-text in → classify target_type → pick the right arena → dispatch.
 4
 5  This is MAF's "agnostic" entry point. Users (or upstream callers) submit
 6  a request without choosing an arena themselves; the classifier reads
 7  the text, extracts entities, and routes to whichever shipped arena fits.
 8
 9  Target shape:
10    target = {"text": "Should I buy NVDA right now?", "context_tickers": []}
11    target = {"text": "Walk me through the AI semis sector",
12              "context_tickers": ["NVDA","AMD","AVGO"]}
13
14  Output:
15    - The router emits a Prognosis envelope summarising the routing choice
16      (statement = "Routed to <arena>: <one-line reason>").
17    - Downstream arena emits its own envelope on its output stream;
18      consumers can chain on either.
19    - When ``dispatch_mode: auto`` (default), the router also writes a
20      ``run_arena`` control command to maf:control:in so the chosen
21      arena runs immediately.
22
23schedule: null
24output_stream: "maf:arena:intent_router:output"
25max_iterations: 1
26target_key: text
27applicable_target_types: ["free_text", "question", "ticker", "sector", "tickers", "event", "document", "deal"]
28
29llm:
30  default_provider: ollama
31  quick_provider: ollama
32  quick_model: "auto"
33  deep_provider: ollama
34  deep_model: "auto"
35  providers:
36    ollama:
37      api_key: "${OLLAMA_API_KEY}"
38      model: "auto"
39      base_url: "https://ollama.com/v1"
40      max_output_tokens: 4096
41      temperature: 0.2
42
43memory: {}
44
45# The router itself doesn't need much data — it routes based on the text.
46# The web_search adapter gives it the option to verify a ticker symbol
47# or sector name before dispatching.
48sources:
49  - name: web
50    adapter: web_search
51    config: {}
52  - name: resolve_ticker
53    adapter: eodhd
54    config: { tool: resolve_ticker }
55
56phases:
57  - name: classify
58    pattern: sequential
59    transition: synthesis
60    agents:
61      - name: intent_classifier
62        role: specialist
63        system_prompt_file: src/maf/prompts/anthropic_fs/agents/intent_classifier.md
64        sources: [web, resolve_ticker]
65        llm_tier: deep
66        max_react_steps: 3
67
68  - name: synthesis
69    pattern: sequential
70    transition: END
71    agents:
72      # Reads the classifier's signal, packages as a routing prognosis.
73      - name: synthesis_agent
74        role: synthesis
75        system_prompt_file: src/maf/arenas/trading_intelligence/prompts/synthesis_agent.txt
76        llm_tier: quick
77        max_react_steps: 1