लोकाः समस्ताः सुखिनो भवन्तुMay all beings everywhere be at peace.
Sanskrit Engine
A reading tool for Sanskrit. Give it a sentence and it explains every word, its grammar and its meaning, and shows where each answer comes from.
- Type
- Personal project
- Year
- 2026
- Status
- In progress
- Role
- Solo
- Core
- Grammar rules · Vidyut · a local AI model
How it works
Grammar is computed; meaning is retrieved
Sanskrit grammar has fixed rules, so code can apply them exactly. The AI only writes the English explanation, and every claim it makes is checked against a dictionary.
- १
Input
Accepts Sanskrit in Devanagari or English letters.
- २
Split
Separates words that are written joined together.
- ३
Analyse
Finds each word's root and grammatical form.
- ४
Roles
Works out the subject, the object and the action.
- ५
Translate
Gives each word's meaning, with its dictionary source.
Example
बालः हस्तेन अन्नं खादति
- बालःbālaḥbālasubjectthe boy
- हस्तेनhastenahastameans (with)with the hand
- अन्नम्annamannaobjectfood
- kriyā · the verbखादतिkhādati√khādverbeats
Difficulties
Roadblocks along the way
- १
Joined words
Sanskrit often writes words joined together, and splitting them can have more than one right answer.
- २
Wrong dictionary forms
The word library returned verb roots instead of the nouns people look up, so this had to be corrected.
- ३
Compound words
One in five words is part of a compound word. Splitting these correctly is the next step.
Stack: Python, NLP, Vidyut, sanskrit_parser, RAG, Ollama, Qwen2.5-7B, instructor, Pydantic, BGE-M3, Qdrant, LLM evaluation, Streamlit, pytest