AlphaEar Logic Visualizer
Create Draw.io-compatible finance logic diagrams from structured or semi-structured investment reasoning.
Inputs
- Required: title or topic plus the logic chain to visualize.
- Preferred node shape: each node has
name,typeorimpact,logic, and optionalevidence. - Ask a follow-up if the causal direction or main deliverable is unclear.
Workflow
- Extract nodes, causal edges, and impact polarity from the user's thesis.
- Classify nodes as positive, negative, or neutral.
- Use
references/PROMPTS.mdorscripts/visualizer_prompt.pyto generate plain mxGraph XML. - Validate that the XML starts with
<mxGraphModel>and ends with</mxGraphModel>. - Render to HTML with
VisualizerTools.render_drawio_to_html(xml_content, filename)fromscripts/visualizer.pywhen the user needs a file artifact. - Return the rendered HTML path and a concise explanation of the diagram structure.
Output Contract
- Deliver Draw.io XML or an HTML file that embeds the diagram.
- Use left-to-right layout for transmission chains and top-to-bottom layout for hierarchies.
- Use green for positive, red for negative, and grey for neutral impacts.
- Avoid overlapping nodes and make edge labels short.
Failure Handling
- If the thesis lacks enough structure, first produce a node/edge outline and ask for confirmation.
- If rendering fails, still return validated XML and explain how to open it in Draw.io.
- Do not invent unsupported financial relationships; mark uncertain links as assumptions.
Validation
- Run or review
tests/test_visualizer.pyafter changing scripts. - Use
evals/evals.jsonfor routing and output-contract checks.
Scan to join WeChat group