Your personal desktop app for notes & documents.
Write notes, read PDFs, annotate, link, and organize — fully offline, all in one place.
Knowledge Base is a lightweight, offline-first desktop application for personal knowledge management. Write and format notes in Markdown, read and annotate PDFs, organize everything in a nested folder hierarchy, connect notes with bidirectional wiki-links, and filter your knowledge base instantly by tags.
Fully offline. All data is stored locally in a SQLite database (knowledge-base.db) in your app data directory — no cloud, no tracking, full control.
Write notes in plain Markdown with a live preview mode. The editor supports:
[[ to link to another note, [[pdf: to reference a PDFUpload PDF files and read them directly in the app:
Organize your notes in a hierarchical folder structure:
Add one or more tags to any note:
| Feature | Description |
|---|---|
| Autocomplete | Suggestions from existing tags as you type |
| Tag Filter | Click any tag to filter the note list instantly |
| Combined Filter | Tag filter and folder filter work together |
| Cleanup | Orphaned tags (no associated notes) are removed automatically |
Connect notes using [[note-title]] or [[id:123]] syntax:
Two types of annotations are supported, both stored in SQLite:
| Type | How it works |
|---|---|
| Note annotations | Select text in a note → pick a color → optionally add a comment |
| PDF annotations | Select a region on a PDF page → pick a color → optionally add a comment |
All annotations can be edited or deleted from the annotation sidebar.
Full-text search across note titles and content. Results update as you type.
Toggle between themes with a single button. Your preference is persisted in localStorage and synced to the native title bar.
Ctrl + 3 toggles the app window — no matter which window currently has focus.
+---------------------+ +---------------------------+
| NoteList | | Main Area |
| (Sidebar) | | |
| | | +---------------------+ |
| Search |--->| | NoteEditor | |
| Folder Tree | | | | |
| Tag Filter | | | Markdown + Preview | |
| PDF List | | | Highlights | |
| Pin / Bulk Delete | | | Wiki-Links | |
| |--->| +---------------------+ |
| | | | PdfViewer | |
| | | | | |
| | | | Pages + Annotations | |
+---------------------+ +---------------------------+
[[wiki-links]].All data is stored in a local SQLite database (sqlite:knowledge-base.db).
| Table | Content |
|---|---|
notes |
Title, content (Markdown), pinned flag, folder_id, created/updated timestamps |
tags |
Unique tag names |
note_tags |
Note ↔ Tag junction (many-to-many) |
folders |
Folder names and hierarchy via parent_id |
note_links |
Bidirectional references between notes |
pdfs |
PDF metadata — original filename, UUID-based stored name, page count, file size |
pdf_annotations |
Region highlights on PDFs — page, color, bounding box (JSON), selected text, comment |
note_annotations |
Text highlights in notes — color, character offset, surrounding context, comment |
PDF files themselves are stored in the Tauri app data directory using UUID filenames.
+--------------------------------------------+
| Tauri Shell |
| |
| +--------------------------------------+ |
| | Svelte Frontend | |
| | | |
| | SvelteKit <--> Svelte 5 Runes | |
| | (Routing) (Reactive State) | |
| | | | | |
| | v v | |
| | Components SQLite | |
| | (UI Layer) (via plugin-sql) | |
| +--------------------------------------+ |
| ^ |
| | IPC (minimal) |
| +--------------------------------------+ |
| | Rust Backend | |
| | | |
| | Window Management | |
| | Global Shortcut (Ctrl+3) | |
| | Native Title Bar & Theme Sync | |
| | File System Access (PDF storage) | |
| +--------------------------------------+ |
+--------------------------------------------+
| Technology | Version | Role |
|---|---|---|
| Svelte | 5 | Reactive UI — components, runes-based state ($state, $derived) |
| SvelteKit | 2.9 | Meta-framework with static adapter (SPA mode, SSR disabled) |
| TypeScript | 5.6 | Type safety for interfaces, DB functions, and utilities |
| Vite | 6 | Dev server with HMR and optimized production builds |
| marked | 18 | Markdown-to-HTML rendering (GFM mode) |
| pdfjs-dist | 5.6 | PDF rendering on canvas |
| DOMPurify | 3 | HTML sanitization for rendered Markdown |
State management is handled with Svelte 5 runes directly in +page.svelte. The db.ts module (495 lines) encapsulates all SQLite operations — CRUD for notes, folders, tags, PDFs, annotations, and links — keeping components free of raw SQL.
View routing uses a simple view state variable ("notes" | "pdf") — no URL routing needed for a single-window desktop tool.
| Technology | Version | Role |
|---|---|---|
| Tauri | 2 | Desktop runtime — bundles the frontend into a native window |
| Rust | Edition 2021 | Compiled backend for window control and shortcut handling |
| tauri-plugin-sql | 2 | SQLite database access from the frontend |
| tauri-plugin-fs | 2 | File system access for PDF storage |
| tauri-plugin-global-shortcut | 2 | System-wide Ctrl+3 shortcut |
| tauri-plugin-opener | 2 | Open external links in the default browser |
The Rust backend is intentionally minimal — only handles what a pure web frontend cannot:
Ctrl+3): Registers system-wide and toggles the app windowsql, fs, opener, and global-shortcut on startupAll business logic — notes, folders, tags, PDFs, annotations, links — runs entirely in the frontend.
db.ts initializes the SQLite database and creates all tables if they don't existdb.ts mutations → SQLite persistenceknowledge-base/
├── src/ # Frontend source code
│ ├── routes/ # SvelteKit pages
│ │ ├── +page.svelte # Main app — state, layout, view routing
│ │ ├── +layout.svelte # Theme setup & DB initialization
│ │ └── +layout.ts # SPA configuration (SSR disabled)
│ ├── lib/ # Components, state & utilities
│ │ ├── db.ts # All SQLite operations (notes, folders, tags, PDFs, annotations, links)
│ │ ├── types.ts # TypeScript interfaces
│ │ ├── utils.ts # Utility functions
│ │ ├── theme.svelte.ts # Dark/light theme management (Svelte runes)
│ │ └── components/
│ │ ├── NoteEditor.svelte # Markdown editor, highlights, wiki-links, annotations
│ │ ├── NoteList.svelte # Sidebar — search, pin, bulk delete, PDF list, import/export
│ │ ├── PdfViewer.svelte # PDF rendering, page navigation, region highlights
│ │ ├── FolderTree.svelte # Hierarchical folder navigation with drag-and-drop
│ │ ├── TagInput.svelte # Add/remove tags with autocomplete
│ │ ├── TagFilter.svelte # Filter note list by tag
│ │ ├── NoteLinks.svelte # Incoming & outgoing bidirectional links panel
│ │ ├── HighlightToolbar.svelte # Context menu for highlight color selection
│ │ └── Toast.svelte # Notification system (info, success, warning)
│ ├── app.css # Global styles (light/dark themes, color palette)
│ └── app.html # HTML shell
│
├── src-tauri/ # Rust backend
│ ├── src/
│ │ ├── main.rs # Entry point
│ │ └── lib.rs # App setup (plugins, shortcut, theme sync)
│ ├── Cargo.toml # Rust dependencies
│ ├── tauri.conf.json # App configuration (window, icons, app ID)
│ ├── icons/ # App icons (PNG, ICO, ICNS)
│ └── capabilities/ # Tauri security policies
│
├── static/ # Static assets (logo, etc.)
├── package.json # Scripts & frontend dependencies
├── vite.config.js # Vite configuration
├── svelte.config.js # SvelteKit configuration
├── tsconfig.json # TypeScript configuration
└── LICENSE # MIT License
# Install dependencies
npm install
# Start frontend dev server only (http://localhost:1420)
npm run dev
# Start full desktop app in dev mode (with hot-reloading)
npm run tauri dev
# Build frontend only
npm run build
# Build complete desktop app (installer + executable)
npm run tauri build
npm run check # One-time
npm run check:watch # Continuous
MIT — see LICENSE
Built with Tauri, Svelte, and a pinch of Rust.