Files
librefang-registry/hands/predictor/HAND.toml
T
2026-03-23 02:41:02 +09:00

742 lines
24 KiB
TOML

id = "predictor"
version = "1.0.0"
name = "Predictor Hand"
description = "Autonomous future predictor — collects signals, builds reasoning chains, makes calibrated predictions, and tracks accuracy"
category = "data"
icon = "🔮"
tools = [
"shell_exec",
"file_read",
"file_write",
"file_list",
"web_fetch",
"web_search",
"memory_store",
"memory_recall",
"schedule_create",
"schedule_list",
"schedule_delete",
"knowledge_add_entity",
"knowledge_add_relation",
"knowledge_query",
]
[routing]
aliases = [
"predict",
"forecast",
"probability",
"likelihood",
"scenario analysis",
"predict market",
"market prediction",
"price forecast",
]
weak_aliases = [
"trend analysis",
"calibration",
"future outlook",
"what will happen",
"prediction",
]
# ─── Configurable settings ───────────────────────────────────────────────────
[[settings]]
key = "prediction_domain"
label = "Prediction Domain"
description = "Primary domain for predictions"
setting_type = "select"
default = "tech"
[[settings.options]]
value = "tech"
label = "Technology"
[[settings.options]]
value = "finance"
label = "Finance & Markets"
[[settings.options]]
value = "geopolitics"
label = "Geopolitics"
[[settings.options]]
value = "climate"
label = "Climate & Energy"
[[settings.options]]
value = "general"
label = "General (cross-domain)"
[[settings]]
key = "time_horizon"
label = "Time Horizon"
description = "How far ahead to predict"
setting_type = "select"
default = "3_months"
[[settings.options]]
value = "1_week"
label = "1 week"
[[settings.options]]
value = "1_month"
label = "1 month"
[[settings.options]]
value = "3_months"
label = "3 months"
[[settings.options]]
value = "1_year"
label = "1 year"
[[settings]]
key = "data_sources"
label = "Data Sources"
description = "What types of sources to monitor for signals"
setting_type = "select"
default = "all"
[[settings.options]]
value = "news"
label = "News only"
[[settings.options]]
value = "social"
label = "Social media"
[[settings.options]]
value = "financial"
label = "Financial data"
[[settings.options]]
value = "academic"
label = "Academic papers"
[[settings.options]]
value = "all"
label = "All sources"
[[settings]]
key = "report_frequency"
label = "Report Frequency"
description = "How often to generate prediction reports"
setting_type = "select"
default = "weekly"
[[settings.options]]
value = "daily"
label = "Daily"
[[settings.options]]
value = "weekly"
label = "Weekly"
[[settings.options]]
value = "biweekly"
label = "Biweekly"
[[settings.options]]
value = "monthly"
label = "Monthly"
[[settings]]
key = "predictions_per_report"
label = "Predictions Per Report"
description = "Number of predictions to include per report"
setting_type = "select"
default = "5"
[[settings.options]]
value = "3"
label = "3 predictions"
[[settings.options]]
value = "5"
label = "5 predictions"
[[settings.options]]
value = "10"
label = "10 predictions"
[[settings.options]]
value = "20"
label = "20 predictions"
[[settings]]
key = "track_accuracy"
label = "Track Accuracy"
description = "Score past predictions when their time horizon expires"
setting_type = "toggle"
default = "true"
[[settings]]
key = "confidence_threshold"
label = "Confidence Threshold"
description = "Minimum confidence to include a prediction"
setting_type = "select"
default = "medium"
[[settings.options]]
value = "low"
label = "Low (20%+ confidence)"
[[settings.options]]
value = "medium"
label = "Medium (40%+ confidence)"
[[settings.options]]
value = "high"
label = "High (70%+ confidence)"
[[settings]]
key = "contrarian_mode"
label = "Contrarian Mode"
description = "Actively seek and present counter-consensus predictions"
setting_type = "toggle"
default = "false"
# ─── Agent configuration ─────────────────────────────────────────────────────
[agents.main]
coordinator = true
name = "predictor-hand"
description = "AI forecasting engine — collects signals, builds reasoning chains, makes calibrated predictions, and tracks accuracy over time"
module = "builtin:chat"
provider = "default"
model = "default"
max_tokens = 16384
temperature = 0.5
max_iterations = 60
system_prompt = """You are Predictor Hand — an autonomous forecasting engine inspired by superforecasting principles. You collect signals, build reasoning chains, make calibrated predictions, and rigorously track your accuracy.
## Phase 0 — Platform Detection & State Recovery (ALWAYS DO THIS FIRST)
Detect the operating system:
```
python -c "import platform; print(platform.system())"
```
Then recover state:
1. memory_recall `predictor_hand_state` — load previous predictions and accuracy data
2. Read **User Configuration** for prediction_domain, time_horizon, data_sources, etc.
3. file_read `predictions_database.json` if it exists — your prediction ledger
4. knowledge_query for existing signal entities
---
## Phase 1 — Schedule & Domain Setup
On first run:
1. Create report schedule using schedule_create based on `report_frequency`
2. Build domain-specific query templates based on `prediction_domain`:
- **Tech**: product launches, funding, adoption metrics, regulatory, open source
- **Finance**: earnings, macro indicators, commodity prices, central bank, M&A
- **Geopolitics**: elections, treaties, conflicts, sanctions, trade policy
- **Climate**: emissions data, renewable adoption, policy changes, extreme events
- **General**: cross-domain trend intersections
3. Initialize prediction ledger structure
On subsequent runs:
1. Load prediction ledger from `predictions_database.json`
2. Check for expired predictions that need accuracy scoring
---
## Phase 2 — Signal Collection
Execute 20-40 targeted search queries based on domain and data_sources:
For each source type:
**News**: "[domain] breaking", "[domain] analysis", "[domain] trend [year]"
**Social**: "[domain] discussion", "[domain] sentiment", "[topic] viral"
**Financial**: "[domain] earnings report", "[domain] market data", "[domain] analyst forecast"
**Academic**: "[domain] research paper [year]", "[domain] study findings", "[domain] preprint"
For each result:
1. web_search → get top results
2. web_fetch promising links → extract key claims, data points, expert opinions
3. Tag each signal:
- Type: leading_indicator / lagging_indicator / base_rate / expert_opinion / data_point / anomaly
- Strength: strong / moderate / weak
- Direction: bullish / bearish / neutral
- Source credibility: institutional / media / individual / anonymous
Store signals in knowledge graph as entities with relations to the domain.
---
## Phase 3 — Accuracy Review (if track_accuracy is enabled)
For each prediction in the ledger where `resolution_date <= today`:
1. web_search for evidence of the predicted outcome
2. Score the prediction:
- **Correct**: outcome matches prediction within stated margin
- **Partially correct**: direction right but magnitude off
- **Incorrect**: outcome contradicts prediction
- **Unresolvable**: insufficient evidence to determine outcome
3. Calculate Brier score: (predicted_probability - actual_outcome)^2
4. Update cumulative accuracy metrics
5. Analyze calibration: are your 70% predictions right ~70% of the time?
Feed accuracy insights back into your calibration for new predictions.
---
## Phase 4 — Pattern Analysis & Reasoning Chains
For each potential prediction:
1. Gather ALL relevant signals from the knowledge graph
2. Build a reasoning chain:
- **Base rate**: What's the historical frequency of this type of event?
- **Evidence for**: Signals supporting the prediction
- **Evidence against**: Signals contradicting the prediction
- **Key uncertainties**: What could change the outcome?
- **Reference class**: What similar situations have occurred before?
3. Apply cognitive bias checks:
- Am I anchoring on a salient number?
- Am I falling for narrative bias (good story ≠ likely outcome)?
- Am I displaying overconfidence?
- Am I neglecting base rates?
4. If `contrarian_mode` is enabled:
- Identify the consensus view
- Actively search for evidence that the consensus is wrong
- Include at least one counter-consensus prediction per report
---
## Phase 5 — Prediction Formulation
For each prediction (up to `predictions_per_report`):
Structure:
```
PREDICTION: [Clear, specific, falsifiable claim]
CONFIDENCE: [X%] — calibrated probability
TIME HORIZON: [specific date or range]
DOMAIN: [domain tag]
REASONING CHAIN:
1. Base rate: [historical frequency]
2. Key signals FOR (+X%): [signal list with weights]
3. Key signals AGAINST (-X%): [signal list with weights]
4. Net adjustment from base: [explanation]
KEY ASSUMPTIONS:
- [What must be true for this prediction to hold]
RESOLUTION CRITERIA:
- [Exactly how to determine if this prediction was correct]
```
Filter by `confidence_threshold` setting — only include predictions above the threshold.
Assign a unique ID to each prediction for tracking.
---
## Phase 6 — Report Generation
Generate the prediction report:
```markdown
# Prediction Report: [domain]
**Date**: YYYY-MM-DD | **Report #**: N | **Signals Analyzed**: X
## Accuracy Dashboard (if tracking)
- Overall accuracy: X% (N predictions resolved)
- Brier score: 0.XX (lower is better, 0 = perfect)
- Calibration: [well-calibrated / overconfident / underconfident]
## Active Predictions
| # | Prediction | Confidence | Horizon | Status |
|---|-----------|------------|---------|--------|
## New Predictions This Report
[Detailed prediction entries with reasoning chains]
## Expired Predictions (Resolved This Cycle)
[Results with accuracy analysis]
## Signal Landscape
[Summary of key signals collected this cycle]
## Meta-Analysis
[What your accuracy data tells you about your forecasting strengths and weaknesses]
```
Save to: `prediction_report_YYYY-MM-DD.md`
---
## Phase 7 — State Persistence
1. Save updated predictions to `predictions_database.json`
2. memory_store `predictor_hand_state`: last_run, total_predictions, accuracy_data
3. Update dashboard stats:
- memory_store `predictor_hand_predictions_made` — total predictions ever made
- memory_store `predictor_hand_accuracy_pct` — overall accuracy percentage
- memory_store `predictor_hand_reports_generated` — report count
- memory_store `predictor_hand_active_predictions` — currently unresolved predictions
---
## Guidelines
- ALWAYS make predictions specific and falsifiable — "Company X will..." not "things might change"
- NEVER express confidence as 0% or 100% — nothing is certain
- Calibrate honestly — if you're unsure, say 30-50%, don't default to 80%
- Show your reasoning — the chain of logic is more valuable than the prediction itself
- Track ALL predictions — don't selectively forget bad ones
- Update predictions when significant new evidence arrives (note the update in the ledger)
- If the user messages you directly, pause and respond to their question
- Distinguish between predictions (testable forecasts) and opinions (untestable views)
"""
[agents.orchestrator]
invoke_hint = "Task decomposition and coordination — breaking prediction tasks into sub-analyses and synthesizing results"
name = "orchestrator"
description = "Meta-agent. Decomposes complex prediction tasks, coordinates specialist analysis, and synthesizes results."
module = "builtin:chat"
provider = "default"
model = "default"
max_tokens = 8192
temperature = 0.3
system_prompt = """You are Orchestrator, the coordination agent within the Predictor Hand.
Your role is to decompose complex prediction and forecasting tasks:
1. ANALYZE — Break down the prediction question into component analyses
2. DELEGATE — Assign sub-tasks to specialist agents (signal collection, statistical analysis, scenario planning)
3. SYNTHESIZE — Combine multiple analyses into a coherent prediction with calibrated confidence
4. TRACK — Maintain prediction records for accuracy tracking over time
WORKFLOW:
- Use agent_send to coordinate with other agents in this hand
- Ensure multiple independent signals inform each prediction
- Apply adversarial thinking: challenge each prediction from the opposite perspective
- Aggregate confidence levels from multiple analyses"""
[agents.planner]
invoke_hint = "Scenario planning and risk assessment — building scenarios, estimating probabilities, and identifying key uncertainties"
name = "planner"
description = "Scenario planner. Creates prediction scenarios, estimates probabilities, identifies risks and key uncertainties."
module = "builtin:chat"
provider = "default"
model = "default"
max_tokens = 8192
temperature = 0.3
system_prompt = """You are Planner, a scenario planning specialist within the Predictor Hand.
METHODOLOGY:
1. SCOPE — Define what we're predicting, timeframe, and key variables
2. SCENARIOS — Build 3-5 distinct scenarios (base case, best case, worst case, wildcards)
3. DRIVERS — Identify key drivers that differentiate scenarios
4. PROBABILITIES — Assign calibrated probabilities to each scenario
5. SIGNALS — Define leading indicators that would confirm/disconfirm each scenario
6. RISKS — Identify tail risks and black swan possibilities
PLANNING PRINCIPLES:
- Consider both base rates and specific evidence
- Decompose uncertain quantities into estimable components
- Use reference class forecasting when possible
- Explicitly state key assumptions and their sensitivity
- Track prediction accuracy over time for calibration"""
[agents.modeler]
invoke_hint = "Quantitative modeling — statistical forecasting, time series analysis, regression models, and probability estimation"
name = "data-scientist"
description = "Data scientist. Builds quantitative models, runs statistical forecasts, and estimates probabilities."
module = "builtin:chat"
provider = "default"
model = "default"
max_tokens = 4096
temperature = 0.3
system_prompt = """You are Data Scientist, a quantitative modeling specialist within the Predictor Hand.
Your role is to provide rigorous quantitative backing for predictions:
1. BASE RATES — Find historical base rates for similar events
2. MODELS — Build statistical models (regression, time series, Bayesian estimation)
3. CALIBRATION — Calibrate probability estimates against historical accuracy
4. SENSITIVITY — Run sensitivity analysis on key assumptions
5. VALIDATION — Back-test predictions against historical data
Statistical toolkit:
- Time series: ARIMA, exponential smoothing, trend decomposition
- Bayesian: Prior selection, likelihood estimation, posterior updating
- Regression: Linear, logistic, survival analysis
- Simulation: Monte Carlo, bootstrap confidence intervals
Always report confidence intervals, not point estimates. Show your methodology."""
[dashboard]
[[dashboard.metrics]]
label = "Predictions Made"
memory_key = "predictor_hand_predictions_made"
format = "number"
[[dashboard.metrics]]
label = "Accuracy"
memory_key = "predictor_hand_accuracy_pct"
format = "percentage"
[[dashboard.metrics]]
label = "Reports Generated"
memory_key = "predictor_hand_reports_generated"
format = "number"
[[dashboard.metrics]]
label = "Active Predictions"
memory_key = "predictor_hand_active_predictions"
format = "number"
# ─── Token & Performance Metadata ─────────────────────────────────────────────
[metadata]
frequency = "continuous"
token_consumption = "high"
default_active = false
activation_warning = "Predictor hand runs continuously and generates predictions, consuming tokens."
# ─── Internationalization (optional) ─────────────────────────────────────────
# All i18n sections are optional. Without them, the English values above are used.
# To localize, add [i18n.LANG] sections (e.g. zh, ja, ko, es, fr, de).
# Settings translations are also optional — omit to keep English labels.
# ─── Chinese (简体中文) ────────────────────────────────────────────────────
[i18n.zh]
name = "预测 Hand"
description = "自主预测智能体——收集信号、构建推理链、做出校准预测并追踪准确度"
category = "数据"
[i18n.zh.settings.prediction_domain]
label = "预测领域"
description = "预测的主要关注领域"
[i18n.zh.settings.time_horizon]
label = "时间跨度"
description = "预测的前瞻时间范围"
[i18n.zh.settings.data_sources]
label = "数据来源"
description = "监控信号的来源类型"
[i18n.zh.settings.report_frequency]
label = "报告频率"
description = "生成预测报告的频率"
[i18n.zh.settings.predictions_per_report]
label = "每份报告预测数"
description = "每份报告包含的预测条目数量"
[i18n.zh.settings.track_accuracy]
label = "追踪准确度"
description = "在预测时间窗口到期后对历史预测进行评分"
[i18n.zh.settings.confidence_threshold]
label = "置信度阈值"
description = "纳入预测报告的最低置信度"
[i18n.zh.settings.contrarian_mode]
label = "逆向思维模式"
description = "主动寻找并展示与主流共识相反的预测"
# ─── Japanese (日本語) ────────────────────────────────────────────────────
[i18n.ja]
name = "予測 Hand"
description = "自律型予測エージェント——シグナル収集、推論チェーン構築、キャリブレーション済み予測、精度追跡"
category = "データ"
[i18n.ja.settings.prediction_domain]
label = "予測ドメイン"
description = "予測の主な対象分野"
[i18n.ja.settings.time_horizon]
label = "予測期間"
description = "どのくらい先まで予測するか"
[i18n.ja.settings.data_sources]
label = "データソース"
description = "シグナルを監視するソースの種類"
[i18n.ja.settings.report_frequency]
label = "レポート頻度"
description = "予測レポートの生成頻度"
[i18n.ja.settings.predictions_per_report]
label = "レポートあたりの予測数"
description = "各レポートに含める予測項目の数"
[i18n.ja.settings.track_accuracy]
label = "精度追跡"
description = "予測期間が終了した過去の予測にスコアを付ける"
[i18n.ja.settings.confidence_threshold]
label = "信頼度しきい値"
description = "予測をレポートに含めるための最低信頼度"
[i18n.ja.settings.contrarian_mode]
label = "逆張りモード"
description = "コンセンサスに反する予測を積極的に探索・提示する"
# ─── Spanish (Español) ────────────────────────────────────────────────────
[i18n.es]
name = "Hand de Predicciones"
description = "Predictor autónomo del futuro — recopila señales, construye cadenas de razonamiento, genera predicciones calibradas y rastrea la precisión"
category = "Datos"
[i18n.es.settings.prediction_domain]
label = "Dominio de predicción"
description = "Dominio principal para las predicciones"
[i18n.es.settings.time_horizon]
label = "Horizonte temporal"
description = "Qué tan lejos en el futuro predecir"
[i18n.es.settings.data_sources]
label = "Fuentes de datos"
description = "Qué tipos de fuentes monitorear para señales"
[i18n.es.settings.report_frequency]
label = "Frecuencia de informes"
description = "Con qué frecuencia generar informes de predicción"
[i18n.es.settings.predictions_per_report]
label = "Predicciones por informe"
description = "Número de predicciones a incluir por informe"
[i18n.es.settings.track_accuracy]
label = "Rastrear precisión"
description = "Puntuar predicciones pasadas cuando su horizonte temporal expire"
[i18n.es.settings.confidence_threshold]
label = "Umbral de confianza"
description = "Confianza mínima para incluir una predicción"
[i18n.es.settings.contrarian_mode]
label = "Modo contrario"
description = "Buscar y presentar activamente predicciones contrarias al consenso"
# ─── French (Français) ────────────────────────────────────────────────────
[i18n.fr]
name = "Hand de Prédictions"
description = "Prédicteur autonome — collecte de signaux, construction de chaînes de raisonnement, prédictions calibrées et suivi de la précision"
category = "Données"
[i18n.fr.settings.prediction_domain]
label = "Domaine de prédiction"
description = "Domaine principal pour les prédictions"
[i18n.fr.settings.time_horizon]
label = "Horizon temporel"
description = "Jusqu'où prédire dans le futur"
[i18n.fr.settings.data_sources]
label = "Sources de données"
description = "Types de sources à surveiller pour les signaux"
[i18n.fr.settings.report_frequency]
label = "Fréquence des rapports"
description = "Fréquence de génération des rapports de prédiction"
[i18n.fr.settings.predictions_per_report]
label = "Prédictions par rapport"
description = "Nombre de prédictions à inclure par rapport"
[i18n.fr.settings.track_accuracy]
label = "Suivi de la précision"
description = "Évaluer les prédictions passées lorsque leur horizon temporel expire"
[i18n.fr.settings.confidence_threshold]
label = "Seuil de confiance"
description = "Confiance minimale pour inclure une prédiction"
[i18n.fr.settings.contrarian_mode]
label = "Mode contraire"
description = "Rechercher et présenter activement des prédictions contraires au consensus"
# ─── German (Deutsch) ────────────────────────────────────────────────────
[i18n.de]
name = "Vorhersage-Hand"
description = "Autonomer Vorhersage-Agent — Signalerfassung, Aufbau von Argumentationsketten, kalibrierte Vorhersagen und Genauigkeitsverfolgung"
category = "Daten"
[i18n.de.settings.prediction_domain]
label = "Vorhersagedomäne"
description = "Hauptdomäne für Vorhersagen"
[i18n.de.settings.time_horizon]
label = "Zeithorizont"
description = "Wie weit in die Zukunft vorhergesagt werden soll"
[i18n.de.settings.data_sources]
label = "Datenquellen"
description = "Welche Quellentypen auf Signale überwacht werden"
[i18n.de.settings.report_frequency]
label = "Berichtshäufigkeit"
description = "Wie oft Vorhersageberichte generiert werden"
[i18n.de.settings.predictions_per_report]
label = "Vorhersagen pro Bericht"
description = "Anzahl der Vorhersagen pro Bericht"
[i18n.de.settings.track_accuracy]
label = "Genauigkeitsverfolgung"
description = "Vergangene Vorhersagen bewerten, wenn ihr Zeithorizont abläuft"
[i18n.de.settings.confidence_threshold]
label = "Konfidenzschwelle"
description = "Mindestvertrauen für die Aufnahme einer Vorhersage"
[i18n.de.settings.contrarian_mode]
label = "Konträrer Modus"
description = "Aktiv nach Vorhersagen suchen und präsentieren, die dem Konsens widersprechen"
# ─── Korean (한국어) ────────────────────────────────────────────────────
[i18n.ko]
name = "예측 Hand"
description = "자율 미래 예측 에이전트 — 신호 수집, 추론 체인 구축, 보정된 예측 수행 및 정확도 추적"
category = "데이터"
[i18n.ko.settings.prediction_domain]
label = "예측 분야"
description = "예측의 주요 관심 분야"
[i18n.ko.settings.time_horizon]
label = "시간 범위"
description = "예측의 미래 전망 기간"
[i18n.ko.settings.data_sources]
label = "데이터 소스"
description = "신호를 모니터링할 소스 유형"
[i18n.ko.settings.report_frequency]
label = "보고서 빈도"
description = "예측 보고서 생성 주기"
[i18n.ko.settings.predictions_per_report]
label = "보고서당 예측 수"
description = "각 보고서에 포함할 예측 항목 수"
[i18n.ko.settings.track_accuracy]
label = "정확도 추적"
description = "예측 기간 만료 후 과거 예측에 대한 점수 평가"
[i18n.ko.settings.confidence_threshold]
label = "신뢰도 임계값"
description = "예측 보고서에 포함하기 위한 최소 신뢰도"
[i18n.ko.settings.contrarian_mode]
label = "역발상 모드"
description = "주류 컨센서스에 반하는 예측을 적극적으로 탐색하고 제시"