Panini Engine
Ancient Grammar, Modern Engineering
Panini wrote the world's first formal grammar 2,500 years ago. We turned his Ashtadhyayi into a living, programmable engine. Free tools for verb conjugation, noun declension, Sandhi, Krdanta, and Samasa — plus interactive lessons and developer-ready APIs that bring Sanskrit into the 21st century.
Key Features
Built With
The problem
Sanskrit is taught from tables that hide the machine underneath
Sanskrit grammar is not irregular. It is one of the most completely specified grammars ever written: roughly four thousand rules, composed by Pāṇini around 2,500 years ago, that generate every valid word form in the language. The Aṣṭādhyāyī is closer to a formal system than to a style guide.
Almost nothing about how Sanskrit is taught reflects that. Learners memorise paradigm tables — eighteen forms for one verb, twenty-four for one noun — as though each were an arbitrary fact. The rule that produced the form is left out. So a student who meets an unfamiliar word has no procedure to fall back on, only a gap in a table they have not memorised yet.
The digital tools that exist mostly reproduce the tables. They will tell you that the third-person singular present of gam is gacchati. They will not tell you which sūtra inserted the ccha, or why. That is the part that generalises.
Why it exists
A grammar engine, not a dictionary of forms
Panini Engine derives forms rather than storing them. Given a root, a tense and a person, it runs the Pāṇinian derivation and returns the result together with the ordered list of sūtras that produced it. The trace is the product; the form is a by-product.
That constraint decides the architecture. A lookup table would have been faster to build and impossible to explain. A rule engine is slower to build, has to be right about rule ordering and blocking, and can show its work for every form it emits — including forms nobody has entered.
It also fixes a boundary that matters increasingly: the engine is deterministic. The product states plainly that every form is generated by the derivation engine and never invented by a language model. A model that hallucinates a plausible-looking Sanskrit form is worse than useless to a learner, because the learner cannot tell.
How it works
From a pasted sentence to a rule-by-rule derivation
- 01
Split the sandhi
Sanskrit written form runs words together and mutates the sounds at the joins. Before anything can be identified, the sentence has to be segmented — which is itself a rule-governed operation, not a dictionary lookup.
- 02
Identify each word
Each segment is resolved to a stem or root plus the grammatical information carried by its ending: which case, which number, which person, which tense.
- 03
Link to the root
Verb forms are traced to one of the roots in the Dhātupāṭha, the classical list of Sanskrit verb roots, grouped into ten classes that determine how each conjugates.
- 04
Replay the derivation
The engine reruns the derivation that produces the form, recording the sūtras applied in order. That trace is what the learner sees — not just the answer, but the path.
Who it is for
Who actually uses this
- Self-taught learners
- People working through Sanskrit without a teacher, who need a system that answers 'why is it this form' rather than only 'what is the form'. The curriculum runs beginner to advanced and is free without a card.
- Teachers and institutions
- Classroom use is a named tier, with a class roster, analytics, assignments and assessments, and a branded portal. The engine that grades is the same engine that teaches.
- Developers and researchers
- The grammar engine is exposed behind a REST API, so the derivation logic can be called from another application rather than reimplemented. There is a developer tier and published API documentation.
What it does
Capabilities, in detail
Grammar Lab — six explorers
Dhātupāṭha
The master list of Sanskrit verb roots, grouped into ten gaṇas. Look up a root's meaning, its class, and whether it takes parasmaipada or ātmanepada endings.
Tiṅanta
Verb conjugation. Turn a root into the actual inflected forms, or generate a full paradigm table for a given tense and mood.
Subanta
Nominal declension. Decline any noun stem across cases and numbers.
Kṛdanta
Verbal derivatives — gerunds, participles and the other forms built from a root with primary suffixes.
Samāsa
Compound formation. Build compounds from constituents, or split an existing compound into its parts.
Sandhi
The sound changes at word and morpheme joins, in both directions: apply them, or undo them to segment a sentence.
Learning
Structured curriculum
Twenty-three lessons running beginner to advanced, sequenced so each concept has a lab attached to it. Lessons are not paywalled.
Word-by-word breakdown
Paste any verse. It splits the sandhi, identifies each word, and links every word to its root and grammatical role.
Derivation traces
Every form ships with the sūtra that produced it — the feature the rest of the product exists to support.
Practice and streaks
Exercises tied to each concept, plus a daily challenge, streaks and XP to sustain the habit that language learning actually depends on.
Knowledge graph
The relationships between roots, forms, rules and lessons, navigable rather than buried in prose.
Engineering
Decisions we took, and what they cost
- Rules over tables, accepting the cost
- Storing paradigms would have shipped sooner and been far easier to keep correct. Deriving them means the rule ordering, blocking and exception handling all have to be right, because a single misordered rule produces a wrong form with a confident-looking trace. The payoff is that the system can explain a form it has never been asked for before.
- A hard boundary around the language model
- The tutor is a language model; the grammar is not. Generation stays with the deterministic engine and the model is confined to explanation. Letting a model produce forms would be quicker and would quietly destroy the product's only real claim.
- Free is the default, not the trial
- The full curriculum and all six tools work without payment or a card on file. The paid tier adds depth rather than gating the core — a deliberate product decision that constrains how the rest of the system can be monetised.
- Transliteration as a first-class concern
- Sanskrit is read in Devanāgarī and written about in IAST romanisation, and learners move between them constantly. Script handling is a display-layer toggle rather than a data-layer fork, so the same derivation renders either way.
- Installable and offline-tolerant
- The application registers a service worker and installs as a PWA. Grammar reference is the kind of thing people reach for on a phone, in a class, on bad connectivity.
Technology
What it is built on
- Application
- TypeScriptViteProgressive Web AppService worker
- Interface
- REST APIPublished API documentationGoogle Sign-In
- Domain
- Pāṇinian derivation engineDhātupāṭha corpusSūtra indexIAST / Devanāgarī transliteration
Commercial model
How it is priced, publicly
Bāla — free
₹0, no cardAll twenty-three lessons, all six grammar tools, and the word-by-word breakdown. The core curriculum is stated as free permanently.
Shiṣya Pro
Optional upgradeDeeper derivations and Smart Practice. Seven-day trial without a card, one per account.
Developer
API accessThe same grammar engine behind a REST API, for calling the derivation logic from another application.
Classroom
Starter / School / InstitutionClass roster and analytics, assignments and assessments, and a branded portal.
What is next
Stated on the product itself
- A mobile application
- Audio for every generated form
- A Hindi-language interface
What it taught us
What transfers to client work
- Rule engines that must show their work
- The same shape recurs in client systems wherever an answer has to be auditable rather than merely correct: pricing engines, eligibility checks, compliance decisions. Building a derivation trace that a sceptical expert will accept is a different problem from computing the result.
- Where a language model belongs, and where it does not
- Panini Engine draws the boundary explicitly — deterministic generation, model-assisted explanation. That is the same decision every product adding AI has to make, and the expensive version is discovering the boundary after launch.
- Free-first products have to be cheap to run
- A permanently free tier is a standing infrastructure commitment. It forces caching, static generation and cost-per-request discipline into the architecture from the start rather than as an optimisation pass later.
Related work
Need a system that can explain its own answers?
Rule engines, derivation traces, auditable decisions — the parts of Panini Engine that were hard are the parts that transfer. Tell us what your system has to justify and to whom.
Services this draws on
- AI/ML development
Where a model belongs inside a product, and where deterministic logic has to stay in charge.
- API development
Exposing an internal engine as a contract other systems can call.
- Web development
Installable, offline-tolerant web applications.