Axiom
Axiom: Math Help via Text, Image, Voice.
The problem Axiom solves
The Problem it Solves
Mathematics, while powerful, often presents significant hurdles:
- Input Friction: Getting complex mathematical problems into a digital format is often tedious and error-prone. Typing intricate LaTeX equations or long word problems can be frustrating and slow.
- Accessibility Barriers: Not everyone can easily type complex notation. Sometimes the problem exists only in a physical textbook, on a whiteboard, or as a spoken question. Traditional digital tools often fail to accommodate these real-world scenarios.
- Single-Mode AI Limitations: Most AI assistants excel at processing text but struggle with visual or auditory input. Users can't simply show the AI a picture of their homework or ask a question naturally. This limits the AI's usability for many common math help scenarios.
- Privacy Concerns: Sending images (which might contain personal information or context) or voice recordings directly to third-party AI services raises valid privacy concerns for users.
- Static Answers: Getting just a final answer isn't always helpful. Understanding the process requires clear explanations, and visualizing functions is key to grasping concepts, which static text often fails to provide.
Axiom tackles these problems head-on by providing a multi-modal, fast, privacy-conscious, and interactive math assistance experience.

What Can People Use It For? (How it Makes Tasks Easier/Safer)
Axiom empowers users to get mathematical help more easily, intuitively, and securely:
-
Solve Complex Problems Effortlessly:
- Type: Enter standard math questions via text.
- Snap & Solve: Take a picture of a printed equation OR a word problem from a book or paper. Axiom uses local OCR (Tesseract, Pix2Text) to understand it – no more tedious typing of complex formulas or paragraphs!
- Speak Your Mind: Ask math questions using natural voice input. Axiom uses local transcription (Whisper) to capture your query.
-
Understand, Don't Just Answer:
- Get clear, step-by-step explanations for solutions.
- See math rendered beautifully using standard LaTeX (via MathJax), making complex notation easy to read.
- Visualize functions! When you ask Axiom to plot a function, it generates an interactive 2D graph (via Plotly.js) directly in the chat, helping you understand its behavior. You can even view plots fullscreen for detailed exploration.
-
Learn and Refine Interactively:
- Made a mistake asking or think the AI misunderstood? Use the "Correct This Response" feature to provide feedback. Axiom uses the context of its previous answer and your correction to generate a refined solution.
-
Get Help Securely and Fast:
- Enhanced Privacy: Your raw image and voice data are processed locally on our server before being converted to text. Only the anonymized mathematical text is sent to the core LLM (Llama 3.3 70B via Groq), significantly reducing third-party data exposure and increasing user safety.
- Blazing Speed: Leveraging the Groq API ensures that complex reasoning and responses are delivered almost instantly.
Challenges we ran into
Building a seamless multi-modal AI application like Axiom definitely presented some interesting hurdles! Here are a few key ones:
-
Bridging the Multi-Modal Gap:
- Hurdle: The core AI model (Llama 3.3 70B via Groq) is fundamentally text-based, but we wanted users to interact naturally using images and voice. How do you make a text model "see" or "hear"?
- Solution: We designed a local pre-processing pipeline. Instead of sending raw image/voice data externally, our server handles it first:
- Voice: We integrated the Whisper library to perform accurate speech-to-text transcription locally.
- Images: We used a combination of Pix2Text (for extracting complex LaTeX from equations) and Tesseract OCR (for extracting text from word problems).
- Only the resulting, clean text (or LaTeX) is then sent to the Groq API. This required careful integration and ensures user privacy while enabling multi-modal input.
-
AI Prompt Engineering & Instruction Following:
- Hurdle: Getting the AI to consistently follow all instructions was tricky. Early versions would sometimes:
- Include meta-commentary like "This is a valid mathematical query..." before answering.
- Generate plot tags ([PLOT ...]) even when not explicitly asked.
- Conversely, sometimes prompts became too restrictive, causing the AI to refuse valid definition questions like "What is sin x?".
- Solution: This required iterative prompt refinement in groq_solver.py. We had to:
- Be Explicit: Clearly define the scope of valid math queries (including definitions).
- Add Strong Constraints: Use direct language like "ONLY IF user explicitly asks...", "NEVER include...", "CRITICAL: Never state...".
- Simplify: Reduce overall prompt complexity where possible to avoid confusion.
- Adjust Temperature: Fine-tune the Groq API's temperature setting to balance creativity and strict instruction following. It took several cycles to find the right balance.
- Hurdle: Getting the AI to consistently follow all instructions was tricky. Early versions would sometimes:
-
Dynamic Plotting - Handling AI Output Variations:
- Hurdle: While plotting y=x^2 worked, plotting sin(x) initially failed, especially when the AI specified ranges like -2pi to 2pi in the [PLOT ...] tag, or when trying to re-parse data for the fullscreen view. The frontend code wasn't correctly interpreting non-numeric range limits.
- Solution:
- We updated the regular expression in script.js (addMessage and handleFullscreenClick) to more robustly capture potentially complex range expressions outputted by the AI.
- Crucially, we replaced JavaScript's standard parseFloat() with math.evaluate() (from the included math.js library) when parsing x_min and x_max values from the tag. This allowed the frontend to correctly calculate the numerical values of expressions like -2*pi.
-
Mobile Hardware Access (Microphone & HTTPS):
- Hurdle: The voice recording feature worked perfectly on desktop (http://localhost) but failed consistently on mobile browsers accessed over the local network (e.g., http://192.168.x.x:5000), showing "Audio recording not supported".
- Cause: Modern mobile browsers strictly enforce the Secure Context (HTTPS) requirement for accessing sensitive APIs like navigator.mediaDevices.getUserMedia (microphone). Accessing via plain HTTP from a different device fails this requirement.
- Solution: We confirmed this by testing the application through an ngrok HTTPS tunnel. Accessing the https://....ngrok.io URL on mobile immediately allowed the microphone access to function correctly. This highlighted the critical need for HTTPS deployment for features involving hardware access.
Overcoming these challenges involved a mix of architectural design (local pre-processing), careful prompt engineering, robust frontend parsing ( math.js, improved regex), and understanding browser security requirements (HTTPS).
Tracks Applied (1)
Groq track
Groq

