Qdecision is intentionally small in surface area but opinionated in flow. The project is optimized around one thing: turning a vague Chinese decision problem into a compact judgment experience.
- The user enters a raw decision question on
/ - The app creates a
DecisionSession - The server runs:
classifygenerateQuestions
- The user answers 2 to 4 clarifying questions on
/analyze - The server generates:
quickfor the first judgmentfullfor the final narrative and future paths
- The result page merges both into a single presentation flow
src/app/Next.js App Router pages and API routessrc/components/home/Home input and onboarding experiencesrc/components/chat/Analyze flow and question UIsrc/components/result/Result narrative, action, boundary, and future path visualization
src/lib/decision/Intake validation, decision pipeline, normalization, fallback logic, report generation, and repository accesssrc/lib/llm/Provider routing, prompt construction, structured parsing, repair, and telemetry
prisma/schema.prismaDecisionSessionandFeedbackprisma/dev.dbDefault local SQLite database
The default setup assumes Ollama and SQLite. This keeps the project easy to run, demo, and modify on a single machine.
LLM outputs are validated by Zod before entering the rest of the system. If parsing fails, the app tries to repair the JSON once before falling back.
The app does not wait for the full report before becoming useful. It first generates a quick tilt, then enriches it with the full report and future path tree.
Sessions are scoped by the qdecision_viewer_id cookie so local history remains isolated without forcing authentication.