Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
113 changes: 113 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
ALPHA_VANTAGE_API_KEY=
FMP_API_KEY=
SEC_USER_AGENT=FinGPTLocalResearch/1.0 contact@example.com
QDRANT_URL=http://localhost:6333
QDRANT_API_KEY=
COLLECTION_NAME=market_docs
OLLAMA_BASE_URL=http://localhost:11434
PRIMARY_MODEL=qwen2.5:7b
GEMMA4_MODEL=gemma4:e4b
ENABLE_EXPERIMENTAL_FALLBACK=false
EXPERIMENTAL_FALLBACK_MODEL=gemma4:e4b
HF_TOKEN=
HF_MODEL_REVISION=main

# Localization (ko: Korean, en: English)
OUTPUT_LANGUAGE=ko

# --- Macro bundle (bonds / FX / commodities / crypto) ---
# Register a free key at https://fred.stlouisfed.org/docs/api/api_key.html
# Leave empty to disable the FRED half of the macro bundle; the pipeline
# will still collect yfinance price snapshots + Google News headlines.
FRED_API_KEY=
MACRO_PRICE_LOOKBACK_DAYS=90
MACRO_NEWS_QUERY_LANGUAGE=en

# --- Structured data mart ---
# Separate from data/runs.db, which remains the research-run history index.
DATA_MART_BACKEND=sqlite
DATA_MART_DB_PATH=data/research_mart.db
DATA_MART_DUCKDB_PATH=data/research_mart.duckdb
TELEGRAM_BOT_TOKEN=
TELEGRAM_CHAT_ID=

# --- Data provider policy ---
# Default stack: direct Yahoo/yfinance + FRED + SEC + Google News RSS.
# OpenBB is installed and checked, but news runtime is opt-in because provider
# compatibility can vary by version. FMP is auxiliary and disabled by default.
DATA_PROVIDER_PRIORITY=yfinance,sec,google,openbb,alpha_vantage,fmp
ALPHA_VANTAGE_ENABLED=false
OPENBB_ENABLED=true
OPENBB_NEWS_ENABLED=false
# --- Optional OpenBB Workspace custom agent adapter ---
# Keep disabled unless you want OpenBB Workspace to discover FinGPT via
# /agents.json and stream queries to /query.
OPENBB_AGENT_ENABLED=false
OPENBB_AGENT_ID=fingpt-local-research
OPENBB_AGENT_NAME=FinGPT Local Research
OPENBB_AGENT_PUBLIC_URL=http://127.0.0.1:8000
OPENBB_AGENT_ALLOW_ORIGINS=https://pro.openbb.co,http://localhost:1420,http://127.0.0.1:1420
FMP_ENABLED=false
TRANSCRIPT_PROVIDER=fmp_optional

# --- Retrieval strategy ---
# multi_query: fan the user question into raw + risk-focused + catalyst-focused
# sub-queries and fuse results with RRF (default, deeper recall).
# single: legacy single-query semantic search.
RETRIEVAL_STRATEGY=multi_query

# --- Cross-encoder reranker ---
# Disable to revert to pure RRF ordering. The default model is intended to run
# locally on CPU when a compatible FastEmbed/sentence-transformers runtime is
# available; failures are logged and the original order is preserved.
RERANKER_ENABLED=true
RERANKER_MODEL=Xenova/ms-marco-MiniLM-L-6-v2
RERANKER_CANDIDATE_POOL=30

# --- Fundamentals card ---
# Single-name equities only. Timeouts/failures skip the card and keep the
# normal RAG path running.
FUNDAMENTALS_CARD_ENABLED=true
FUNDAMENTALS_CARD_TIMEOUT_S=5

# --- Chunked ingest ---
# Requires re-creating the Qdrant collection when switching from legacy
# document-level vectors. See scripts/migrate_collection.ps1.
INGEST_CHUNKING_ENABLED=true
INGEST_CHUNK_TOKENS=512
INGEST_CHUNK_OVERLAP=64
MAX_CHUNKS_PER_PARENT=1

# --- Hybrid search (dense + sparse BM25) ---
# Requires re-creating the Qdrant collection so sparse vectors are indexed.
HYBRID_SEARCH_ENABLED=true
SPARSE_MODEL=Qdrant/bm25

# --- Topic mode / universal routing ---
TOPIC_MODE_ENABLED=true
ROUTER_MODEL=qwen2.5:7b
TOPIC_RETRIEVAL_TOP_K=12
TOPIC_MAX_RELATED_TICKERS=8

# --- Optional scenario simulation layer ---
# Disabled by default. When enabled, outputs are advisory scenario analysis
# only, not price prediction, and are stored under execution_meta.extras.
SCENARIO_SIMULATION_ENABLED=false
SCENARIO_SIMULATION_MAX_PERSONAS=6
SCENARIO_SIMULATION_MIN_PERSONAS=5
SCENARIO_SIMULATION_DEBATE_ROUNDS=1
SCENARIO_SIMULATION_MAX_SCENARIOS=4
SCENARIO_SIMULATION_LLM_ENABLED=true
SCENARIO_SIMULATION_STRICT_EVIDENCE=true
SCENARIO_SIMULATION_FAIL_OPEN=true

# --- Embedding model ---
# Keep the default BAAI/bge-small-en-v1.5 (384-dim) to stay compatible with
# existing market_docs collections. To opt into the larger bge-base model
# (768-dim, better semantic recall), set BOTH variables below and then drop
# and re-create the Qdrant collection (ingestion will auto-size on the next
# run):
# EMBEDDING_MODEL=BAAI/bge-base-en-v1.5
# EMBEDDING_VECTOR_SIZE=768
EMBEDDING_MODEL=BAAI/bge-small-en-v1.5
EMBEDDING_VECTOR_SIZE=384
29 changes: 29 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,12 @@ celerybeat.pid

# Environments
.env
.env.*
!.env.example
.venv
env/
venv/
venv311/
ENV/
env.bak/
venv.bak/
Expand Down Expand Up @@ -139,3 +142,29 @@ FinGPT_Training_LoRA_with_Chatglm2_6b_for_beginners.ipynb

# Benchmark data
fingpt/FinGPT_Benchmark/data/*/**

# FinGPT local runtime artifacts
data/outputs/
data/raw/
data/runs.db
data/research_mart.db*
data/research_mart.duckdb*
data/quant_lab/backtests/
data/quant_lab/strategies/
data/watchlist.json
data/ai_portfolio/
data/ai_portfolio_smoke/
data/ai_portfolio_browser_smoke/
data/forecast_lab/experiments/
data/forecast_lab/data_snapshots/
data/forecast_lab/macro_regime/
data/forecast_lab/model_artifacts/
data/forecast_lab/model_registry.json
data/forecast_lab/model_registry.sqlite3*
data/forecast_lab/jobs.sqlite3*
data/forecast_lab/.artifact_signing_key.json
reports/
test-results/
.playwright-cli/
.ruff_cache/
scratch/
Loading