No description
  • Python 97.7%
  • Shell 1.5%
  • Just 0.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Gurbakhshish Singh 8f7a11cda0
All checks were successful
Packages / Quality gates (push) Successful in 40s
Packages / Build packages (push) Successful in 7s
Packages / Publish packages (push) Successful in 5s
updated version
2026-06-16 20:47:04 -04:00
.forgejo Switch CI runner from default-nas to docker 2026-05-26 14:57:15 -04:00
apps Add Massive.com REST provider for snapshots, fundamentals, movers, and news 2026-06-16 20:42:27 -04:00
packages Add Massive.com REST provider for snapshots, fundamentals, movers, and news 2026-06-16 20:42:27 -04:00
plans docs(plan): add Massive.com REST API provider implementation plan 2026-06-16 16:10:56 -04:00
scripts Publish packages on version changes 2026-05-19 17:45:55 -04:00
tests chore: create uv workspace foundation 2026-04-03 21:36:33 -04:00
.gitignore python version upgrade 2026-04-21 15:46:16 -04:00
.pre-commit-config.yaml chore: create uv workspace foundation 2026-04-03 21:36:33 -04:00
.python-version python version upgrade 2026-04-21 15:46:16 -04:00
AGENTS.md Add Massive.com REST provider for snapshots, fundamentals, movers, and news 2026-06-16 20:42:27 -04:00
conftest.py chore: create uv workspace foundation 2026-04-03 21:36:33 -04:00
justfile Simplify justfile by removing redundant recipes 2026-05-26 15:19:27 -04:00
main.py chore: create uv workspace foundation 2026-04-03 21:36:33 -04:00
pyproject.toml updated version 2026-06-16 20:47:04 -04:00
README.md Add project README 2026-05-18 15:40:47 -04:00
smart-invest.yaml.example Add Massive.com REST provider for snapshots, fundamentals, movers, and news 2026-06-16 20:42:27 -04:00

Smart Invest

Smart Invest is an educational stock research and portfolio insight platform powered by provider-backed market data, normalized domain models, and LangChain Deep Agents orchestration.

It is built for research and decision support only. It does not place trades, transmit brokerage instructions, or provide fiduciary financial advice.

What it does

  • Research one or more tickers with market snapshots, fundamentals, news, sentiment, citations, and risk context.
  • Review local portfolio files (.json or .csv) and generate educational portfolio reports.
  • Scan top losers for educational opportunity candidates.
  • Expose the same core workflows through a CLI and a FastAPI service.
  • Preserve provenance, freshness, and source errors instead of fabricating unavailable market data.

Workspace layout

packages/core     Canonical models, settings, policies, recommendations, and analytics
packages/tools    Provider adapters, normalization, storage, portfolio ingestion, and tool functions
packages/agents   Deep Agents orchestration, reporting, subagents, and tool registry
apps/cli          `smart-invest` command-line interface
apps/api          FastAPI application and HTTP routes
apps/mcp          MCP app package scaffold

Requirements

  • Python 3.14+
  • uv
  • Optional: just for workspace task shortcuts

Setup

Install all workspace packages and development dependencies:

uv sync --all-packages --dev

Or use the task runner:

just bootstrap

Configuration

Start from the example config and replace placeholder values with your own keys:

cp smart-invest.yaml.example smart-invest.yaml

The config loader checks, in order:

  1. --config <path>
  2. SMART_INVEST_CONFIG
  3. smart-invest.yaml
  4. .smart-invest.yaml
  5. ~/.config/smart-invest/config.yaml

You can select a profile with --profile or SMART_INVEST_PROFILE.

Required settings include OpenRouter and Alpha Vantage credentials. Optional integrations include NewsAPI, Alpha Vantage news, Langfuse tracing, cache settings, and Postgres-backed storage.

CLI usage

Show CLI help:

uv run smart-invest --help
# or
just cli --help

Research tickers:

uv run smart-invest research NVDA
uv run smart-invest r NVDA MSFT --output json
uv run smart-invest research AAPL --focus "Check valuation and catalysts"

Review a portfolio file:

uv run smart-invest review-portfolio portfolio.json
uv run smart-invest rp holdings.csv --output json
uv run smart-invest review-portfolio portfolio.json --focus "Check concentration risk"

Scan for educational opportunity candidates:

uv run smart-invest find-opportunities --limit 5
uv run smart-invest opps --limit 10 --output json

Use a specific config or profile:

uv run smart-invest --config smart-invest.yaml --profile local research TSLA
uv run smart-invest --set-env SMART_INVEST_OPENROUTER__MODEL=openai/gpt-5.4 research META

API usage

Start the API in development mode:

just api
# equivalent:
uv run --package smart-invest-api uvicorn smart_invest_api.app:app --reload --host 0.0.0.0 --port 8000

Available routes include:

  • GET /health
  • POST /research/ticker
  • POST /portfolio/review
  • POST /portfolio/saved/review
  • POST /portfolio/recommendations

Example ticker research request:

curl -X POST http://localhost:8000/research/ticker \
  -H 'content-type: application/json' \
  -d '{"ticker":"NVDA","include_news":true,"include_fundamentals":true}'

Example uploaded portfolio review:

curl -X POST http://localhost:8000/portfolio/review \
  -F file=@portfolio.json \
  -F 'focus=Check concentration risk'

Common development commands

just sync          # install workspace packages and dev dependencies
just lint-check    # run ruff without modifying files
just fmt-check     # check formatting
just typecheck     # run basedpyright
just test          # run pytest
just check         # lint, format check, and typecheck
just ci            # sync, quality checks, and tests

Targeted tests:

just test-path packages/core
just test-k smoke

Package builds and publishing:

just build-packages
just publish-packages <uv-index>

Safety and product boundaries

Smart Invest is educational and non-advisory. User-facing recommendations must include citations, provenance, risk context, and disclaimer coverage. The system must never auto-trade, generate brokerage-ready instructions, or hide missing citations, stale data, provider failures, or low-confidence outputs.