How kaptnemo/alphabee works
AlphaBee is an A-share investment research system whose main user workflow runs a layered analysis from factual data gathering through evidence-backed investment conclusions and report output. CLI and web interfaces expose that workflow; company tracking and midterm decisions extend it across runs. The README documents the domain-stage sequence and major capabilities. Sampled excerpts additionally establish selected engine behavior and the tracking adapter’s call into the orchestrator; unsampled subsystem links are limited to documented relationships.
Main entry points: agent.py Analysis orchestrator · main.py CLI entry · pipeline.py Financial report pipeline · scheduler.py Tracking scheduler
Components 34
User interfaces
- CLI entry
alphabee/apps/cli/main.py - CLI streaming
alphabee/apps/cli/streaming.py - CLI renderer
alphabee/apps/cli/renderer.py - Web API
alphabee/apps/web/api/chat.py - Web client
web/src/hooks/useChatStream.ts
Research pipeline
- Analysis orchestrator
alphabee/orchestrator/agent.py - Fact analysis
alphabee/agents/facts/models.py - Context injection
alphabee/domain_context/context_router.py - Derived facts
alphabee/agents/derived_facts/engine.py - Derived rules
alphabee/agents/derived_facts/registry.py - Signal detection
alphabee/agents/signal/engine.py - Anomaly detection
alphabee/agents/anomaly/engine.py - Anomaly models
alphabee/agents/anomaly/models.py - Conflict exploration
alphabee/agents/explore_conflicts/agent.py - Hypothesis verification
alphabee/agents/verify_hypotheses/agent.py - Insight synthesis
alphabee/agents/insights/agent.py - Thesis generation
alphabee/agents/thesis/engine.py - Thesis review
alphabee/agents/thesis/reviewer.py - Research report
alphabee/agents/research_reports/agent.py
Data and evidence
- Market collectors
alphabee/collectors - Field adapters
alphabee/adapters/tushare.py - Financial report pipeline
alphabee/financial_report/pipeline.py - PDF OCR loader
alphabee/loader/pdf_ocr_loader.py - OCR MCP server
alphabee/mcp/pdf_ocr_server.py
Research continuity
- Midterm decision
alphabee/midterm/score_engine.py - Decision models
alphabee/midterm/models.py - Company tracking
alphabee/company_track/track.py - Tracking scheduler
alphabee/tracking/scheduler.py - Pipeline engine adapter
alphabee/tracking/engines/pipeline_engine.py - Task records
alphabee/task_records/recorder.py
Runtime services
- LLM output utilities
alphabee/utils/pipeline.py - Telemetry
alphabee/orchestrator/services/telemetry.py - Data storage paths
alphabee/utils/storage.py
Other components
- Analyst
Connections 32
- Analyst → CLI entry: submits query
README.md - CLI entry → Analysis orchestrator: starts analysis
README.md - Analyst → Web client: asks question
README.md - Web client → Web API: streams request
README.md - Web API → Analysis orchestrator: starts analysis
README.md - Analysis orchestrator → Fact analysis: collects facts
README.md - Analysis orchestrator → Context injection: injects context
README.md - Analysis orchestrator → Derived facts: computes indicators
README.md - Derived facts → Derived rules: loads rules
alphabee/agents/derived_facts/engine.py - Analysis orchestrator → Signal detection: detects signals
README.md - Analysis orchestrator → Anomaly detection: detects anomalies
README.md - Anomaly detection → Anomaly models: produces report
alphabee/agents/anomaly/engine.py - Analysis orchestrator → Conflict exploration: explores conflicts
README.md - Analysis orchestrator → Hypothesis verification: verifies evidence
README.md - Analysis orchestrator → Insight synthesis: synthesizes insights
README.md - Analysis orchestrator → Thesis generation: forms thesis
README.md - Thesis generation → Thesis review: reviews thesis
README.md - Analysis orchestrator → Research report: outputs report
README.md - Market collectors → Field adapters: normalizes fields
README.md - Financial report pipeline → PDF OCR loader: uses OCR
alphabee/financial_report/pipeline.py - Financial report pipeline → OCR MCP server: uses OCR service
alphabee/financial_report/pipeline.py - Analysis orchestrator → Midterm decision: adds decision stage
README.md - Midterm decision → Decision models: scores factors
alphabee/midterm/score_engine.py - Tracking scheduler → Company tracking: tracks companies
- Tracking scheduler → Pipeline engine adapter: runs research engine
- Pipeline engine adapter → Analysis orchestrator: invokes analysis
alphabee/tracking/engines/pipeline_engine.py - Analysis orchestrator → Task records: records run
README.md - CLI entry → CLI streaming: streams output
alphabee/apps/cli/main.py - CLI entry → CLI renderer: renders results
alphabee/apps/cli/main.py - Analysis orchestrator → Telemetry: tracks execution
- Analysis orchestrator → LLM output utilities: parses model output
- Financial report pipeline → Data storage paths: resolves data paths
alphabee/financial_report/pipeline.py