Database Schema
OpenWhispr uses better-sqlite3 for local data storage. The database is located in the app’s user data directory:
macOS : ~/Library/Application Support/OpenWhispr/transcriptions.db
Windows : %APPDATA%\OpenWhispr\transcriptions.db
Linux : ~/.config/OpenWhispr/transcriptions.db
Tables
transcriptions
Stores transcription history.
CREATE TABLE transcriptions (
id INTEGER PRIMARY KEY AUTOINCREMENT,
text TEXT NOT NULL ,
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
custom_dictionary
Stores custom vocabulary words for improved transcription accuracy.
CREATE TABLE custom_dictionary (
id INTEGER PRIMARY KEY AUTOINCREMENT,
word TEXT NOT NULL UNIQUE ,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
notes
Stores notes with optional AI enhancement.
CREATE TABLE notes (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title TEXT NOT NULL DEFAULT 'Untitled Note' ,
content TEXT NOT NULL DEFAULT '' ,
note_type TEXT NOT NULL DEFAULT 'personal' ,
source_file TEXT ,
audio_duration_seconds REAL ,
enhanced_content TEXT ,
enhancement_prompt TEXT ,
enhanced_at_content_hash TEXT ,
folder_id INTEGER REFERENCES folders(id),
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
folders
Stores note organization folders.
CREATE TABLE folders (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL UNIQUE ,
is_default INTEGER NOT NULL DEFAULT 0 ,
sort_order INTEGER NOT NULL DEFAULT 0 ,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
Transcription History
window.electronAPI.saveTranscription()
Save a transcription to the database.
The transcribed text to save
Whether the transcription was saved successfully
The ID of the newly created transcription record
The full transcription record (id, text, timestamp, created_at)
Example
const result = await window . electronAPI . saveTranscription ( "Hello world" );
if ( result . success ) {
console . log ( "Saved transcription ID:" , result . id );
console . log ( "Timestamp:" , result . transcription . timestamp );
}
window.electronAPI.getTranscriptions()
Retrieve transcription history.
Maximum number of transcriptions to retrieve
Array of transcription objects, ordered by most recent first
Example
const history = await window . electronAPI . getTranscriptions ( 100 );
history . forEach ( t => {
console . log ( `[ ${ t . timestamp } ] ${ t . text } ` );
});
window.electronAPI.deleteTranscription()
Delete a specific transcription.
The ID of the transcription to delete
Whether the transcription was deleted successfully
The ID of the deleted transcription
await window . electronAPI . deleteTranscription ( 123 );
window.electronAPI.clearTranscriptions()
Delete all transcriptions.
Whether all transcriptions were cleared
Number of transcriptions deleted
const result = await window . electronAPI . clearTranscriptions ();
console . log ( `Deleted ${ result . cleared } transcriptions` );
Custom Dictionary
window.electronAPI.getDictionary()
Get all custom dictionary words.
Array of custom vocabulary words (strings)
const words = await window . electronAPI . getDictionary ();
console . log ( "Custom words:" , words );
// ["OpenWhispr", "API", "IPC", "Parakeet"]
window.electronAPI.setDictionary()
Replace the entire custom dictionary.
Array of words to save (strings)
Whether the dictionary was updated successfully
Example
Replace Dictionary
Add to Existing Dictionary
const customWords = [ "OpenWhispr" , "Anthropic" , "Claude" , "GPT-5" ];
const result = await window . electronAPI . setDictionary ( customWords );
if ( result . success ) {
console . log ( "Dictionary updated" );
}
Custom dictionary words are passed as the initialPrompt parameter to Whisper, improving recognition of uncommon words, names, and technical terms.
window.electronAPI.undoLearnedCorrections()
Remove auto-learned corrections from the dictionary.
Array of words to remove (strings)
Whether the words were removed successfully
// Remove auto-learned words
await window . electronAPI . undoLearnedCorrections ([ "misheardword" ]);
Notes
window.electronAPI.saveNote()
Create a new note.
Note content (Markdown supported)
Note type: "personal", "meeting", "transcription"
Path to source audio file (if transcribed from file)
Duration of audio in seconds
ID of the folder to save the note in
Whether the note was saved successfully
Example
const result = await window . electronAPI . saveNote (
"Meeting Notes" ,
"Discussed Q1 roadmap and feature priorities." ,
"meeting" ,
null ,
null ,
2 // folder ID
);
if ( result . success ) {
console . log ( "Note ID:" , result . note . id );
}
window.electronAPI.getNote()
Get a specific note by ID.
Note object, or null if not found
const note = await window . electronAPI . getNote ( 5 );
if ( note ) {
console . log ( "Title:" , note . title );
console . log ( "Content:" , note . content );
}
window.electronAPI.getNotes()
Get notes filtered by type and/or folder.
Filter by note type (optional)
Maximum number of notes to retrieve
Filter by folder ID (optional)
Array of note objects, ordered by most recently updated
Example
// Get all notes in folder 2
const folderNotes = await window . electronAPI . getNotes ( null , 100 , 2 );
// Get meeting notes only
const meetingNotes = await window . electronAPI . getNotes ( "meeting" , 50 );
// Get all notes
const allNotes = await window . electronAPI . getNotes ( null , 100 );
window.electronAPI.updateNote()
Update an existing note.
AI-enhanced version of content
Prompt used for AI enhancement
Move to a different folder
Whether the note was updated successfully
Example
const result = await window . electronAPI . updateNote ( 5 , {
title: "Updated Meeting Notes" ,
content: "Revised content..." ,
folder_id: 3
});
if ( result . success ) {
console . log ( "Note updated:" , result . note . updated_at );
}
window.electronAPI.deleteNote()
Delete a note.
Whether the note was deleted successfully
await window . electronAPI . deleteNote ( 5 );
window.electronAPI.exportNote()
Export a note to a file.
Export format: "md" (Markdown) or "txt" (plain text)
Whether the note was exported successfully
const result = await window . electronAPI . exportNote ( 5 , "md" );
if ( result . success ) {
console . log ( "Note exported" );
}
Folders
window.electronAPI.getFolders()
Get all folders.
Array of folder objects, ordered by sort_order
const folders = await window . electronAPI . getFolders ();
folders . forEach ( f => {
console . log ( ` ${ f . name } ( ${ f . is_default ? 'default' : 'custom' } )` );
});
window.electronAPI.createFolder()
Create a new folder.
Folder name (must be unique)
Whether the folder was created successfully
The newly created folder record
Error message if failed (e.g., “A folder with that name already exists”)
const result = await window . electronAPI . createFolder ( "Projects" );
if ( result . success ) {
console . log ( "Folder ID:" , result . folder . id );
}
window.electronAPI.deleteFolder()
Delete a folder (notes are moved to the default “Personal” folder).
Whether the folder was deleted successfully
Error message if failed (e.g., “Cannot delete default folders”)
await window . electronAPI . deleteFolder ( 3 );
window.electronAPI.renameFolder()
Rename a folder.
New folder name (must be unique)
Whether the folder was renamed successfully
The updated folder record
const result = await window . electronAPI . renameFolder ( 3 , "Work Projects" );
if ( result . success ) {
console . log ( "Folder renamed:" , result . folder . name );
}
window.electronAPI.getFolderNoteCounts()
Get note counts for each folder.
Array of objects with folder_id and count properties
const counts = await window . electronAPI . getFolderNoteCounts ();
counts . forEach ( c => {
console . log ( `Folder ${ c . folder_id } : ${ c . count } notes` );
});
Real-Time Events
Listen for database changes in real-time:
window.electronAPI.onTranscriptionAdded()
const cleanup = window . electronAPI . onTranscriptionAdded (( transcription ) => {
console . log ( "New transcription:" , transcription );
// Update UI
});
// Clean up when component unmounts
cleanup ();
window.electronAPI.onTranscriptionDeleted()
window . electronAPI . onTranscriptionDeleted (({ id }) => {
console . log ( "Transcription deleted:" , id );
});
window.electronAPI.onTranscriptionsCleared()
window . electronAPI . onTranscriptionsCleared (({ cleared }) => {
console . log ( ` ${ cleared } transcriptions cleared` );
});
window.electronAPI.onNoteAdded()
window . electronAPI . onNoteAdded (( note ) => {
console . log ( "New note:" , note . title );
});
window.electronAPI.onNoteUpdated()
window . electronAPI . onNoteUpdated (( note ) => {
console . log ( "Note updated:" , note . id );
});
window.electronAPI.onNoteDeleted()
window . electronAPI . onNoteDeleted (({ id }) => {
console . log ( "Note deleted:" , id );
});
window.electronAPI.onDictionaryUpdated()
window . electronAPI . onDictionaryUpdated (( words ) => {
console . log ( "Dictionary updated:" , words );
});