An intelligent graphing calculator powered by Claude AI that transforms how you interact with mathematics. Using natural language, voice commands, or image analysis, Arkimedes helps you visualize, understand, and explore mathematical concepts through an autonomous agent with deep integration into the Desmos graphing engine.
More than a calculator β it's your personal math tutor. Every interaction is designed to teach concepts, build intuition, and deepen understanding, not just compute answers.
- Frontend: Vite + React 19 + TypeScript + TailwindCSS 4 + Zustand
- Backend: C++20 HTTP server (cpp-httplib + nlohmann/json + OpenSSL)
- AI: Claude via Anthropic Messages API with tool use + extended thinking
- Graph Engine: Desmos Graphing Calculator API (CDN)
Traditional graphing calculators are powerful but intimidating. Arkimedes bridges the gap between computational power and educational accessibility by:
- Lowering the barrier to entry β natural language instead of cryptic syntax
- Building mathematical intuition β every response explains the "why", not just the "what"
- Encouraging exploration β AI-generated suggestions guide you toward deeper insights
- Providing immediate feedback β intelligent error messages turn mistakes into learning opportunities
Whether you're a student learning calculus, an educator creating demonstrations, or an enthusiast exploring mathematical beauty, Arkimedes meets you where you are.
The AI doesn't just execute commands β it teaches. Ask "Graph y = sin(xΒ²) + 5" and you'll get both the visualization AND an educational breakdown: what the +5 does (vertical shift), how xΒ² inside sin creates accelerating oscillations, and suggested experiments to deepen your understanding.
Type mathematical expressions like y = xΒ² or f(x) = cos(x) directly in chat and watch them appear instantly on the canvas β no sidebar needed. The AI follows up with contextual explanations to reinforce the concepts.
Every AI interaction automatically includes your current graph state (all expressions, viewport settings, colors, and labels). Ask "make the parabola wider" or "shift everything left by 2 units" and the agent knows exactly what you're referring to.
Double-click any expression to edit it inline. When you modify it, an intelligent popover appears explaining the conceptual impact: "Increasing the coefficient from 2 to 4 made the line twice as steep" or "Adding 3 shifted the entire graph upward."
Make a syntax mistake like y = sin(x (missing closing parenthesis)? Instead of cryptic error messages, you'll see a clear explanation of what went wrong, why the syntax matters, and get a one-click "Fix it" button with the corrected expression.
Graph functions and watch contextual suggestion chips appear: "Find intersection points", "Explore the derivative", "Analyze symmetry". Click any chip to launch a guided AI exploration of that mathematical concept.
The autonomous agent has complete control over your graphing experience through 12 specialized tools: add/remove/update expressions, configure viewport and zoom, animate slider parameters, construct piecewise functions, run polynomial regressions, label key features, clear the canvas, capture screenshots, and read the complete graph state.
- True SSE Streaming: Real-time response streaming from Claude through the C++ backend to your browser using httplib's chunked content provider
- Rate Limiting: Intelligent 20 requests/minute per IP limit with sliding window algorithm to prevent abuse
- Structured Logging: Comprehensive request tracking with IDs, IP addresses, message counts, payload sizes, and performance metrics
- Resilient Retry Logic: Automatic exponential backoff for transient API failures (429, 529, 5xx errors) ensures reliable operation
- Model Configuration: Frontend control over model selection with support for extended thinking budgets for complex mathematical reasoning
- Context Management: Automatic conversation pruning with intelligent summary injection to maintain performance during extended sessions
- Node.js 20+ and npm
- CMake 3.20+
- C++20 compiler (MSVC via Visual Studio on Windows, or GCC/Clang on Linux/macOS)
- OpenSSL development libraries
- Windows:
winget install ShiningLight.OpenSSLor install from https://slproweb.com/products/Win32OpenSSL.html - macOS:
brew install openssl - Linux:
sudo apt install libssl-dev(Ubuntu/Debian)
- Windows:
- Anthropic API key from https://console.anthropic.com
npm installCreate a .env file in the project root with your Anthropic API key:
ANTHROPIC_API_KEY=sk-ant-your-key-hereGet your API key from the Anthropic Console.
# First-time configuration (downloads cpp-httplib and nlohmann/json via CMake FetchContent)
cmake -S server -B server/build
# Build the server in release mode
cmake --build server/build --config ReleaseWindows users: You can also open server/CMakeLists.txt directly in Visual Studio.
Open two separate terminal windows:
# Terminal 1: Start the C++ backend server (port 3001)
./server/build/arkimedes-server # Linux/macOS
.\server\build\Release\arkimedes-server.exe # Windows
# Terminal 2: Start the Vite frontend dev server (port 5173)
npm run devThen open your browser to http://localhost:5173
Note: The frontend provides basic graphing functionality (expression input, keypad, visual editing) even without the backend. However, all AI chat features require the C++ server to be running.
- Direct expression input: Type equations in the sidebar expression list to graph them immediately
- Chat-based graphing: Type mathematical expressions like
y = xΒ²,f(x) = tan(x), orr = 2sin(ΞΈ)directly in chat for instant visualization - Inline editing: Double-click any expression in the sidebar to edit it on-the-fly
Talk to the AI agent via the floating Command Center panel (top-right corner):
Natural Language Commands:
- "Plot y = sin(x) with a removable discontinuity at x = 0"
- "Create a parabola with vertex at (2, 3) and a root at x = 5"
- "Clear the graph and start with a fresh canvas"
- "Make the blue curve twice as steep"
- "Fit a quadratic regression to these data points: (1,2), (3,8), (5,18)"
- "Show me the tangent line to f(x) at x = 3"
- "Animate parameter 'a' from 0 to 10"
Multimodal Input:
- Voice input: Click the microphone button to dictate mathematical commands hands-free
- Vision analysis: Switch to the Vision tab and drag-and-drop an image of any graph β the AI will analyze it, identify key features, and recreate it on your canvas
- Concept chips: After graphing functions, explore AI-generated suggestion chips that appear below the chat window
- Error assistance: Get instant help when you make syntax errors, complete with one-click fixes
- Clear chat: Reset the conversation history with the trash icon in the Command Center header
Tip: The AI remembers your entire graph state, so you can reference "the parabola", "the red line", or "that function" naturally in conversation.
arkimedes/
βββ server/ C++ backend (HTTP proxy to Anthropic API)
β βββ CMakeLists.txt Build configuration with dependency management
β βββ src/
β βββ main.cpp SSE streaming server on port 3001 with rate limiting
β βββ anthropic_client.h HTTPS client with retry logic and exponential backoff
β βββ system_prompt.h Socratic Math Expert Module system prompt
β βββ tools.h 12 tool definitions with JSON schemas
β
βββ src/ React 19 frontend application
β βββ components/
β β βββ agent/ AI interaction components
β β β βββ CommandCenter.tsx Main AI chat interface
β β β βββ ChatPanel.tsx Message display and streaming
β β β βββ VoiceInput.tsx Speech-to-text integration
β β β βββ VisionInput.tsx Image analysis interface
β β β βββ ErrorSuggestion.tsx Syntax error help with auto-fix
β β β βββ ConceptChips.tsx AI-generated exploration suggestions
β β β
β β βββ calculator/ Graph visualization and controls
β β β βββ DesmosCalculator.tsx Desmos API wrapper component
β β β βββ ExpressionList.tsx Interactive expression sidebar
β β β βββ Keypad.tsx Virtual mathematical keyboard
β β β βββ DiffPopover.tsx Expression change explanations
β β β
β β βββ layout/ App structure components
β β β βββ TopBar.tsx
β β β βββ Sidebar.tsx
β β β βββ MainLayout.tsx
β β β
β β βββ ui/ Reusable UI primitives
β β βββ GlassPanel.tsx Glassmorphism container
β β βββ IconButton.tsx Accessible icon buttons
β β
β βββ hooks/ Custom React hooks
β β βββ useDesmos.ts Desmos calculator state management
β β βββ useAgentChat.ts AI conversation handling with SSE
β β βββ useVoiceInput.ts Web Speech API integration
β β
β βββ lib/ Core utilities and business logic
β β βββ calculator-controller.ts Desmos API abstraction layer
β β βββ sse-parser.ts Server-sent events stream parser
β β βββ diff-analyzer.ts Expression change detection
β β βββ concept-detector.ts Pattern recognition for suggestions
β β βββ markdown.ts Lightweight markdown renderer
β β βββ math-detector.ts Expression pattern matching
β β βββ context-window.ts Conversation history management
β β
β βββ stores/ Zustand state management
β β βββ graph-store.ts Graph state and expression tracking
β β βββ agent-store.ts AI agent configuration
β β βββ chat-store.ts Message history and streaming
β β βββ desmos-store.ts Global calculator instance
β β
β βββ types/ TypeScript type definitions
β βββ desmos.d.ts Desmos API type declarations
β
βββ index.html Entry point (loads Desmos CDN)
βββ vite.config.ts Dev server config (proxies /api β :3001)
βββ tailwind.config.js TailwindCSS 4 configuration
βββ package.json Node.js dependencies and scripts
βββ .env Environment variables (API keys)
- React 19 β Latest React with improved concurrent rendering
- TypeScript β Type safety and enhanced developer experience
- Vite β Lightning-fast build tool and dev server with HMR
- TailwindCSS 4 β Utility-first CSS with alpha features
- Zustand β Lightweight state management without boilerplate
- C++20 β Modern C++ with concepts, ranges, and coroutines
- cpp-httplib β Single-header HTTP/HTTPS server library
- nlohmann/json β Intuitive JSON parsing and serialization
- OpenSSL β Secure HTTPS communication with Anthropic API
- Claude 3.5 Sonnet β State-of-the-art language model with tool use
- Extended Thinking β Deep reasoning mode for complex mathematics
- Tool Use β 12 specialized functions for graph manipulation
- SSE Streaming β Real-time token-by-token response delivery
Contributions are welcome! Whether you're fixing bugs, adding features, improving documentation, or enhancing the educational prompts, your help makes Arkimedes better for everyone.
- Fork the repository and create a feature branch
- Follow existing code style and TypeScript conventions
- Test thoroughly β both frontend UI and backend integration
- Update documentation for any new features or changes
- Submit a pull request with a clear description
This project is open source and available under the MIT License.
- Desmos β For their incredible graphing calculator API
- Anthropic β For Claude and the powerful tool use capabilities
- cpp-httplib β For making HTTP servers in C++ delightfully simple