# ============================================================================= # FINORA BACKEND — Environment Variables Template # Copy this file to .env and fill in your values: cp .env.example .env # Production: set all these in HuggingFace Secrets instead of this file # ============================================================================= # ── LLM: Groq ──────────────────────────────────────────────────────────────── # https://console.groq.com → Create API Key GROQ_API_KEY=your_groq_api_key_here GROQ_MODEL_PRIMARY=llama-3.3-70b-versatile GROQ_MODEL_FAST=llama-3.1-8b-instant GROQ_MAX_TOKENS=2048 GROQ_TEMPERATURE=0.1 # ── Observability: LangSmith ────────────────────────────────────────────────── # https://smith.langchain.com → Settings → API Keys LANGCHAIN_API_KEY=your_langsmith_api_key_here LANGCHAIN_PROJECT=finora-prod LANGCHAIN_TRACING_V2=true LANGCHAIN_ENDPOINT=https://api.smith.langchain.com # ── Vector Store: Qdrant Cloud ──────────────────────────────────────────────── # https://cloud.qdrant.io → Create free cluster → copy URL and API key QDRANT_URL=https://your-cluster-id.us-east-1-1.aws.cloud.qdrant.io QDRANT_API_KEY=your_qdrant_api_key_here QDRANT_COLLECTION_NEWS=finora_news QDRANT_COLLECTION_HISTORICAL=finora_historical QDRANT_COLLECTION_FILINGS=finora_filings # ── Reranker: Cohere ────────────────────────────────────────────────────────── # https://dashboard.cohere.com → API Keys (free tier available) # Falls back to local BAAI/bge-reranker-base if Cohere fails or rate-limits COHERE_API_KEY=your_cohere_api_key_here RERANKER_PROVIDER=cohere # ── Market Data ─────────────────────────────────────────────────────────────── # Polygon.io: https://polygon.io/dashboard (free: 5 calls/min) POLYGON_API_KEY=your_polygon_api_key_here # NewsAPI: https://newsapi.org/register (free: 100 req/day) NEWSAPI_KEY=your_newsapi_key_here # ── Embeddings: HuggingFace (local, no API key needed) ─────────────────────── EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2 RERANKER_MODEL=BAAI/bge-reranker-base HF_HOME=./data/hf_cache # ── SEC EDGAR (no key — fair use requires a user agent) ────────────────────── SEC_EDGAR_USER_AGENT=YourName contact@youremail.com # ── RAG Configuration ───────────────────────────────────────────────────────── RAG_TOP_K=8 RAG_OVER_RETRIEVE_FACTOR=2 RAG_HYDE_ENABLED=true RAG_RERANKER_ENABLED=true RAG_HYBRID_ALPHA=0.6 RAG_MMR_LAMBDA=0.6 RAG_DEDUP_THRESHOLD=0.92 # ── Guardrails ──────────────────────────────────────────────────────────────── GUARDRAILS_ENABLED=true GUARDRAILS_MODE=strict DISCLAIMER_LOCALE=IN GUARDRAILS_LOG_BLOCKED=true # ── Application ─────────────────────────────────────────────────────────────── BACKEND_PORT=7860 BACKEND_HOST=0.0.0.0 ENV=development LOG_LEVEL=INFO CORS_ORIGINS=http://localhost:3000,https://your-app.vercel.app SCHEDULER_ENABLED=false # ── Rate Limiting ───────────────────────────────────────────────────────────── RATE_LIMIT_PER_MINUTE=20 RATE_LIMIT_PER_HOUR=200 MAX_QUERY_LENGTH=500 MAX_CONVERSATION_TURNS=50 # ── Ingestion Scheduler ─────────────────────────────────────────────────────── NEWS_INGEST_INTERVAL_MINUTES=15 HISTORICAL_UPDATE_INTERVAL_HOURS=24