codelith 0.1.0__tar.gz

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.
Files changed (134) hide show
  1. codelith-0.1.0/LICENSE +21 -0
  2. codelith-0.1.0/PKG-INFO +301 -0
  3. codelith-0.1.0/README.md +270 -0
  4. codelith-0.1.0/backend/__init__.py +1 -0
  5. codelith-0.1.0/backend/agents/__init__.py +6 -0
  6. codelith-0.1.0/backend/agents/assessment_agent.py +273 -0
  7. codelith-0.1.0/backend/agents/coding_agent.py +779 -0
  8. codelith-0.1.0/backend/agents/concept_categories.py +131 -0
  9. codelith-0.1.0/backend/agents/concept_detector.py +1217 -0
  10. codelith-0.1.0/backend/agents/debug_agent.py +166 -0
  11. codelith-0.1.0/backend/agents/teacher_agent.py +179 -0
  12. codelith-0.1.0/backend/cli/__init__.py +1 -0
  13. codelith-0.1.0/backend/cli/config_cmd.py +135 -0
  14. codelith-0.1.0/backend/cli/main.py +606 -0
  15. codelith-0.1.0/backend/daemon/__init__.py +1 -0
  16. codelith-0.1.0/backend/daemon/launcher.py +243 -0
  17. codelith-0.1.0/backend/daemon/server.py +453 -0
  18. codelith-0.1.0/backend/daemon/state.py +110 -0
  19. codelith-0.1.0/backend/daemon/static/assets/Gambarino-Regular-BjbcsURA.otf +0 -0
  20. codelith-0.1.0/backend/daemon/static/assets/abnfDiagram-VCTEODGH-CCJBE2aE.js +1 -0
  21. codelith-0.1.0/backend/daemon/static/assets/arc-BEvzHx4o.js +1 -0
  22. codelith-0.1.0/backend/daemon/static/assets/architecture-7GRP2DOG-DaWrPggL.js +1 -0
  23. codelith-0.1.0/backend/daemon/static/assets/architectureDiagram-5GKGNRK7-pR-klcZv.js +36 -0
  24. codelith-0.1.0/backend/daemon/static/assets/array-BifhSqXX.js +1 -0
  25. codelith-0.1.0/backend/daemon/static/assets/blockDiagram-I7D4REHJ-C504Gj6_.js +129 -0
  26. codelith-0.1.0/backend/daemon/static/assets/c4Diagram-7LVT6UL2-BjM04Mni.js +38 -0
  27. codelith-0.1.0/backend/daemon/static/assets/channel-DzSauwD3.js +1 -0
  28. codelith-0.1.0/backend/daemon/static/assets/chunk-2Q5K7J3B-C1jixKkw.js +1 -0
  29. codelith-0.1.0/backend/daemon/static/assets/chunk-4HAMMTFA-EgoP78tp.js +62 -0
  30. codelith-0.1.0/backend/daemon/static/assets/chunk-5VM5RSS4-ZNzvKenW.js +15 -0
  31. codelith-0.1.0/backend/daemon/static/assets/chunk-75Z2AOVW-EXNbuzun.js +2 -0
  32. codelith-0.1.0/backend/daemon/static/assets/chunk-DU6HZSFF-CF3OK3MZ.js +127 -0
  33. codelith-0.1.0/backend/daemon/static/assets/chunk-F27PBJKO-G71ylWJa.js +1 -0
  34. codelith-0.1.0/backend/daemon/static/assets/chunk-FOHPRMQF-DHwB1DNv.js +161 -0
  35. codelith-0.1.0/backend/daemon/static/assets/chunk-GMAD6QVW-2yfGg28o.js +72 -0
  36. codelith-0.1.0/backend/daemon/static/assets/chunk-GVQU2GXP-C_VeaX4U.js +1 -0
  37. codelith-0.1.0/backend/daemon/static/assets/chunk-IMKFNOWR-CNexRjjn.js +231 -0
  38. codelith-0.1.0/backend/daemon/static/assets/chunk-JWPE2WC7-DVXcaiue.js +1 -0
  39. codelith-0.1.0/backend/daemon/static/assets/chunk-P2QGCYS3-E4AByfsD.js +1 -0
  40. codelith-0.1.0/backend/daemon/static/assets/chunk-POPQ4Y6H-Bisbc2-3.js +1 -0
  41. codelith-0.1.0/backend/daemon/static/assets/chunk-PWAF6VOD-DaoPxZAa.js +1 -0
  42. codelith-0.1.0/backend/daemon/static/assets/chunk-SHT3W25Y-DarPToto.js +168 -0
  43. codelith-0.1.0/backend/daemon/static/assets/chunk-SVP7TREG-DvMOAiwI.js +88 -0
  44. codelith-0.1.0/backend/daemon/static/assets/chunk-TICWLB2K-DheuvyGM.js +206 -0
  45. codelith-0.1.0/backend/daemon/static/assets/chunk-XXDRQBXY-DFBUG-OT.js +1 -0
  46. codelith-0.1.0/backend/daemon/static/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +1 -0
  47. codelith-0.1.0/backend/daemon/static/assets/classDiagram-ZZMXUADV-Ys5zkCXW.js +1 -0
  48. codelith-0.1.0/backend/daemon/static/assets/classDiagram-v2-VYDZK3BY-Ys5zkCXW.js +1 -0
  49. codelith-0.1.0/backend/daemon/static/assets/cose-bilkent-JH36ORCC-DLPLnxrP.js +1 -0
  50. codelith-0.1.0/backend/daemon/static/assets/cynefin-OW5HDTMX-Dv1OY_0y.js +1 -0
  51. codelith-0.1.0/backend/daemon/static/assets/cynefinDiagram-5FMLGOSQ-Ur7MTCmF.js +62 -0
  52. codelith-0.1.0/backend/daemon/static/assets/cytoscape.esm-CECbKnxF.js +321 -0
  53. codelith-0.1.0/backend/daemon/static/assets/dagre-CJLTJMFW.js +1 -0
  54. codelith-0.1.0/backend/daemon/static/assets/dagre-GXQ25YYZ-R3BwTvng.js +4 -0
  55. codelith-0.1.0/backend/daemon/static/assets/defaultLocale-BFoDCU3G.js +1 -0
  56. codelith-0.1.0/backend/daemon/static/assets/diagram-S7CK7UJ4-BxIoEKb4.js +30 -0
  57. codelith-0.1.0/backend/daemon/static/assets/diagram-UQ7AKVKN-DO4cuWN-.js +41 -0
  58. codelith-0.1.0/backend/daemon/static/assets/diagram-VSXAHHWV-DW5imp5t.js +3 -0
  59. codelith-0.1.0/backend/daemon/static/assets/diagram-VX7I27RA-CdZ3k7wQ.js +24 -0
  60. codelith-0.1.0/backend/daemon/static/assets/diagram-Z3DM3KII-DPyjbneL.js +24 -0
  61. codelith-0.1.0/backend/daemon/static/assets/dist-DTg6UBE_.js +1 -0
  62. codelith-0.1.0/backend/daemon/static/assets/ebnfDiagram-PWID7BFC-BO7VQsye.js +1 -0
  63. codelith-0.1.0/backend/daemon/static/assets/erDiagram-RLTQ6QDP-CevvjECq.js +99 -0
  64. codelith-0.1.0/backend/daemon/static/assets/eventmodeling-NTZA5JFV-yNfKR6-v.js +1 -0
  65. codelith-0.1.0/backend/daemon/static/assets/flowDiagram-HODETNUW-B4GT41mU.js +1 -0
  66. codelith-0.1.0/backend/daemon/static/assets/ganttDiagram-EL5Y4UJY-DNW5fWw1.js +292 -0
  67. codelith-0.1.0/backend/daemon/static/assets/gitGraph-4MIJSDKK-DKgVkWaZ.js +1 -0
  68. codelith-0.1.0/backend/daemon/static/assets/gitGraphDiagram-WWUBYQGX-0S7OF9Aj.js +106 -0
  69. codelith-0.1.0/backend/daemon/static/assets/index-D3vj8REa.js +63 -0
  70. codelith-0.1.0/backend/daemon/static/assets/index-D4lMFaiv.css +1 -0
  71. codelith-0.1.0/backend/daemon/static/assets/info-A6RAGUB7-Bxy-SzRN.js +1 -0
  72. codelith-0.1.0/backend/daemon/static/assets/infoDiagram-27XIBGKW-ClzQji6X.js +2 -0
  73. codelith-0.1.0/backend/daemon/static/assets/init-C-OQMol4.js +1 -0
  74. codelith-0.1.0/backend/daemon/static/assets/ishikawaDiagram-5VMMS53U-B3Lo-sS3.js +70 -0
  75. codelith-0.1.0/backend/daemon/static/assets/journeyDiagram-3NMN7TZE-0KL6R2Rz.js +139 -0
  76. codelith-0.1.0/backend/daemon/static/assets/kanban-definition-UXKFOSKX-zt5NbEep.js +89 -0
  77. codelith-0.1.0/backend/daemon/static/assets/katex-CXMH3UgJ.js +257 -0
  78. codelith-0.1.0/backend/daemon/static/assets/line-CiAFRJVJ.js +1 -0
  79. codelith-0.1.0/backend/daemon/static/assets/linear-BI6yqEPV.js +1 -0
  80. codelith-0.1.0/backend/daemon/static/assets/logo_darkmode-BPDdj6GZ.png +0 -0
  81. codelith-0.1.0/backend/daemon/static/assets/logo_lightmode-C3ZWMgAH.png +0 -0
  82. codelith-0.1.0/backend/daemon/static/assets/mermaid-parser.core-DEadI1Ja.js +7 -0
  83. codelith-0.1.0/backend/daemon/static/assets/mindmap-definition-YA3MSWOX-TGKGYg5n.js +96 -0
  84. codelith-0.1.0/backend/daemon/static/assets/ordinal-BDEzSJ7C.js +1 -0
  85. codelith-0.1.0/backend/daemon/static/assets/packet-AYTQ26CC-CZTSuh5x.js +1 -0
  86. codelith-0.1.0/backend/daemon/static/assets/path-fybaL0A-.js +1 -0
  87. codelith-0.1.0/backend/daemon/static/assets/pegDiagram-XKGWAZYB-DGd8LACA.js +1 -0
  88. codelith-0.1.0/backend/daemon/static/assets/pie-WAS4IAKB-B59sPr3Z.js +1 -0
  89. codelith-0.1.0/backend/daemon/static/assets/pieDiagram-E7YTZNPT-CpwxCR3L.js +39 -0
  90. codelith-0.1.0/backend/daemon/static/assets/quadrantDiagram-AXDQQJYC-BwSeF_E_.js +7 -0
  91. codelith-0.1.0/backend/daemon/static/assets/radar-RG4KPBEZ-DAa4JvTb.js +1 -0
  92. codelith-0.1.0/backend/daemon/static/assets/railroad-74A4TZTK-BitdNgDt.js +1 -0
  93. codelith-0.1.0/backend/daemon/static/assets/railroad-abnf-HS5TGJTU-DCrNKqAH.js +1 -0
  94. codelith-0.1.0/backend/daemon/static/assets/railroad-ebnf-LZEXJU2U-DmEwx8OK.js +1 -0
  95. codelith-0.1.0/backend/daemon/static/assets/railroad-peg-WCYAUIDC-CPc8dTCP.js +1 -0
  96. codelith-0.1.0/backend/daemon/static/assets/railroadDiagram-O6MQD6OU-DuizuzwD.js +1 -0
  97. codelith-0.1.0/backend/daemon/static/assets/requirementDiagram-BXWQKSXE-BjMk0yS8.js +84 -0
  98. codelith-0.1.0/backend/daemon/static/assets/rough.esm-Dy-Kn_BL.js +1 -0
  99. codelith-0.1.0/backend/daemon/static/assets/sankeyDiagram-P5KCCOFB-0T_bhkmz.js +40 -0
  100. codelith-0.1.0/backend/daemon/static/assets/sequenceDiagram-WJ2MYXX4-Cwa-1Stp.js +162 -0
  101. codelith-0.1.0/backend/daemon/static/assets/sizeCapture-INFHLROL-B0uUizjq.js +1 -0
  102. codelith-0.1.0/backend/daemon/static/assets/src-BH-TyZbA.js +1 -0
  103. codelith-0.1.0/backend/daemon/static/assets/stateDiagram-D77RDMKH-BpQSg_QL.js +1 -0
  104. codelith-0.1.0/backend/daemon/static/assets/stateDiagram-v2-MP3YSRHH-BItVXKof.js +1 -0
  105. codelith-0.1.0/backend/daemon/static/assets/swimlanes-42K2YHIH-h_ED18Vy.js +1 -0
  106. codelith-0.1.0/backend/daemon/static/assets/swimlanesDiagram-VR7AAH4N-D0fo0LN-.js +8 -0
  107. codelith-0.1.0/backend/daemon/static/assets/timeline-definition-24CTP7MA-DKfSO33a.js +120 -0
  108. codelith-0.1.0/backend/daemon/static/assets/treeView-Q6P3EWNA-DAj9fxfC.js +1 -0
  109. codelith-0.1.0/backend/daemon/static/assets/treemap-WGGIJYW6-5IIXD9Zu.js +1 -0
  110. codelith-0.1.0/backend/daemon/static/assets/vennDiagram-4TSXK5OY-BoBvVEci.js +34 -0
  111. codelith-0.1.0/backend/daemon/static/assets/wardley-WFR3VGLG-CGsd7s_-.js +1 -0
  112. codelith-0.1.0/backend/daemon/static/assets/wardleyDiagram-VM6X3IG4-QHdK5NsY.js +78 -0
  113. codelith-0.1.0/backend/daemon/static/assets/xychartDiagram-S5SC5T6Z-MN_fdKCJ.js +7 -0
  114. codelith-0.1.0/backend/daemon/static/index.html +49 -0
  115. codelith-0.1.0/backend/database/__init__.py +1 -0
  116. codelith-0.1.0/backend/database/concept_slug.py +39 -0
  117. codelith-0.1.0/backend/database/concepts.py +804 -0
  118. codelith-0.1.0/backend/llm/__init__.py +5 -0
  119. codelith-0.1.0/backend/llm/client.py +333 -0
  120. codelith-0.1.0/backend/llm/config.py +254 -0
  121. codelith-0.1.0/backend/llm/key_setup.py +237 -0
  122. codelith-0.1.0/backend/main.py +13 -0
  123. codelith-0.1.0/backend/orchestrator/__init__.py +1 -0
  124. codelith-0.1.0/backend/orchestrator/events.py +52 -0
  125. codelith-0.1.0/backend/orchestrator/graph.py +316 -0
  126. codelith-0.1.0/backend/orchestrator/modes.py +125 -0
  127. codelith-0.1.0/codelith.egg-info/PKG-INFO +301 -0
  128. codelith-0.1.0/codelith.egg-info/SOURCES.txt +132 -0
  129. codelith-0.1.0/codelith.egg-info/dependency_links.txt +1 -0
  130. codelith-0.1.0/codelith.egg-info/entry_points.txt +2 -0
  131. codelith-0.1.0/codelith.egg-info/requires.txt +6 -0
  132. codelith-0.1.0/codelith.egg-info/top_level.txt +1 -0
  133. codelith-0.1.0/pyproject.toml +54 -0
  134. codelith-0.1.0/setup.cfg +4 -0
codelith-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Himani Ghenyappa Bagale
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.
@@ -0,0 +1,301 @@
1
+ Metadata-Version: 2.4
2
+ Name: codelith
3
+ Version: 0.1.0
4
+ Summary: A multi-agent AI mentor that blends coding assistance with adaptive teaching.
5
+ Author-email: Himani Bagale <himanibagale@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/MakersNeedMore-MnM/Round2-himanibagale
8
+ Project-URL: Repository, https://github.com/MakersNeedMore-MnM/Round2-himanibagale
9
+ Keywords: ai,tutor,mentor,coding-assistant,langgraph,education
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Intended Audience :: Education
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Education
20
+ Classifier: Topic :: Software Development
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: fastapi
25
+ Requires-Dist: uvicorn[standard]
26
+ Requires-Dist: openai
27
+ Requires-Dist: langgraph
28
+ Requires-Dist: langchain-core
29
+ Requires-Dist: keyring
30
+ Dynamic: license-file
31
+
32
+ # CodeLith
33
+ <p><strong>Build with AI. Understand what you build.</strong></p>
34
+
35
+ AI has made software development faster than ever, but it has also made it easier to build without understanding. For students and new developers especially, AI-generated code can become a black box rather than an opportunity to learn.
36
+
37
+ CodeLith bridges this gap by combining AI-powered coding with contextual learning—as the agent builds, it identifies the concepts introduced in the code, explains them visually, assesses the user's understanding, and tracks their progress. It transforms AI-assisted coding from simply getting code to actually understanding how it works.
38
+
39
+ ## Prototype
40
+
41
+ <table>
42
+ <tr>
43
+ <th>CodeLith Terminal Agent</th>
44
+ <th>Real-time code explanations - Dark Mode</th>
45
+ </tr>
46
+ <tr>
47
+ <td><img src="https://github.com/user-attachments/assets/f275269f-51ec-4bc7-90bc-ca57c0b72534" alt="CodeLith Dashboard" width="500"/></td>
48
+ <td><img src="https://github.com/user-attachments/assets/7cd62bf1-7920-444d-aba9-578eefea2d33" alt="CodeLith Dashboard - Learning Progress" width="500"></td>
49
+ </tr>
50
+ </table>
51
+
52
+ <table>
53
+ <tr>
54
+ <th>Track Your Learning Progress - Dark Mode</th>
55
+ <th>Choose Your Coding Mode - Dark Mode</th>
56
+ </tr>
57
+ <tr>
58
+ <td><img src="https://github.com/user-attachments/assets/a872b360-429b-4df4-85c8-54d1bb1711b3" alt="CodeLith Dashboard" width="500"/></td>
59
+ <td><img src="https://github.com/user-attachments/assets/0b5088f2-2c33-48ab-91e4-c423d01575d7" alt="CodeLith Dashboard - Learning Progress" width="500"></td>
60
+ </tr>
61
+ </table>
62
+
63
+ <table>
64
+ <tr>
65
+ <th>Check Your Understanding - Light Mode</th>
66
+ <th>Ask CodeLith AI - Dark Mode</th>
67
+ </tr>
68
+ <tr>
69
+ <td><img src="https://github.com/user-attachments/assets/20ac5c89-6169-4698-9f64-713dc2dfbefd" alt="CodeLith Dashboard" width="500"/></td>
70
+ <td><img src="https://github.com/user-attachments/assets/363b3485-5cff-4b93-8dcc-82f1e45fec9e" alt="CodeLith Dashboard - Learning Progress" width="500"></td>
71
+ </tr>
72
+ </table>
73
+
74
+ ## How it works
75
+
76
+ CodeLith does not attach a generic lesson to a coding session. It follows the
77
+ actual work the coding agent performed, finds the important idea inside the
78
+ result, and turns that idea into a path toward independent understanding.
79
+
80
+ ```mermaid
81
+ flowchart LR
82
+ R[User request<br/>Build a notification service] --> A[AI coding agent]
83
+ A --> T[Tool activity<br/>Read, edit, run tests]
84
+ T --> C[Generated code<br/>Provider-backed service]
85
+ C --> D{Meaningful concept<br/>in the changed code?}
86
+ D -->|Evidence found| K[Dependency Injection]
87
+ K --> V[Visual explanation<br/>Receives dependency<br/>instead of creating it]
88
+ V --> Q[Assessment<br/>Why is testing easier?]
89
+ Q --> M[Mastery<br/>Explain and reuse it]
90
+ D -->|No| N[Keep workflow quiet]
91
+
92
+ classDef action fill:#16324f,stroke:#4ba3c7,color:#ffffff
93
+ classDef insight fill:#f3b562,stroke:#c47f24,color:#171717
94
+ classDef outcome fill:#2f6f5e,stroke:#8ed1b2,color:#ffffff
95
+ class A,T,C action
96
+ class K,V,Q insight
97
+ class M outcome
98
+ ```
99
+ The learning is grounded in evidence, not in a static tutorial library:
100
+
101
+ - The **request** provides the goal.
102
+ - The **coding agent's tool activity** shows what it actually changed and ran.
103
+ - The **concept detector** identifies a meaningful technique from that change.
104
+ - The **visual explanation** makes the technique concrete in the context of
105
+ the new code.
106
+ - The **assessment** checks whether the user can reason about the choice,
107
+ rather than merely recognize its name.
108
+ - **Mastery** means the user can explain and reuse the idea independently.
109
+
110
+ ## Architecture
111
+
112
+ CodeLith is a local three-process system: a CLI, a browser dashboard, and a
113
+ background daemon that hosts the API and the agent graph. Both frontends talk
114
+ to the same daemon, which is the single source of truth for session state
115
+ (conversation history, mode, concepts, assessments, teachings).
116
+
117
+
118
+ ```mermaid
119
+ flowchart TB
120
+ subgraph Local[User machine]
121
+ CLI[codelith CLI<br/>interactive terminal]
122
+ UI[React dashboard<br/>concepts, activity, progress]
123
+ D[Local daemon<br/>FastAPI + uvicorn<br/>localhost]
124
+ G[Agent graph<br/>LangGraph orchestration]
125
+ DB[(SQLite<br/>local session state)]
126
+ K[(OS keyring<br/>Groq + OpenRouter keys)]
127
+ CLI <-->|HTTP| D
128
+ UI <-->|HTTP + SSE| D
129
+ D --> G
130
+ D <--> DB
131
+ CLI --> K
132
+ end
133
+
134
+ subgraph Agents[Specialized agents]
135
+ C[Coding]
136
+ X[Concept detection]
137
+ R[Debugging]
138
+ A[Assessment]
139
+ T[Teaching]
140
+ end
141
+
142
+ G --> C
143
+ C -->|failed command| R
144
+ C -->|successful turn| X
145
+ X --> A
146
+ X --> T
147
+ A --> DB
148
+ T --> DB
149
+ C -->|model request| LLM[LLM providers<br/>Groq + OpenRouter<br/>HTTPS]
150
+ R -->|model request| LLM
151
+ X -->|model request when needed| LLM
152
+ A -->|model request| LLM
153
+ T -->|model request| LLM
154
+ ```
155
+
156
+ ## Repository layout
157
+
158
+ ```text
159
+ CodeLith/
160
+ ├── backend/
161
+ │ ├── agents/ # coding, debug, assessment, teacher agents + concept detector
162
+ │ ├── cli/ # the `codelith` command-line interface
163
+ │ ├── daemon/ # FastAPI server, detached-process launcher, state files
164
+ │ ├── database/ # SQLite persistence: concepts, teachings, assessments
165
+ │ ├── llm/ # Groq + OpenRouter clients, key and model resolution
166
+ │ ├── orchestrator/ # LangGraph agent graph, session modes, event stream
167
+ │ └── main.py # backend entrypoint
168
+ ├── frontend/ # React dashboard (Vite + TypeScript + Mermaid)
169
+ ├── tests/ # pytest suite
170
+ ├── pyproject.toml # packaging config + `codelith` entry point
171
+ └── README.md
172
+ ```
173
+
174
+ ## Future Enhancements
175
+
176
+ - Add session export/import so users can save conversations, concepts, assessments, and progress.
177
+ - Add project/workspace awareness so CodeLith can remember the repository being studied and maintain project-specific learning context.
178
+ - Add user progress analytics: mastered concepts, recurring mistakes, learning streaks, and recommended next topics.
179
+ - Build a plugin system for custom agents, tools, concept detectors, and teaching strategies.
180
+
181
+ # First-time CodeLith setup
182
+
183
+ These steps are for users who installed CodeLith from PyPI for the first time.
184
+
185
+ ## 1. Install CodeLith
186
+
187
+ Use Python 3.10 or newer:
188
+
189
+ ```powershell
190
+ py -m pip install codelith
191
+ ```
192
+
193
+ ## 2. Start CodeLith
194
+
195
+ ```powershell
196
+ codelith
197
+ ```
198
+
199
+ On the first run, CodeLith asks for two API keys. Create them from the official provider pages:
200
+
201
+ - Groq: <https://console.groq.com/keys>
202
+ - OpenRouter: <https://openrouter.ai/keys>
203
+
204
+ Paste each key when prompted. CodeLith validates the key before saving it to the Windows credential store. The keys are not written to the project or printed in the terminal.
205
+
206
+ Groq powers teaching, explanations, assessment, and concept detection. OpenRouter powers the coding and debugging agents. Both keys are required for the complete experience.
207
+
208
+ After setup, CodeLith starts its local daemon and opens the dashboard in your browser. The dashboard is normally available at <http://localhost:8765/>.
209
+
210
+ Once installed, CodeLith can be launched anytime with a single command:
211
+
212
+ ```bash
213
+ codelith
214
+ ```
215
+
216
+ ## Commands
217
+
218
+ ### In the terminal session
219
+
220
+ Typed at the `>` prompt, after the banner:
221
+
222
+ | Command | Effect |
223
+ | --- | --- |
224
+ | `exit`, `quit`, `q` | Leave the session — the daemon keeps running in the background |
225
+ | `reset`, `clear`, `/reset` | Start a fresh conversation |
226
+ | `mode` | Show the current mode and the available modes |
227
+ | `mode <name>` | Switch mode — one of `learn`, `pair-programming`, `autonomous` |
228
+
229
+ Anything else is sent to the agent. Mode changes made on the dashboard are
230
+ picked up by the terminal automatically, and vice versa.
231
+
232
+ ### CLI subcommands
233
+
234
+ | Command | Effect |
235
+ | --- | --- |
236
+ | `codelith` | Chat session: first-run key setup, daemon autostart, dashboard link — opens in the browser after a short pause |
237
+ | `codelith setup [groq\|openrouter]` | Enter or re-enter an API key (validated first, saved to the OS credential store) |
238
+ | `codelith config show` | Show every model role and its resolved model |
239
+ | `codelith config set <role> <model>` | Override one role's model (Available agent roles are `coding`, `debugging`, `teaching`, `assessment`,`grading`, and `detection`.) |
240
+ | `codelith config unset <role>` | Remove a role's override — back to the built-in default |
241
+
242
+ ### Daemon control
243
+
244
+ | Command | Effect |
245
+ | --- | --- |
246
+ | `python -m backend.daemon.launcher start` | Start the daemon detached, if not already running |
247
+ | `python -m backend.daemon.launcher status` | Show whether it runs, and on which port |
248
+ | `python -m backend.daemon.launcher open` | Start it if needed, then open the dashboard in the browser |
249
+ | `python -m backend.daemon.launcher stop` | Stop the daemon |
250
+
251
+
252
+ ### Three ways to work
253
+
254
+ | Mode | Best for | Behavior |
255
+ | --- | --- | --- |
256
+ | `learn` | Building understanding | Detects concepts, explains the work, and asks questions about each new concept. |
257
+ | `pair-programming` | Staying in the flow | Focuses on building while detecting concepts and asking occasional questions. |
258
+ | `autonomous` | Finishing a well-defined task | Prioritizes implementation and debugging with minimal learning interruptions. |
259
+
260
+ Switch modes from either interface.
261
+
262
+ ## Development setup
263
+
264
+ ### Backend
265
+
266
+ ```bash
267
+ git clone https://github.com/MakersNeedMore-MnM/Round2-himanibagale
268
+ cd Round2-himanibagale
269
+ python -m venv .venv
270
+ .venv\Scripts\activate # Windows (bash: source .venv/Scripts/activate)
271
+ pip install -e .
272
+
273
+ ```
274
+
275
+ Run from source without installing the package:
276
+
277
+ ```bash
278
+ python -m backend.cli.main
279
+ ```
280
+
281
+ ### Frontend (dashboard)
282
+
283
+ ```bash
284
+ cd frontend
285
+ npm install
286
+ npm run dev # dev server with HMR on :5173, calls the daemon on :8765
287
+ npm run build # writes backend/daemon/static/ inside the Python package
288
+ ```
289
+ ### Tests
290
+
291
+ ```bash
292
+ python -m pytest tests/ -v
293
+ ```
294
+ ## Contributing
295
+
296
+ Want to contribute? Check out our [Contributing Guide](https://github.com/MakersNeedMore-MnM/Round2-himanibagale/blob/main/CONTRIBUTING.md).
297
+
298
+ ## License
299
+
300
+ MIT — see [LICENSE](https://github.com/MakersNeedMore-MnM/Round2-himanibagale/blob/main/LICENSE).
301
+
@@ -0,0 +1,270 @@
1
+ # CodeLith
2
+ <p><strong>Build with AI. Understand what you build.</strong></p>
3
+
4
+ AI has made software development faster than ever, but it has also made it easier to build without understanding. For students and new developers especially, AI-generated code can become a black box rather than an opportunity to learn.
5
+
6
+ CodeLith bridges this gap by combining AI-powered coding with contextual learning—as the agent builds, it identifies the concepts introduced in the code, explains them visually, assesses the user's understanding, and tracks their progress. It transforms AI-assisted coding from simply getting code to actually understanding how it works.
7
+
8
+ ## Prototype
9
+
10
+ <table>
11
+ <tr>
12
+ <th>CodeLith Terminal Agent</th>
13
+ <th>Real-time code explanations - Dark Mode</th>
14
+ </tr>
15
+ <tr>
16
+ <td><img src="https://github.com/user-attachments/assets/f275269f-51ec-4bc7-90bc-ca57c0b72534" alt="CodeLith Dashboard" width="500"/></td>
17
+ <td><img src="https://github.com/user-attachments/assets/7cd62bf1-7920-444d-aba9-578eefea2d33" alt="CodeLith Dashboard - Learning Progress" width="500"></td>
18
+ </tr>
19
+ </table>
20
+
21
+ <table>
22
+ <tr>
23
+ <th>Track Your Learning Progress - Dark Mode</th>
24
+ <th>Choose Your Coding Mode - Dark Mode</th>
25
+ </tr>
26
+ <tr>
27
+ <td><img src="https://github.com/user-attachments/assets/a872b360-429b-4df4-85c8-54d1bb1711b3" alt="CodeLith Dashboard" width="500"/></td>
28
+ <td><img src="https://github.com/user-attachments/assets/0b5088f2-2c33-48ab-91e4-c423d01575d7" alt="CodeLith Dashboard - Learning Progress" width="500"></td>
29
+ </tr>
30
+ </table>
31
+
32
+ <table>
33
+ <tr>
34
+ <th>Check Your Understanding - Light Mode</th>
35
+ <th>Ask CodeLith AI - Dark Mode</th>
36
+ </tr>
37
+ <tr>
38
+ <td><img src="https://github.com/user-attachments/assets/20ac5c89-6169-4698-9f64-713dc2dfbefd" alt="CodeLith Dashboard" width="500"/></td>
39
+ <td><img src="https://github.com/user-attachments/assets/363b3485-5cff-4b93-8dcc-82f1e45fec9e" alt="CodeLith Dashboard - Learning Progress" width="500"></td>
40
+ </tr>
41
+ </table>
42
+
43
+ ## How it works
44
+
45
+ CodeLith does not attach a generic lesson to a coding session. It follows the
46
+ actual work the coding agent performed, finds the important idea inside the
47
+ result, and turns that idea into a path toward independent understanding.
48
+
49
+ ```mermaid
50
+ flowchart LR
51
+ R[User request<br/>Build a notification service] --> A[AI coding agent]
52
+ A --> T[Tool activity<br/>Read, edit, run tests]
53
+ T --> C[Generated code<br/>Provider-backed service]
54
+ C --> D{Meaningful concept<br/>in the changed code?}
55
+ D -->|Evidence found| K[Dependency Injection]
56
+ K --> V[Visual explanation<br/>Receives dependency<br/>instead of creating it]
57
+ V --> Q[Assessment<br/>Why is testing easier?]
58
+ Q --> M[Mastery<br/>Explain and reuse it]
59
+ D -->|No| N[Keep workflow quiet]
60
+
61
+ classDef action fill:#16324f,stroke:#4ba3c7,color:#ffffff
62
+ classDef insight fill:#f3b562,stroke:#c47f24,color:#171717
63
+ classDef outcome fill:#2f6f5e,stroke:#8ed1b2,color:#ffffff
64
+ class A,T,C action
65
+ class K,V,Q insight
66
+ class M outcome
67
+ ```
68
+ The learning is grounded in evidence, not in a static tutorial library:
69
+
70
+ - The **request** provides the goal.
71
+ - The **coding agent's tool activity** shows what it actually changed and ran.
72
+ - The **concept detector** identifies a meaningful technique from that change.
73
+ - The **visual explanation** makes the technique concrete in the context of
74
+ the new code.
75
+ - The **assessment** checks whether the user can reason about the choice,
76
+ rather than merely recognize its name.
77
+ - **Mastery** means the user can explain and reuse the idea independently.
78
+
79
+ ## Architecture
80
+
81
+ CodeLith is a local three-process system: a CLI, a browser dashboard, and a
82
+ background daemon that hosts the API and the agent graph. Both frontends talk
83
+ to the same daemon, which is the single source of truth for session state
84
+ (conversation history, mode, concepts, assessments, teachings).
85
+
86
+
87
+ ```mermaid
88
+ flowchart TB
89
+ subgraph Local[User machine]
90
+ CLI[codelith CLI<br/>interactive terminal]
91
+ UI[React dashboard<br/>concepts, activity, progress]
92
+ D[Local daemon<br/>FastAPI + uvicorn<br/>localhost]
93
+ G[Agent graph<br/>LangGraph orchestration]
94
+ DB[(SQLite<br/>local session state)]
95
+ K[(OS keyring<br/>Groq + OpenRouter keys)]
96
+ CLI <-->|HTTP| D
97
+ UI <-->|HTTP + SSE| D
98
+ D --> G
99
+ D <--> DB
100
+ CLI --> K
101
+ end
102
+
103
+ subgraph Agents[Specialized agents]
104
+ C[Coding]
105
+ X[Concept detection]
106
+ R[Debugging]
107
+ A[Assessment]
108
+ T[Teaching]
109
+ end
110
+
111
+ G --> C
112
+ C -->|failed command| R
113
+ C -->|successful turn| X
114
+ X --> A
115
+ X --> T
116
+ A --> DB
117
+ T --> DB
118
+ C -->|model request| LLM[LLM providers<br/>Groq + OpenRouter<br/>HTTPS]
119
+ R -->|model request| LLM
120
+ X -->|model request when needed| LLM
121
+ A -->|model request| LLM
122
+ T -->|model request| LLM
123
+ ```
124
+
125
+ ## Repository layout
126
+
127
+ ```text
128
+ CodeLith/
129
+ ├── backend/
130
+ │ ├── agents/ # coding, debug, assessment, teacher agents + concept detector
131
+ │ ├── cli/ # the `codelith` command-line interface
132
+ │ ├── daemon/ # FastAPI server, detached-process launcher, state files
133
+ │ ├── database/ # SQLite persistence: concepts, teachings, assessments
134
+ │ ├── llm/ # Groq + OpenRouter clients, key and model resolution
135
+ │ ├── orchestrator/ # LangGraph agent graph, session modes, event stream
136
+ │ └── main.py # backend entrypoint
137
+ ├── frontend/ # React dashboard (Vite + TypeScript + Mermaid)
138
+ ├── tests/ # pytest suite
139
+ ├── pyproject.toml # packaging config + `codelith` entry point
140
+ └── README.md
141
+ ```
142
+
143
+ ## Future Enhancements
144
+
145
+ - Add session export/import so users can save conversations, concepts, assessments, and progress.
146
+ - Add project/workspace awareness so CodeLith can remember the repository being studied and maintain project-specific learning context.
147
+ - Add user progress analytics: mastered concepts, recurring mistakes, learning streaks, and recommended next topics.
148
+ - Build a plugin system for custom agents, tools, concept detectors, and teaching strategies.
149
+
150
+ # First-time CodeLith setup
151
+
152
+ These steps are for users who installed CodeLith from PyPI for the first time.
153
+
154
+ ## 1. Install CodeLith
155
+
156
+ Use Python 3.10 or newer:
157
+
158
+ ```powershell
159
+ py -m pip install codelith
160
+ ```
161
+
162
+ ## 2. Start CodeLith
163
+
164
+ ```powershell
165
+ codelith
166
+ ```
167
+
168
+ On the first run, CodeLith asks for two API keys. Create them from the official provider pages:
169
+
170
+ - Groq: <https://console.groq.com/keys>
171
+ - OpenRouter: <https://openrouter.ai/keys>
172
+
173
+ Paste each key when prompted. CodeLith validates the key before saving it to the Windows credential store. The keys are not written to the project or printed in the terminal.
174
+
175
+ Groq powers teaching, explanations, assessment, and concept detection. OpenRouter powers the coding and debugging agents. Both keys are required for the complete experience.
176
+
177
+ After setup, CodeLith starts its local daemon and opens the dashboard in your browser. The dashboard is normally available at <http://localhost:8765/>.
178
+
179
+ Once installed, CodeLith can be launched anytime with a single command:
180
+
181
+ ```bash
182
+ codelith
183
+ ```
184
+
185
+ ## Commands
186
+
187
+ ### In the terminal session
188
+
189
+ Typed at the `>` prompt, after the banner:
190
+
191
+ | Command | Effect |
192
+ | --- | --- |
193
+ | `exit`, `quit`, `q` | Leave the session — the daemon keeps running in the background |
194
+ | `reset`, `clear`, `/reset` | Start a fresh conversation |
195
+ | `mode` | Show the current mode and the available modes |
196
+ | `mode <name>` | Switch mode — one of `learn`, `pair-programming`, `autonomous` |
197
+
198
+ Anything else is sent to the agent. Mode changes made on the dashboard are
199
+ picked up by the terminal automatically, and vice versa.
200
+
201
+ ### CLI subcommands
202
+
203
+ | Command | Effect |
204
+ | --- | --- |
205
+ | `codelith` | Chat session: first-run key setup, daemon autostart, dashboard link — opens in the browser after a short pause |
206
+ | `codelith setup [groq\|openrouter]` | Enter or re-enter an API key (validated first, saved to the OS credential store) |
207
+ | `codelith config show` | Show every model role and its resolved model |
208
+ | `codelith config set <role> <model>` | Override one role's model (Available agent roles are `coding`, `debugging`, `teaching`, `assessment`,`grading`, and `detection`.) |
209
+ | `codelith config unset <role>` | Remove a role's override — back to the built-in default |
210
+
211
+ ### Daemon control
212
+
213
+ | Command | Effect |
214
+ | --- | --- |
215
+ | `python -m backend.daemon.launcher start` | Start the daemon detached, if not already running |
216
+ | `python -m backend.daemon.launcher status` | Show whether it runs, and on which port |
217
+ | `python -m backend.daemon.launcher open` | Start it if needed, then open the dashboard in the browser |
218
+ | `python -m backend.daemon.launcher stop` | Stop the daemon |
219
+
220
+
221
+ ### Three ways to work
222
+
223
+ | Mode | Best for | Behavior |
224
+ | --- | --- | --- |
225
+ | `learn` | Building understanding | Detects concepts, explains the work, and asks questions about each new concept. |
226
+ | `pair-programming` | Staying in the flow | Focuses on building while detecting concepts and asking occasional questions. |
227
+ | `autonomous` | Finishing a well-defined task | Prioritizes implementation and debugging with minimal learning interruptions. |
228
+
229
+ Switch modes from either interface.
230
+
231
+ ## Development setup
232
+
233
+ ### Backend
234
+
235
+ ```bash
236
+ git clone https://github.com/MakersNeedMore-MnM/Round2-himanibagale
237
+ cd Round2-himanibagale
238
+ python -m venv .venv
239
+ .venv\Scripts\activate # Windows (bash: source .venv/Scripts/activate)
240
+ pip install -e .
241
+
242
+ ```
243
+
244
+ Run from source without installing the package:
245
+
246
+ ```bash
247
+ python -m backend.cli.main
248
+ ```
249
+
250
+ ### Frontend (dashboard)
251
+
252
+ ```bash
253
+ cd frontend
254
+ npm install
255
+ npm run dev # dev server with HMR on :5173, calls the daemon on :8765
256
+ npm run build # writes backend/daemon/static/ inside the Python package
257
+ ```
258
+ ### Tests
259
+
260
+ ```bash
261
+ python -m pytest tests/ -v
262
+ ```
263
+ ## Contributing
264
+
265
+ Want to contribute? Check out our [Contributing Guide](https://github.com/MakersNeedMore-MnM/Round2-himanibagale/blob/main/CONTRIBUTING.md).
266
+
267
+ ## License
268
+
269
+ MIT — see [LICENSE](https://github.com/MakersNeedMore-MnM/Round2-himanibagale/blob/main/LICENSE).
270
+
@@ -0,0 +1 @@
1
+ """CodeLith backend package."""
@@ -0,0 +1,6 @@
1
+ """CodeLith agents — autonomous workers that handle specific tasks.
2
+
3
+ - coding_agent: reads/writes files, runs commands, builds features.
4
+ - debug_agent: runs tests, diagnoses failures, fixes code.
5
+ - teacher_agent: analyzes code for concepts and teaches the user.
6
+ """