How kkmmtt0919/growth-loop-agent works
Growth Loop is a personal-improvement agent that turns user logs and goals into planned actions, scheduled execution, and reflection. Its primary loop runs from goal creation and AI action decomposition through availability-aware preview, schedule acceptance, execution check-ins, and evening/weekly review; reflections inform later planning. The graph preserves documented quiz, trace, records, and dashboard capabilities. Most API/service wiring is documented or indexed rather than excerpted, so uncertain implementation links are omitted; README statements support the broader workflow.
Main entry points: api API routes · service Service layer · repo Repository layer · page.tsx Web experience
Components 26
User experience
- Web experience
app/page.tsx - Chat panel
app/chat-panel.tsx - Records view
app/records/page.tsx - Growth view
app/weekly/page.tsx
Goals and planning
- Goal management
lib/service/goals.ts - Action decomposition
lib/service/action-decompose.ts - Smart Planner
lib/service/planner.ts - Availability
lib/service/availability.ts - Schedule timeline
lib/service/timeline.ts - Execution check-in
lib/service/execution.ts
Agent and review
- Conversation agent
lib/service/chat.ts - Agent rules
lib/agent/core/pure.ts - Learning records
lib/service/records.ts - Understanding quiz
lib/agent/quiz.ts - Evening review
lib/service/evening.ts - Weekly report
lib/service/weekly.ts - Reflection feedback
lib/service/reflection.ts - Agent run trace
lib/service/agent-runs.ts
Application platform
- API routes
app/api - JWT authentication
lib/auth/middleware.ts - Service layer
lib/service - Repository layer
lib/repo - PostgreSQL
Other components
- User
- Compatible LLM
- Cron caller
Connections 36
- User → Web experience: uses
README.md - Web experience → Chat panel: opens
app/page.tsx - Web experience → API routes: requests
- Chat panel → API routes: sends chat
- Records view → API routes: loads records
- Growth view → API routes: loads growth
- API routes → JWT authentication: authenticates
README.md - API routes → Service layer: dispatches
README.md - Service layer → Repository layer: queries
README.md - Repository layer → PostgreSQL: reads/writes
README.md - API routes → Goal management: routes goals
app/api/goals/route.ts - API routes → Action decomposition: routes actions
app/api/actions/route.ts - Goal management → Action decomposition: requests breakdown
lib/service/goals.ts - API routes → Availability: routes availability
app/api/availability/route.ts - API routes → Smart Planner: routes planning
- API routes → Schedule timeline: routes schedules
app/api/schedules/route.ts - API routes → Execution check-in: routes check-ins
- API routes → Conversation agent: routes chat
app/api/chat/route.ts - Conversation agent → Agent rules: uses rules
- API routes → Learning records: routes records
- API routes → Understanding quiz: routes quiz
app/api/quiz/route.ts - API routes → Evening review: routes reviews
app/api/evening-report/route.ts - Cron caller → API routes: triggers report
README.md - API routes → Weekly report: routes weekly
- API routes → Reflection feedback: routes feedback
app/api/reflections/route.ts - Reflection feedback → Smart Planner: informs planning
README.md - API routes → Agent run trace: routes traces
- Conversation agent → Compatible LLM: calls optionally
- Smart Planner → Compatible LLM: generates optionally
README.md - Evening review → Compatible LLM: generates optionally
README.md - Understanding quiz → Compatible LLM: grades optionally
README.md - API routes → Learning records: agent writes records
app/api/agent/route.ts - API routes → Understanding quiz: stores sessions
app/api/quiz/route.ts - API routes → Service layer: tasks route
app/api/tasks/route.ts - Service layer → Repository layer: task queries
lib/service/tasks.ts - Repository layer → PostgreSQL: task SQL
lib/repo/tasks.ts