Release 2.4.0
Overview
This release introduces a complete In-App Notification System, Stock Research Scheduling, KBS Stock Price Source Migration, Stock Financial Reports, and multiple runtime improvements including LangSmith monitoring and token-trimming middleware.
Key Highlights
1) In-App Notification System (PR #34)
- Introduced a full notification domain:
Notificationmodel, schemas, repository (notification_repo.py), and service (notification_service.py). - Added notification types registry (
notification_types.py) and dedicated exception classes. - New REST API endpoint
GET /api/v1/notificationsfor fetching the authenticated user's inbox (with pagination and read/unread filter). - Real-time delivery via Socket.IO — notifications are pushed to the user's room when triggered.
- Stock research service now emits in-app notifications automatically when a report completes or fails.
- Frontend integration guide:
doc/feature/notifications/frontend_integration_guide.md. - Full unit and integration test coverage for repo, service, and API.
2) Stock Research Runtime Metadata Tracking (PR #35)
- Extended
StockResearchReportmodel and schema with runtime metadata fields (provider, model, token usage, execution time, etc.). - Updated the stock research service to persist and expose runtime metadata on each report.
- Added
stock_research_runtime_metadata_frontend_guide.mdfor frontend consumers. - All related unit and integration tests updated.
3) Stock Research Scheduling System (PR #36)
- New scheduling domain:
StockResearchSchedule+ schedule-run models, schemas, and repositories. - Schedule calculation engine (
stock_research_schedule_calculator.py) supporting daily, weekly, and custom cron frequencies. - Dispatcher service (
stock_research_schedule_dispatcher_service.py) for enqueuing due scheduled jobs. - Redis-backed async worker (
stock_research_worker.py) that executes scheduled stock research runs. - New public API endpoints under
/api/v1/stock_research/schedules(create, list, get, update, delete). - Internal API route for triggering dispatching of due schedules.
- New env variable required:
STOCK_RESEARCH_QUEUE_NAME(see.env.example).
4) Research Agent Runtime Improvements (standalone commits, 2026-04-27)
- LangSmith Monitoring: Central LangSmith config and automatic tracing injected into the stock research worker.
- Token-Trimming Middleware: New truncate middleware that trims oversized context windows before LLM calls.
- Token & Message Trigger Tuning: Updated token count thresholds and message triggers for the research agent.
- Summary Research Update: Updated summary step to align with the latest search flow.
- Default Provider: Updated default LLM provider fallback logic.
- System Prompt Migration: Migrated research agent system prompt to the latest search-flow version.
5) KBS Stock Price Source Migration (PR #37)
- Migrated stock price data source from VCI to the KBS provider for improved data coverage.
StockCompanyEventItem.idnow acceptsstr | intto handle both KBS and VCI formats.- Reworked
price_gateway.pyandprice_service.pyfor KBS adapter with isolated caching logic. - Updated
StockPriceTimeseriesschema to accommodate new KBS field mappings. - Full test coverage updated: gateway, service, and integration tests.
6) Stock Financial Reports (PR #39)
- New
StockFinancialReportschema covering income statement, balance sheet, and cash flow report types. - KBS financial report gateway (
financial_report_gateway.py) to fetch quarterly/annual financials from KBS. - Caching service (
financial_report_cache.py) with TTL-based cache to reduce redundant API calls. - Orchestration service (
financial_report_service.py) for validation and data transformation. - New API routes added to the stocks router for income statement, balance sheet, and cash flow endpoints.
- Frontend integration guide:
doc/feature/stocks/stock_financial_report_frontend_guide.md. - Full unit and integration test coverage.
Included PRs
- #34
King/feat/notification - #35
King/chore/meta_research - #36
King/feat/scheduler_job - #37
King/feat/migrate_kbs - #39
King/feat/financial_report
Additional Standalone Commits (2026-04-27)
206fa6dbMigrate system prompt of research agent to search flow latest5872f685Summary research: DONE7575b3d5Update trim token and token trigger2b88ad4eDefault provider updateee97e00fImplement central LangSmith config and track into worker4b7f2821Add LangSmith monitoringa4134ac9Update estimated content of fetch_tool by token70d21882Implement truncate middleware38199856Update message trigger9254c506Update token trigger and trim tokens
Compatibility Notes
- No breaking changes to existing public APIs.
- New env variable required for scheduling:
STOCK_RESEARCH_QUEUE_NAME(see.env.example). - Frontend updates recommended to use: notification inbox API, scheduling endpoints, financial report endpoints, and runtime metadata on stock research reports.
- KBS migration is transparent for API consumers;
StockCompanyEventItem.idtype widened tostr | int.