A voice-first, graph-based AI Research/learning interface designed for cognitive accessibility.
NeuraLearn reimagines how users interact with AI by replacing traditional linear chat interfaces with an infinite canvas mind map. Users can speak questions naturally, and the system intelligently routes them to the correct knowledge node, creates new nodes when needed, and responds with context-aware answers. Built with accessibility at its core, NeuraLearn reduces cognitive load through spatial organization, voice input/output, and visual relationship mapping.
Traditional AI chat interfaces present significant accessibility barriers:
-
Linear conversation overload – Users with dyslexia, ADHD, or working memory difficulties struggle to track long chat histories. Information gets buried in walls of text.
-
Text-heavy interaction – Users with visual impairments, reading difficulties, or motor disabilities face friction when typing and scanning dense responses.
-
No structural context – Standard chatbots treat every message as isolated. Users lose track of how topics relate, making research and learning fragmented.
-
High cognitive demand – Navigating back to earlier topics, remembering what was discussed, and synthesizing information across sessions requires significant mental effort.
These barriers exclude users who could benefit most from AI-assisted learning.
NeuraLearn addresses these challenges through three core design principles:
Instead of a scrolling chat log, knowledge is organized as a visual mind map. Each topic becomes a node. Subtopics branch naturally. Users see relationships spatially, reducing the need to remember or search through text.
A global microphone allows users to speak questions from anywhere in the interface. The system transcribes speech, classifies intent, and routes the question to the appropriate node—or creates a new one. Text-to-speech reads responses aloud.
All nodes are embedded using Google's text-embedding-004 model and stored in MongoDB Atlas with vector search. When users ask questions, the system finds semantically related existing nodes rather than creating duplicates.
| Feature | Accessibility Benefit |
|---|---|
| Global voice input (press G) | Hands-free interaction for motor-impaired users |
| Speech-to-text transcription | ElevenLabs Scribe v2 for accurate voice capture |
| Text-to-speech responses | ElevenLabs Turbo v2.5 reads AI responses aloud |
| Spatial mind map layout | Reduces working memory load; visual learners see structure |
| Auto-layout algorithm | Organizes nodes hierarchically without manual arrangement |
| Large, high-contrast nodes | Circular and rounded-rectangle nodes with neon gradient borders for visibility |
| Minimal text density | Each node shows only its title; full chat opens on double-click |
| Keyboard shortcut (G) | Quick access to voice without mouse navigation |
┌─────────────────────────────────────────────────────────────────────┐
│ Next.js 16 Frontend │
├─────────────────────────────────────────────────────────────────────┤
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────────┐ │
│ │ InfinityBoard │ │ ChatSidebar │ │ WorkspacesSidebar │ │
│ │ (ReactFlow) │ │ (AI Chat UI) │ │ (Workspaces) │ │
│ └────────┬────────┘ └────────┬────────┘ └─────────┬───────────┘ │
│ │ │ │ │
│ ┌────────┴────────────────────┴─────────────────────┴───────────┐ │
│ │ Zustand Store (store.ts) │ │
│ │ - Workspaces, nodes, edges, messages, active selections │ │
│ └───────────────────────────────┬───────────────────────────────┘ │
├──────────────────────────────────┼──────────────────────────────────┤
│ │ │
│ ┌───────────────────────────────┴───────────────────────────────┐ │
│ │ GlobalMic Component │ │
│ │ - Records audio via MediaRecorder API │ │
│ │ - Sends to /api/transcribe (ElevenLabs STT) │ │
│ │ - Classifies command via /api/classify-command │ │
│ │ - Routes question via /api/graph/route-question │ │
│ └───────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────┐
│ API Routes (Server) │
├─────────────────────────────────────────────────────────────────────┤
│ /api/transcribe → ElevenLabs Speech-to-Text │
│ /api/text-to-speech → ElevenLabs Text-to-Speech │
│ /api/classify-command → Gemini intent classification │
│ /api/graph/route-question→ Semantic routing + Google Search │
│ /api/chat/[nodeId] → Streaming chat with Gemini 2.0 Flash │
│ /api/graph/topics → CRUD for root topics (workspaces) │
│ /api/graph/nodes → CRUD for nodes + vector embedding │
│ /api/generate-note → AI-generated note content │
└─────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────┐
│ MongoDB Atlas (neuralearn DB) │
├─────────────────────────────────────────────────────────────────────┤
│ Collections: │
│ - root_topics → Workspace metadata │
│ - nodes → All graph nodes with 768-dim embeddings │
│ - node_interactions → Chat history per node │
│ │
│ Vector Search Index: "vector_index" on nodes.embedding │
│ (cosine similarity for semantic node matching) │
└─────────────────────────────────────────────────────────────────────┘
| Model | Provider | Purpose |
|---|---|---|
gemini-2.0-flash |
Google AI | Primary chat model for all conversations |
gemini-2.0-flash-exp |
Google AI | Web search integration via Google Search tool |
text-embedding-004 |
Google AI | 768-dimensional embeddings for semantic search |
NeuraLearn uses the Vercel AI SDK (ai package) for:
- Streaming responses via
streamText()for real-time chat - Structured output via
generateObject()for command classification and routing - Tool integration via
google.tools.googleSearch()for real-time web search - UI message handling via
useChat()hook for React state management
-
Intelligent Question Routing – When a user asks a question via voice, the system:
- Generates an embedding for the question
- Performs vector search to find similar existing nodes
- Uses Gemini to decide: route to existing node (score ≥ 0.85), create under related node (score ≥ 0.65), or create under root (score < 0.65)
-
Context-Aware Chat – Each node maintains its own conversation history. The AI receives the full context of the current node's topic and previous interactions.
-
Dynamic Summary Generation – After each chat interaction, the system generates an updated summary for the node and regenerates its embedding, improving future semantic search accuracy.
-
Web Search Tool – Users can enable Google Search for real-time information. The AI receives search results and cites sources.
- Provider: ElevenLabs Scribe v2
- Endpoint:
/api/transcribe - Flow: User presses G or clicks mic → MediaRecorder captures WebM audio → Sent to ElevenLabs → Returns transcription
- Use case: Completely hands-free question asking
- Provider: ElevenLabs Turbo v2.5
- Endpoint:
/api/text-to-speech - Voice: Rachel (natural female voice)
- Use case: AI responses can be read aloud for users with reading difficulties
The /api/classify-command endpoint uses Gemini to classify spoken input into:
create_node– Create a new subtopicdelete_node– Remove a nodenavigate_to– Go to an existing nodecreate_note– Add a personal note to a nodequestion– Ask the AI about a topic
This allows natural language commands like:
- "Create a node about derivatives from calculus"
- "Add a note to the physics node saying remember to review momentum"
- "What is machine learning?"
root_topics
{
id: string, // UUID
title: string, // Workspace name
description: string, // Brief description
node_count: number, // Number of nodes in workspace
created_at: Date
}nodes
{
id: string,
title: string,
summary: string, // AI-generated summary
parent_id: string | null, // null for root nodes
root_id: string, // Workspace this belongs to
tags: string[],
embedding: number[], // 768-dim vector
children_ids: string[],
ancestor_path: string[], // Full path from root
position: { x, y }, // Canvas position
interaction_count: number,
last_refined_at: Date,
created_at: Date
}node_interactions
{
node_id: string,
user_message: string,
ai_response: string,
timestamp: Date
}MongoDB Atlas Vector Search is configured with:
- Index name:
vector_index - Dimensions: 768 (Google text-embedding-004)
- Similarity: Cosine
- Filter: Scoped to
root_idfor workspace isolation
When users ask questions, the system:
- Generates an embedding for the query
- Searches for similar nodes within the current workspace
- Returns nodes with similarity scores for routing decisions
Research in cognitive psychology shows that spatial organization reduces working memory demands. When information is arranged visually with clear parent-child relationships:
- Users spend less effort remembering "where was that topic?"
- Related concepts are physically proximate
- The brain can offload memory to the visual structure
Users with ADHD, dyslexia, or autism often benefit from:
- Visual structure over linear text
- Chunked information in discrete nodes rather than paragraphs
- Flexible navigation allowing non-linear exploration
- Reduced scanning since each node shows only its title
Traditional chat forces users to scroll and re-read to find earlier context. NeuraLearn's graph structure means:
- Users can see all explored topics at once
- New questions are routed to existing nodes, not lost in scroll
- Notes can be attached to specific concepts
- The structure itself becomes a study artifact
| Layer | Technology |
|---|---|
| Framework | Next.js 16 (App Router) |
| Language | TypeScript |
| UI Library | React 19 |
| State Management | Zustand (with persist middleware) |
| Graph Visualization | React Flow (@xyflow/react) |
| AI SDK | Vercel AI SDK (ai, @ai-sdk/google) |
| LLM | Google Gemini 2.0 Flash |
| Embeddings | Google text-embedding-004 (768 dim) |
| Database | MongoDB Atlas |
| Vector Search | MongoDB Atlas Vector Search |
| Speech-to-Text | ElevenLabs Scribe v2 |
| Text-to-Speech | ElevenLabs Turbo v2.5 |
| Styling | Tailwind CSS v4 |
| UI Components | shadcn/ui, Radix UI |
| Animation | Motion (Framer Motion) |
- Node.js 18+
- pnpm (
npm install -g pnpm) - MongoDB Atlas account with Vector Search enabled
- Google AI API key
- ElevenLabs API key
Create .env.local:
MONGODB_URI=mongodb+srv://<user>:<pass>@<cluster>.mongodb.net/
GOOGLE_GENERATIVE_AI_API_KEY=your-google-ai-key
NEXT_PUBLIC_ELEVENLABS_API_KEY=your-elevenlabs-keyIn MongoDB Atlas, create a search index on the nodes collection:
{
"mappings": {
"dynamic": true,
"fields": {
"embedding": {
"dimensions": 768,
"similarity": "cosine",
"type": "knnVector"
}
}
}
}Name the index: vector_index
# Clone the repository
git clone https://github.com/Abdullah73k/neuraLearn.git
cd neuraLearn
# Install dependencies
pnpm install
# Run development server
pnpm devOpen http://localhost:3000.
- Click Add Workspace to create a new knowledge graph
- Double-click a node to open its chat
- Press G or click the microphone to ask questions by voice
- Enable Search toggle for real-time web results
- Use voice commands like "Create a node about X from Y"
- Offline support – Cache embeddings locally for offline semantic search
- Collaborative workspaces – Real-time multi-user editing
- Export options – Export graphs as Markdown, PDF, or Anki flashcards
- Accessibility audit – WCAG 2.1 AA compliance testing
- Mobile app – React Native version with voice-first design
- Multiple LLM providers – Support for OpenAI, Anthropic, local models
- Node summaries read aloud – TTS for node content on hover
- Dyslexia-friendly fonts – OpenDyslexic font toggle
NeuraLearn was built in 24 hours for DeltaHacks XII at McMaster University.
Theme: Accessibility in AI Interaction
Team Focus: Making AI-powered learning accessible to users with cognitive, visual, and motor disabilities through voice-first design and spatial knowledge organization.
MIT License – See LICENSE for details.
- Vercel AI SDK for seamless AI integration
- React Flow for the graph canvas
- ElevenLabs for voice synthesis
- MongoDB Atlas for vector search
- shadcn/ui for accessible components


