Apas AI Lab Research Division · Apas Learning Pvt Ltd
Kota, Rajasthan · Est. 2019 · Startup India Recognised

Original engines for
knowledge systems

We build computation engines from first principles — in OCaml, Rust, and Elm — for mathematics, Vedic astrology, music theory, and structured educational content. Not wrappers. Not fine-tunes. Original work.

Part of ApasHub ecosystem
Core engines

Built from first principles

Three OCaml engines that power computation across the entire Apas platform — mathematics, astrology, and music.

OCaml · GTMath

General Mathematics Engine

Arbitrary-precision number tower with symbolic computation and Vedic mathematics sutras. Powers all numerical work across ApasLearners and ApasCreative.

  • Int, BigInt, Frac, BigRat, Dec, Float tower
  • Matrix and linear algebra
  • Coordinate geometry
  • Number theory and equation solvers
  • Symbolic engine
  • 8 Vedic sutras implemented
  • Terminal REPL with variable assignment
OCaml · Jyotish

Vedic Astrology Engine

Full Jyotish computation engine covering natal charts through divisional charts, all major dasha systems, and classical yoga detection.

  • Natal and 16 divisional charts
  • Vimshottari + 8 Udu dasha systems
  • Raja, Dhana, Viparita yogas
  • Sudarshana Chakra
  • Muhurta and Panchang
  • Varshaphal and Jaimini lagnas
  • Statistical research database
OCaml · GTMusic

Music Theory Engine

Layered music generation library from theory through synthesis — covering Indian and Western traditions with a unified interval and scale system.

  • Note, Interval, Scale modules
  • Chord construction and voicing
  • Composition layer
  • Synth and DSP pipeline
  • Rules engine for style constraints
Rendering systems

Content and diagram infrastructure

Two Elm-based systems that turn JSON blocks into rendered educational content — on web, mobile, and inside AI responses.

Elm · ContentKit

Block-based content renderer

Universal block system covering 14 UI block types, interactive elements, story blocks, language blocks, and learning blocks. The same JSON spec powers ApasLearners, ApasBooks, ApasCreative, and AI chat responses from ApasAgents. Inline markup parser, KaTeX math rendering, WebGPU/WGSL shader blocks, and 5 plot types including histogram, heatmap, and candlestick.

Elm · DiagramKit

Diagram rendering library

Purpose-built diagram system with modules for FlowChart, Mindmap, Cycle diagrams, Relationship maps, Geometry (with polycurve, junction, freecurve, LaTeX labels), Ray Optics, Plot2D with 13 plot types, and astrology charts — North and South Indian kundali, dasha timelines, transit wheels. Wired to Rust API and OCaml backends.

Rust · Axum · apas-agents

AI agent service

Streaming agent platform with named agents (Apas, Nova, Astra, Sage, Quill, Muse, Atlas, Axiom), knowledge base injection, builtin and HTTP tool executors, prompt caching, cost tracking, and ContentKit block format as the universal response format. Axiom agent is wired directly to the OCaml GTMath engine.

pgvector · RAG

Content pipeline

Offline authoring pipeline for original educational content grounded in source material. pgvector embeddings prevent hallucination by anchoring AI tutor responses to verified ContentKit blocks — not freeform generation. NCERT Biology structure complete across 12 topics per chapter. Common Core Mathematics Grade 6 authored.

Technology stack

What we build with

Every layer chosen deliberately — not for familiarity, but for what the problem demands.

Language System Why
OCaml GTMath, Jyotish, GTMusic engines Algebraic types make number towers and ASTs natural. Strong type system catches domain errors at compile time. Fast enough for computation servers.
Rust / Axum apas-agents, apas-admin Memory safety without GC overhead. Async performance for SSE streaming. Axum's extractor pattern keeps agent routing clean.
Elm ContentKit, DiagramKit, Geometry Editor No runtime exceptions. Enforced immutability prevents the class of UI bugs that cause VirtualDOM corruption. Every block type is a variant — exhaustive pattern matching.
Django accounts.apashub.com — auth, billing OTP registration, JWT issuance, Razorpay subscription management. Admin panel with unmanaged models for Rust-owned tables.
PostgreSQL Primary database — all domains Domain schemas: content, questions, crm, promo, platform, contests. Partial unique indexes for diagram slug normalisation. pgvector for RAG embeddings.
WebGPU / WGSL Shader blocks in ContentKit Physics and mathematics visualisations that run on the GPU directly from structured content blocks. Three delivery modes: CDN URL, DB id, inline.
Research philosophy

Verified content prevents hallucination better than alignment does

The dominant approach to AI tutoring is to prompt a general model and hope it stays accurate. We think this is wrong for education — especially for subjects like JEE Physics or Jyotish where precision is non-negotiable.

Our approach: author content once in verified ContentKit blocks, embed it with pgvector, and anchor every AI response to those blocks. The AI explains — it does not invent. The OCaml engine computes — it does not estimate.

This is slower to build. It is correct by construction.

01

Original engines over API wrappers

GTMath, Jyotish, and GTMusic are built from scratch in OCaml — not wrappers around a third-party CAS or astrology library. We own the computation.

02

Structured content as the contract

ContentKit JSON blocks are the universal format across every surface — web, mobile, AI responses, PDFs, books. One spec, every renderer.

03

Indian knowledge systems deserve precision

Vedic mathematics, Jyotish, Sanskrit — these are rigorous systems. We treat them with the same engineering rigour as a physics engine.

04

Type systems as correctness guarantees

OCaml and Elm's type systems eliminate whole classes of runtime errors. In an education product, a wrong answer is worse than no answer.

Research enquiries

Write to research@apashub.com  ·  For partnerships and B2B, use the ApasHub contact page

Get in touch →