crack-jee 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bkt.py +45 -0
- crack_jee-0.1.0.dist-info/METADATA +182 -0
- crack_jee-0.1.0.dist-info/RECORD +26 -0
- crack_jee-0.1.0.dist-info/WHEEL +5 -0
- crack_jee-0.1.0.dist-info/entry_points.txt +2 -0
- crack_jee-0.1.0.dist-info/licenses/LICENSE +21 -0
- crack_jee-0.1.0.dist-info/top_level.txt +4 -0
- db.py +756 -0
- server.py +106 -0
- tools/__init__.py +2 -0
- tools/end_study_session.py +17 -0
- tools/generate_daily_plan.py +18 -0
- tools/generate_exam_plan.py +19 -0
- tools/get_concept_state.py +17 -0
- tools/get_exam.py +17 -0
- tools/get_exam_progress.py +17 -0
- tools/get_progress.py +16 -0
- tools/get_recurring_mistakes.py +18 -0
- tools/get_revision_due.py +20 -0
- tools/get_student_profile.py +19 -0
- tools/get_time_patterns.py +16 -0
- tools/get_weak_topics.py +18 -0
- tools/list_concepts.py +18 -0
- tools/list_exams.py +16 -0
- tools/log_performance_input.py +66 -0
- tools/set_exam.py +19 -0
bkt.py
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"""Bayesian Knowledge Tracing: pure functions, no DB dependency.
|
|
2
|
+
|
|
3
|
+
Fixed literature-default parameters, per ex1.md §7.2 — not fitted on her
|
|
4
|
+
data (not enough volume to fit reliably). Same defaults used by the
|
|
5
|
+
synthetic-KT research track's BKTParameters for consistency across the repo.
|
|
6
|
+
"""
|
|
7
|
+
from typing import Literal
|
|
8
|
+
|
|
9
|
+
P_L0 = 0.20 # initial mastery prior
|
|
10
|
+
P_T = 0.10 # learning/transition rate
|
|
11
|
+
P_S = 0.10 # slip rate
|
|
12
|
+
P_G = 0.25 # guess rate
|
|
13
|
+
|
|
14
|
+
Result = Literal["correct", "wrong", "unattempted"]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def update_mastery(prior: float, result: Result) -> float:
|
|
18
|
+
"""Closed-form Bayesian update + transition. `unattempted` carries no
|
|
19
|
+
evidence about knowledge (she didn't try), so mastery passes through
|
|
20
|
+
unchanged — only correct/wrong update the posterior."""
|
|
21
|
+
if result == "unattempted":
|
|
22
|
+
return prior
|
|
23
|
+
|
|
24
|
+
if result == "correct":
|
|
25
|
+
numerator = prior * (1.0 - P_S)
|
|
26
|
+
denominator = numerator + (1.0 - prior) * P_G
|
|
27
|
+
else:
|
|
28
|
+
numerator = prior * P_S
|
|
29
|
+
denominator = numerator + (1.0 - prior) * (1.0 - P_G)
|
|
30
|
+
|
|
31
|
+
posterior = numerator / denominator if denominator > 0 else prior
|
|
32
|
+
return posterior + (1.0 - posterior) * P_T
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def apply_decay(mastery: float, days_since_last_attempt: float) -> float:
|
|
36
|
+
"""Simple time-decay nudge (ex1.md §7.3) — not a fitted forgetting
|
|
37
|
+
curve. 14-day grace period, then ×0.97 per additional full week idle,
|
|
38
|
+
floored at 0.3 so it never implies "never learned." Read-time only,
|
|
39
|
+
never written back."""
|
|
40
|
+
grace_days = 14
|
|
41
|
+
floor = 0.3
|
|
42
|
+
if days_since_last_attempt <= grace_days:
|
|
43
|
+
return mastery
|
|
44
|
+
idle_weeks = (days_since_last_attempt - grace_days) / 7.0
|
|
45
|
+
return floor + (mastery - floor) * (0.97**idle_weeks)
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: crack-jee
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A personal, local MCP server that acts as a performance coach for a JEE aspirant
|
|
5
|
+
Author-email: Sai Rithvik Mahankali <rikkumahan07@gmail.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: fastmcp>=2.0.0
|
|
11
|
+
Dynamic: license-file
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
<img src="assets/banner.png" alt="CRACK-JEE — Plan smarter, Prepare better" width="100%">
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
<p align="center">
|
|
18
|
+
<img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-red">
|
|
19
|
+
<img alt="Python 3.10+" src="https://img.shields.io/badge/python-3.10%2B-red">
|
|
20
|
+
<img alt="Protocol: MCP" src="https://img.shields.io/badge/protocol-MCP-black">
|
|
21
|
+
<img alt="Local-first" src="https://img.shields.io/badge/data-local--only-black">
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
<p align="center">
|
|
25
|
+
A personal AI coach for JEE aspirants, built as an MCP server. Not a tutor,
|
|
26
|
+
not a chatbot with a syllabus bolted on — it turns raw test results into a
|
|
27
|
+
closed feedback loop: log what happened, find the patterns a single test
|
|
28
|
+
report can never show, get a concrete next study plan, and verify whether
|
|
29
|
+
it actually worked on the next test.
|
|
30
|
+
</p>
|
|
31
|
+
|
|
32
|
+
<p align="center">
|
|
33
|
+
Free. Local. No subscription, no hosting bill, no data leaving your machine
|
|
34
|
+
except to whatever LLM chat client you connect it to.
|
|
35
|
+
</p>
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Why
|
|
40
|
+
|
|
41
|
+
Coaching institute reports are siloed — each test is graded in isolation. Two
|
|
42
|
+
things never happen on their own:
|
|
43
|
+
|
|
44
|
+
1. **Cross-test pattern mining.** The same mistake, on the same concept,
|
|
45
|
+
across five different tests over two months, looks like five unrelated
|
|
46
|
+
bad days unless something is tracking it. CRACK-JEE finds it.
|
|
47
|
+
2. **Closed-loop verification.** A coach tells you to fix something. Nobody
|
|
48
|
+
goes back after the next test and checks whether it worked. CRACK-JEE
|
|
49
|
+
does, automatically, every time.
|
|
50
|
+
|
|
51
|
+
Everything in between — mastery estimation, what's about to be forgotten,
|
|
52
|
+
where you're burning time versus actually stuck, skip-vs-wrong strategy
|
|
53
|
+
under negative marking — is plain deterministic code, not a trained model.
|
|
54
|
+
An LLM only extracts messy input into structured data and writes the study
|
|
55
|
+
plan in your coach's voice; every number it reasons over comes from
|
|
56
|
+
arithmetic and SQL, not inference.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## How it works
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
you describe a test → LLM extracts structured data → local SQLite log
|
|
64
|
+
│
|
|
65
|
+
▼
|
|
66
|
+
deterministic analytics engine
|
|
67
|
+
(mastery, weak spots, revision timing,
|
|
68
|
+
time-on-task, skip/negative-marking)
|
|
69
|
+
│
|
|
70
|
+
▼
|
|
71
|
+
LLM reasons over it, writes a real plan
|
|
72
|
+
│
|
|
73
|
+
▼
|
|
74
|
+
next test's results close the loop
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Connect it to any MCP-capable chat client (Claude Desktop, Qwen Desktop,
|
|
78
|
+
etc.) and just talk to it like a coach — describe results in whatever format
|
|
79
|
+
you have, ask what to study, mention an upcoming exam and its syllabus.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## What it tracks
|
|
84
|
+
|
|
85
|
+
| Capability | What it answers |
|
|
86
|
+
|---|---|
|
|
87
|
+
| Weak topics | Which concepts have the worst accuracy — and separates "skipped wisely" from "guessed and got it wrong," since JEE's negative marking makes those different problems |
|
|
88
|
+
| Recurring mistakes | Which error types repeat on the same concept across multiple tests — the thing a single per-test report can't show |
|
|
89
|
+
| Concept mastery (BKT) | A real probability of knowing each concept, updated after every attempt, with retention decay applied over time |
|
|
90
|
+
| Revision due | What's about to be forgotten and should be revised before that happens |
|
|
91
|
+
| Time patterns | Whether you're genuinely stuck on a concept (spending much longer on wrong answers) versus just making quick errors |
|
|
92
|
+
| Student profile | Overall pace, time-management tendencies, and subject strengths across everything logged so far |
|
|
93
|
+
| Exam planning | A full study plan for an upcoming exam's syllabus, accounting for topics you haven't touched yet |
|
|
94
|
+
| Progress verification | Before/after accuracy on a concept or exam once a plan has been acted on — the closed loop |
|
|
95
|
+
|
|
96
|
+
17 MCP tools total, covering logging, analytics, daily planning, exam
|
|
97
|
+
planning, and progress verification. See [`docs/plan.md`](docs/plan.md) for
|
|
98
|
+
the full build history and [`docs/chat-client-system-prompt.md`](docs/chat-client-system-prompt.md)
|
|
99
|
+
for exactly how a connected client is expected to use them.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Setup
|
|
104
|
+
|
|
105
|
+
Requires [Python ≥ 3.10](https://www.python.org/) and
|
|
106
|
+
[`uv`](https://github.com/astral-sh/uv).
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
uv sync
|
|
110
|
+
uv run python src/server.py # runs the server on stdio for local dev
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Connect it from any MCP client by pointing it at that command, e.g.:
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"mcpServers": {
|
|
118
|
+
"crack-jee": {
|
|
119
|
+
"command": "uv",
|
|
120
|
+
"args": ["run", "--directory", "C:/path/to/CRACK-JEE", "python", "src/server.py"]
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Once published to PyPI, `uvx crack-jee` will work with zero
|
|
127
|
+
local install — see [`docs/setup.md`](docs/setup.md) for exact commands and
|
|
128
|
+
[`docs/production-readiness-notes.md`](docs/production-readiness-notes.md)
|
|
129
|
+
for what's left before that.
|
|
130
|
+
|
|
131
|
+
### Test
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
uv run pytest tests/ -v
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Design principles
|
|
140
|
+
|
|
141
|
+
- **Deterministic core, LLM at the edges.** The LLM extracts and writes
|
|
142
|
+
plans in natural language; every mastery estimate, ranking, and trend is
|
|
143
|
+
plain code — reproducible, debuggable, and free to run.
|
|
144
|
+
- **Fixed-parameter BKT, not a trained model.** A single student's few
|
|
145
|
+
hundred attempts is a different data regime than the population-scale
|
|
146
|
+
data DKT/AKT/SAINT-style models need. See [`ex1.md §7`](ex1.md) for the
|
|
147
|
+
full reasoning, and [`research/synthetic_jee_kt/`](research/synthetic_jee_kt/)
|
|
148
|
+
for the benchmark that backs the decision.
|
|
149
|
+
- **Never invents an answer.** If a tool call fails on bad input or
|
|
150
|
+
something's ambiguous, the client is instructed to ask rather than guess
|
|
151
|
+
and log something wrong into your history.
|
|
152
|
+
- **Exam-agnostic.** Nothing hardcodes JEE's subjects or syllabus — concept
|
|
153
|
+
and subject are free-text fields set by whoever logs the data. Works the
|
|
154
|
+
same for any exam; JEE is just what it was built for.
|
|
155
|
+
|
|
156
|
+
Full rationale for every non-obvious decision, including rejected
|
|
157
|
+
approaches, is in [`docs/decisions.md`](docs/decisions.md) (append-only
|
|
158
|
+
log) and [`ex1.md`](ex1.md).
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Project structure
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
CRACK-JEE/
|
|
166
|
+
├── src/
|
|
167
|
+
│ ├── server.py # FastMCP server entrypoint
|
|
168
|
+
│ ├── db.py # SQLite schema, queries, concept dedup
|
|
169
|
+
│ ├── bkt.py # BKT closed-form Bayesian update + retention decay
|
|
170
|
+
│ └── tools/ # One file per MCP tool, registered in server.py
|
|
171
|
+
├── tests/ # Test suite (pytest)
|
|
172
|
+
├── research/synthetic_jee_kt/ # Independent KT-model benchmark, not part of the server
|
|
173
|
+
├── docs/ # Design docs, decision log, setup instructions
|
|
174
|
+
├── presentation/ # Hackathon deck source + related notes, not part of the server
|
|
175
|
+
└── pyproject.toml
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## License
|
|
181
|
+
|
|
182
|
+
MIT — see [`LICENSE`](LICENSE).
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
bkt.py,sha256=wjebwuIpXdSXulMRQg_xc7xM4SikxnFZ3YIICCRvCcA,1714
|
|
2
|
+
db.py,sha256=JNyk9oMQsDv0IGMeFbCqo6hxnRYrGDUQ2B8QyxUMo4s,28181
|
|
3
|
+
server.py,sha256=mdafy3nEpUembOACVZTT5NflbCk6gV_GIbHncR5W5tM,4624
|
|
4
|
+
crack_jee-0.1.0.dist-info/licenses/LICENSE,sha256=poByJUxS58Kbv2OVEqF3QjAonmaMZ1H4_l381uEvTqE,1078
|
|
5
|
+
tools/__init__.py,sha256=KFeWJ--sooijvgQROqL9tT72tPu79brfJAHflQcZr1A,30
|
|
6
|
+
tools/end_study_session.py,sha256=JgK23gExlZg5q6METO1DngZ_Ze04UxR5BDbV4POPU3M,643
|
|
7
|
+
tools/generate_daily_plan.py,sha256=TE_uoZjkaKR6m5cwPZURV8PyLvuEDpPjV5qlZMLI974,781
|
|
8
|
+
tools/generate_exam_plan.py,sha256=yFy7Sxq4l5Kz6KbbXzykJgWGiv9zGL6eBm6P49KZqhk,825
|
|
9
|
+
tools/get_concept_state.py,sha256=c1wlUtWXvKh5lX-r4G4Hwvppe-KFKxHHWw8co_rsON8,661
|
|
10
|
+
tools/get_exam.py,sha256=Rgcp0Cqy7Unn0AI3NYt-MsKmyln4B3UfmTeuuQHC1AM,579
|
|
11
|
+
tools/get_exam_progress.py,sha256=ya6D3eNqZk1VgVf8IOeXlnNyIm_y3CYar-ELQDPgsH8,643
|
|
12
|
+
tools/get_progress.py,sha256=xiKl2Sdw4paQ8M3uLg8FBrgiUE7szD6ME8YhjPZzMBY,570
|
|
13
|
+
tools/get_recurring_mistakes.py,sha256=Px6N_6GvcNFd1KYbp5rlsPyTb48Zi6Ohj4K8E6wS76s,714
|
|
14
|
+
tools/get_revision_due.py,sha256=Hfpr1kmw7N1itbpe34JRoFGXB5nrPhXlaVrXfYvNoaw,737
|
|
15
|
+
tools/get_student_profile.py,sha256=rGdySPgAqgNWBTSGuNbl_ewYfVyskf9yIQtsFOGd3Sw,765
|
|
16
|
+
tools/get_time_patterns.py,sha256=DgYUGYbLo0xIpKUEt0mP6kEqvqVqgV-7VJJEYzZBQVw,620
|
|
17
|
+
tools/get_weak_topics.py,sha256=VdZafoB9U7h3rO_TybuSJdjwlGbY03HjQg4lpv0PKQI,760
|
|
18
|
+
tools/list_concepts.py,sha256=91E5X9nNfTaJsGK2yw96nIarPyFTreEl0KyoObXhJxc,656
|
|
19
|
+
tools/list_exams.py,sha256=MdA5A6lj3CA5h54w0-BcKC99JBiDpWZYrgEZqOfhJVM,510
|
|
20
|
+
tools/log_performance_input.py,sha256=O3XllMyBPc0vp2nlDOS3aWl1S-EUz0QONNxZyCox928,2202
|
|
21
|
+
tools/set_exam.py,sha256=OM-MWMKa6zAoCMLdIdW-I19bvB_VAhtpcAGPc1IpHmc,782
|
|
22
|
+
crack_jee-0.1.0.dist-info/METADATA,sha256=Qww5jifyQTTGBCsIUNEA2Gx8m4_5VoXXlUdwiuyj42E,7675
|
|
23
|
+
crack_jee-0.1.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
24
|
+
crack_jee-0.1.0.dist-info/entry_points.txt,sha256=i4NPTvFmHXOcl_zsOuh0L0T6cthZbxiUvn0-lbXZ1vI,42
|
|
25
|
+
crack_jee-0.1.0.dist-info/top_level.txt,sha256=1kcMEyC649wDx7HVrlAr9smtCQA_Mjo-35gyIXCWo80,20
|
|
26
|
+
crack_jee-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sai Rithvik Mahankali
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|