How jeyprabu/leetcode-coach works
LeetCode Coach is a local, stateful CLI for guided problem practice. A user starts or resumes a session; the CLI loads a problem and invokes a LangGraph workflow that analyzes it, offers progressive hints, waits for an approach, evaluates it, and either loops for another hint, stops at the hint limit, or explains complexity. Graph state is checkpointed in SQLite, while analysis, hints, evaluation, and complexity feedback use a structured local Ollama model. Workflow links are supported by the graph definition; persistence and resume capabilities are also documented in the README.
Main entry points: evaluate.py Answer Evaluation · llm.py Ollama Client · main.py Session CLI · graph.py Workflow Graph
Components 15
CLI and Problems
- Session CLI
app/main.py - Problem Loader
app/problem_loader.py - Problem Repository
problems/problems.json
Coaching Workflow
- Workflow Graph
app/graph.py - Workflow State
app/state.py - Problem Analysis
app/nodes/analyze.py - Progressive Hints
app/nodes/hint.py - Answer Interrupt
app/nodes/user_input.py - Answer Evaluation
app/nodes/evaluate.py - Complexity Feedback
app/nodes/complexity.py - Hint Limit
app/nodes/max_hints.py
Local Model
- Ollama Client
app/llm.py - Ollama Runtime
Session Persistence
- SQLite Checkpoints
Other components
- Learner
Connections 19
- Learner → Session CLI: chooses session
app/main.py - Session CLI → Problem Loader: loads problem
app/main.py - Problem Loader → Problem Repository: reads JSON
app/problem_loader.py - Session CLI → Workflow Graph: invokes or resumes
app/main.py - Workflow Graph → Workflow State: uses schema
app/graph.py - Workflow Graph → Problem Analysis: starts workflow
app/graph.py - Problem Analysis → Progressive Hints: routes next
app/graph.py - Progressive Hints → Answer Interrupt: routes next
app/graph.py - Answer Interrupt → Answer Evaluation: routes next
app/graph.py - Answer Evaluation → Progressive Hints: routes if unsolved
app/graph.py - Answer Evaluation → Complexity Feedback: routes if solved
app/graph.py - Answer Evaluation → Hint Limit: routes at limit
app/graph.py - Problem Analysis → Ollama Client: requests analysis
app/nodes/analyze.py - Progressive Hints → Ollama Client: requests hint
app/nodes/hint.py - Answer Evaluation → Ollama Client: requests evaluation
app/nodes/evaluate.py - Complexity Feedback → Ollama Client: requests analysis
app/nodes/complexity.py - Ollama Client → Ollama Runtime: runs inference
app/llm.py - Workflow Graph → SQLite Checkpoints: checkpoints state
app/graph.py - Session CLI → Answer Interrupt: supplies response
app/main.py