Inspiration
AI made it easy to get answers and easy to skip the learning. Most AI tools treat every message the same way. Good tutors don't. They explain when you're lost, hold back when you're close, and point at the exact step that doesn't work. I wanted to build something that teaches like that. The name comes from हेतु (hetu), Sanskrit for reason, or the ground of an inference.
What it does
Hetu decides how to help before it answers. If you're lost, it explains with an example at your level. If you're working through a problem, it gives a hint and leaves the steps to you. If you share a proof or an argument, it finds the step that doesn't follow and asks about it. You can also pick the kind of help yourself. A workspace beside the chat holds longer drafts and maps a proof into a graph of its steps. Hetu also draws exact function plots and checks math with SymPy. It supports voice input and read aloud. You can use it as a guest, or sign in to save your work.
How I built it
Each turn starts with a coach that reads the conversation and returns a typed plan. Plain code acts on that plan and sends the turn to one specialist: math, science, programming, writing, or logic. The backend is FastAPI with LangChain Deep Agents, running gpt-oss-120b on Groq for speed. The frontend is React, TypeScript, and Tailwind. Accounts and saved work run on Neon Postgres and Neon Auth. Row level security in the database keeps each user's data their own.
Challenges I ran into
The hardest part was getting Hetu to hold back. A language model wants to give the full answer. Letting the model plan while code enforces the plan fixed that. Security took care too. I wanted guests to stay completely private and signed in users to be fully isolated, so I wrote tests that try to read and change another user's data. Smaller things added up: math breaking inside tables, the shader losing its context, and replies scrolling past the point where you start reading.
Accomplishments that I'm proud of
- Hetu reconsiders its feedback when a student pushes back, instead of repeating itself.
- Security lives in the database. The browser can only reach its owner's rows, and tests prove it.
- Plots are computed point by point in the browser, so the curves are exact.
- Light and dark themes, voice, and keyboard access all work, with automated accessibility checks passing on every screen.
What I learned
Good teaching is mostly about deciding when not to help. On the technical side, I learned to let the model make judgment calls and let code make the rules. I also learned that putting security in the database makes the rest of the app much simpler.
What's next for Hetu
- Test it with real students and measure whether they learn more.
- Extend the reasoning graph beyond math to essays and arguments.
- Add a safe sandbox so Hetu can run student code.
- Draw more kinds of diagrams than function plots.
- Move to its own domain.
Built With
- better-auth
- fastapi
- glsl
- groq
- html
- katex
- langchain
- neon
- postgresql
- pydantic
- python
- react
- render
- sql
- sympy
- tailwind-css
- typescript
- vite
- web-speech-api
- webgl