- Eliminate N+1 lazy queries in activity, documents, and workflows endpoints using joinedload/selectinload
- Aggregate dashboard KPI counts into a single SQL query to reduce remote DB roundtrips
- Increase DB pool size to 10 with max_overflow of 20 to prevent connection starvation
- Add in-flight GET request deduplication in frontend API client
- Remove blocking /auth/me call on login to enable instant navigation
- Cache workspace data in localStorage to eliminate sequential loading waterfalls
- Implement session caching and skeleton shimmer states in Dashboard UI
Backend:
- Token tracking wired into knowledge extraction node
(reads langchain response_metadata for prompt/completion tokens)
- Stage timing added to extract, chunk, embed, reconcile nodes
- Each stage start/end recorded via RunTracker
Frontend:
- New api/metrics.js module
- Document Workspace shows 'Run cost and timing' card after workflow
completes or pauses for review
- Summary row: total time, tokens used, LLM calls
- Per-stage breakdown with proportional bar chart + time + token count
- Stages shown: extraction, chunking, embedding, knowledge_extraction,
reconciliation
The reviewer can now see exactly where time was spent and how many
tokens each run consumed — stage by stage.
feat: complete end-to-end platform with all standout behaviors