Bob AI Assistant is a desktop, local-first AI companion built with Electron, React, Vite, and Ollama. It combines a modern conversational UI with voice input/output, persistent chat sessions, and a memory layer that can recall facts, goals, stories, and preferences from prior conversations.
The application is designed to run mostly on the user's machine. It uses local models through Ollama, local speech-to-text via Whisper, and Microsoft Edge TTS for voice output, so it can work without sending sensitive conversations to external APIs.
Bob AI Assistant is a personal productivity and chat assistant with the following goals:
- Provide a desktop experience for chatting with a local AI model
- Support voice input and voice output for a more natural interaction
- Preserve conversations across sessions
- Build a lightweight memory system that improves continuity over time
- Package the app as a Windows desktop installer for easy distribution
- Local AI chat using Ollama
- Voice input using microphone recording and Whisper-based transcription
- Voice output using system voices or Microsoft Edge TTS
- Session-based chat history with rename/delete support
- Personality customization commands such as /name, /tone, /style, and /set
- Memory extraction from conversations for facts, goals, preferences, and stories
- Desktop packaging via Electron Builder for Windows
Main UI Overview:
- Left sidebar with session history and new chat creation
- Central chat area showing messages and AI responses
- Model selector and voice controls in the top bar
- Input field with voice and send options at the bottom
- Frontend: React + Vite
- Desktop shell: Electron
- Backend/LLM integration: Ollama REST API
- Speech-to-text: Whisper via @xenova/transformers
- Text-to-speech: Edge TTS via node-edge-tts
- Build tool: Electron Builder
- Runtime: Node.js
The app follows a split-process desktop architecture:
flowchart LR
A[React UI] --> B[Preload Bridge]
B --> C[Electron Main Process]
C --> D[Ollama API]
C --> E[Edge TTS]
C --> F[Whisper STT]
C --> G[Local JSON Storage]
-
Presentation layer
- The React UI in src renders the chat interface, voice controls, model selection, and settings.
-
Electron host layer
- The main process in electron/main.js controls the application window, IPC handlers, voice services, and local file storage.
-
Integration layer
- The app talks to Ollama for chat generation, Whisper for transcription, and Edge TTS for speech synthesis.
-
Persistence layer
- Sessions and memory are stored locally in the user's application data folder as JSON files.
The application is not a traditional web app with a remote backend. Instead, it uses:
- a local Electron desktop shell
- a local Vite dev server during development
- a local Ollama server for inference
- local filesystem persistence for memory and sessions
This keeps the system fast, private, and suitable for offline or partially offline use.
- Electron launches the main window.
- The React UI loads and checks whether Ollama is available.
- If Ollama is not running, the app tries to start it automatically.
- The app checks for available models and prompts the user to load one if needed.
- User types or speaks a message.
- The frontend sends the message to the Ollama chat endpoint.
- The response is streamed back and shown in the UI.
- The app updates the session history and optionally speaks the reply.
- Microphone audio is captured in the browser.
- The audio is sent to the main process through Electron IPC.
- Whisper transcribes the speech into text.
- The text is fed into the chat flow.
- The assistant response can be spoken using Edge TTS or system TTS.
The app includes a lightweight memory architecture that extracts useful information from past chats:
- Facts: numerical data, scores, percentages, or explicit facts
- Goals: plans, intentions, and future actions
- Preferences: likes, dislikes, favorite choices
- Stories: narrative-style conversation chunks
- Key topics: recurring themes extracted from session content
These are stored in memory.json and later injected into the prompt context when relevant.
project3/
├── electron/
│ ├── main.js
│ └── preload.js
├── src/
│ ├── App.jsx
│ ├── index.css
│ ├── main.jsx
│ ├── ollama.js
│ └── useVoice.js
├── dist/ # built frontend + packaged output
├── index.html
├── package.json
├── vite.config.js
└── README.md
-
electron/main.js
- App lifecycle, BrowserWindow creation, IPC handlers, TTS, STT, and local storage management.
-
electron/preload.js
- Exposes a safe bridge between the renderer and main process.
-
src/App.jsx
- Main UI, chat state, sessions, personality commands, and conversation orchestration.
-
src/ollama.js
- Wrapper for Ollama API calls, model listing, model pulling, model warm-up, and streaming chat.
-
src/useVoice.js
- Hook for microphone handling, speech synthesis, and voice pipeline logic.
Before running the app, make sure you have:
- Node.js 18+ and npm
- Ollama installed and running
- An Ollama model available locally
Recommended model:
ollama pull gemma4:31b-cloudIf Ollama is not already running, the app will try to start it automatically during development.
Clone the repository:
git clone https://github.com/Sagar3039/project3.git
cd project3Install dependencies:
npm installRun the app in development mode:
npm run devThis starts:
- the Vite frontend dev server
- Electron with the app window
npm run dev:vite
npm run dev:electron
npm run build:vite
npm run build
npm run dist:winnpm run build:vitenpm run buildnpm run dist:winThis creates a Windows installer and related artifacts in the dist folder.
The current packaging configuration targets:
- Windows NSIS installer
- Application name: Bob AI Assistant
- App ID: com.sagar.bob-ai-assistant
The app stores data locally in the user data directory:
- sessions.json for chat sessions
- memory.json for extracted memory context
This allows the assistant to preserve memory and chat history across launches without depending on a server.
- Make sure Ollama is installed.
- Start it manually:
ollama serve- Pull the model manually:
ollama pull gemma4:31b-cloud- Check microphone permissions.
- Ensure your system has speech voices available.
- Check the console log for Edge TTS or Whisper-related errors.
- Make sure all dependencies are installed.
- Re-run npm install if package versions changed.
- Confirm Node.js version is compatible with the current dependency set.
Possible enhancements for the project include:
- Better memory ranking and retrieval quality
- Support for additional local models
- More robust multi-language voice support
- Better UI for memory inspection and editing
- Cloud sync or export/import options
- Improved packaging and auto-update support
This project is licensed under the MIT License.
