{"id":28256920,"url":"https://github.com/sl-mar/chat-with-fundamentals","last_synced_at":"2026-07-02T20:03:19.039Z","repository":{"id":292191003,"uuid":"977510333","full_name":"SL-Mar/chat-with-fundamentals","owner":"SL-Mar","description":"AI-powered fundamental analysis platform. TimescaleDB, CrewAI agents, portfolio optimization, pair trading, and automated alpha extraction.","archived":false,"fork":false,"pushed_at":"2026-04-04T15:15:48.000Z","size":28389,"stargazers_count":18,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-04T18:21:28.334Z","etag":null,"topics":["alpha-extraction","crewai","eodhd","fastapi","fundamental-analysis","llm","nextjs","pair-trading","portfolio-optimization","quantitative-finance","smolagents","timescaledb"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SL-Mar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-04T11:27:38.000Z","updated_at":"2026-04-04T15:15:51.000Z","dependencies_parsed_at":"2025-05-08T16:29:17.034Z","dependency_job_id":"bbc88e77-7a88-4ec5-8c9c-0d7b65ddc8d5","html_url":"https://github.com/SL-Mar/chat-with-fundamentals","commit_stats":null,"previous_names":["sl-mar/quantcoderfs","sl-mar/chat-with-fundamentals"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/SL-Mar/chat-with-fundamentals","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SL-Mar%2Fchat-with-fundamentals","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SL-Mar%2Fchat-with-fundamentals/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SL-Mar%2Fchat-with-fundamentals/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SL-Mar%2Fchat-with-fundamentals/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SL-Mar","download_url":"https://codeload.github.com/SL-Mar/chat-with-fundamentals/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SL-Mar%2Fchat-with-fundamentals/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35060914,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-02T02:00:06.368Z","response_time":173,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alpha-extraction","crewai","eodhd","fastapi","fundamental-analysis","llm","nextjs","pair-trading","portfolio-optimization","quantitative-finance","smolagents","timescaledb"],"created_at":"2025-05-19T23:14:31.834Z","updated_at":"2026-07-02T20:03:19.031Z","avatar_url":"https://github.com/SL-Mar.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n# Chat with Fundamentals v2\n\n\u003e **This project is no longer actively developed.** Chat with Fundamentals has been superseded by a proprietary solution, that unifies factor analysis and insights monitoring on a curated list of tickers from Seeking Alpha Picks.                                               \n\u003e\n\u003e The previous version (v1) is preserved on the [`legacy/v1`](../../tree/legacy/v1) branch.\n\nUniverse-based factor analysis platform. Create scoped datasets (\"universes\") from ETF holdings or sector screens, ingest OHLCV + fundamentals via EODHD, and analyze data through a chat-driven code agent that writes and executes Python in a sandboxed environment.\n\n---\n\n## Architecture\n\n```\nFrontend (Next.js 14 + Tailwind)         Port 3006\n  Pages: Home | Create Universe | Workspace | Settings\n  Charts: lightweight-charts v5 (candlestick, line)\n                     │\n                     │ REST + WebSocket\n                     ▼\nBackend (FastAPI)                         Port 8001\n  4 routers: universes | chat | settings | health\n  LLM: qwen2.5-coder:14b (Ollama) + Claude (Anthropic fallback)\n  Sandbox: Docker container for code execution\n                     │\n                     ▼\nData Layer\n  TimescaleDB 15 (port 5435) — one DB per universe + registry\n  Redis 7 (port 6381) — caching\n```\n\n## Key Features\n\n- **Universe creation** from ETF holdings (SPY, QQQ, XLK, ...) or EODHD sector screens\n- **Multi-granularity OHLCV** ingestion (daily, 1h, 5m) with TimescaleDB hypertables\n- **Fundamentals ingestion** — 50+ fields per ticker (valuation, profitability, balance sheet, cash flow)\n- **Code agent chat** — ask questions in natural language, LLM generates Python, executes in Docker sandbox\n- **Three agent types**: fundamentals query, factor library (Piotroski F-Score, momentum, value), ML training\n- **Output formatting** — LLM-formatted markdown tables with color-coded cells, raw output toggle\n- **Collapsible syntax-highlighted code blocks** in chat\n- **Zustand state management** — 4 stores (universe, chat, workspace, settings)\n\n## Universe Sources\n\n| Source | Method | Example |\n|--------|--------|---------|\n| ETF Holdings | EODHD `ETF_Data::Holdings` | SPY → 50 tickers (NVDA, AAPL, MSFT, ...) |\n| Sector Screen | EODHD Screener API | Healthcare → up to 1000 tickers |\n\n## Quick Start\n\n```bash\n# 1. Infrastructure\ndocker compose up -d   # TimescaleDB + Redis\n\n# 2. Backend\ncd backend\npython -m venv venv \u0026\u0026 source venv/bin/activate\npip install -r requirements.txt\ncp .env.example .env   # Set EODHD_API_KEY, ANTHROPIC_API_KEY\nuvicorn main:app --port 8001 --reload\n\n# 3. Sandbox image (for code execution)\ncd backend/sandbox \u0026\u0026 docker build -t cwf-sandbox .\n\n# 4. Frontend\ncd frontend\nnpm install\nnpx next dev -p 3006\n```\n\nOr use the launch script:\n```bash\n./launch.sh start   # starts everything\n./launch.sh status  # check health\n./launch.sh stop    # tear down\n```\n\n## Tech Stack\n\n| Layer | Technology |\n|-------|-----------|\n| Frontend | Next.js 14, Tailwind CSS, Zustand, lightweight-charts v5, prism-react-renderer |\n| Backend | FastAPI, SQLAlchemy 2.0 (async), Pydantic v2 |\n| Database | TimescaleDB 15 (PostgreSQL), Redis 7 |\n| LLM | Ollama (qwen2.5-coder:14b) + Anthropic Claude (fallback) |\n| Sandbox | Docker (Python 3.12 + pandas/numpy/scikit-learn/matplotlib) |\n| Data | EODHD API (screener, OHLCV, fundamentals, ETF holdings) |\n\n## Project Structure\n\n```\nbackend/\n  main.py                    # FastAPI app (4 routers)\n  agents/                    # LLM pipeline, prompts, validation, retry\n  database/                  # Universe registry + per-universe DB manager\n  ingestion/                 # EODHD data populator (sector + ETF)\n  routers/                   # universes, chat, settings, health\n  sandbox/                   # Docker-based code execution\n  services/                  # Universe + chat agent services\n\nfrontend/\n  pages/                     # index, universe/new, universe/[id], settings\n  components/                # charts, workspace tabs, universe cards\n  stores/                    # Zustand (universe, chat, workspace, settings)\n  types/                     # TypeScript interfaces\n```\n\n## API Endpoints\n\n| Method | Path | Description |\n|--------|------|-------------|\n| POST | `/api/universes` | Create universe (ETF or sector) |\n| GET | `/api/universes` | List all universes |\n| GET | `/api/universes/{id}` | Universe detail + tickers |\n| DELETE | `/api/universes/{id}` | Delete universe + drop DB |\n| POST | `/api/universes/{id}/refresh` | Re-ingest data |\n| GET | `/api/universes/{id}/progress` | Ingestion progress |\n| GET | `/api/universes/{id}/data/ohlcv` | Query OHLCV |\n| GET | `/api/universes/{id}/data/fundamentals` | Query fundamentals |\n| POST | `/api/universes/{id}/chat` | Code agent chat |\n| GET | `/api/health` | System health |\n\n## License\n\nApache 2.0 — see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsl-mar%2Fchat-with-fundamentals","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsl-mar%2Fchat-with-fundamentals","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsl-mar%2Fchat-with-fundamentals/lists"}