The Problem

Researchers and professionals need a secure, local-first way to query their documents with AI assistance. Current solutions either require cloud services (posing privacy risks) or complex self-hosted setups (demanding technical overhead). There's a gap for a lightweight, standalone application that provides retrieval-augmented generation (RAG) without compromising privacy or requiring extensive configuration.

What This Does

KnowNote is a desktop application built with Electron and React that enables local document retrieval and question answering. It processes PDFs, Word documents, PowerPoints, and webpages, embedding their content locally for private, traceable RAG interactions.

Key components:

  • Vector Database: SQLite-based storage in src/main/vectorstore/ for document passages and embeddings
  • Embedding Engine: Local model support in src/main/embedding/ with download handling
  • Document Processing: File parsing and chunking in src/main/services/
  • User Interface: Three-column layout implemented in src/renderer/src/App.tsx

The application emphasizes transparency by showing answer sources and avoids cloud dependencies by running all processing locally.

How It Is Wired

Execution begins at src/main/index.ts, the Electron main process entry point. Key control flows:

  1. Application Startup: - Window creation in src/main/windows/mainWindow.ts - Database initialization via src/main/db/index.ts - IPC channel setup in src/main/ipc/index.ts
  1. Document Processing Pipeline: - File parsing handled by loaders in src/main/services/loaders/ - Text chunking in src/main/services/ChunkingService.ts - Embedding via src/main/embedding/
  1. RAG Retrieval: - Vector search through src/main/services/retrieval/ - Answer generation via model protocols in src/main/models/protocols/

Critical hubs:

  • src/main/ipc/ (270+ invocations): Centralizes all frontend-backend communication
  • src/main/services/ (150+ invocations): Core processing logic

The architecture maintains clear separation between:

  • Main process (Electron backend)
  • Renderer process (React frontend)
  • Persistent storage (SQLite database)

How To Use It

Setup:

git clone https://github.com/moses-y/KnowNote.git
cd KnowNote
npm install

Configuration:

  • Required: src/main/config/settingsManager.ts for database paths
  • Optional: Model configuration in src/main/config/defaults.ts

Running:

npm run dev

Key Operations:

  1. Import documents via file dialog (handled by src/main/ipc/dialogHandlers.ts)
  2. Query documents through the UI (processed by src/main/ipc/knowledgeHandlers.ts)
  3. View results with source tracing in src/renderer/src/App.tsx

Real-World Use

A researcher could:

  1. Import academic papers as PDFs
  2. Query "What are the key findings about X?"
  3. Receive answers with direct references to specific pages/paragraphs
  4. Export findings as structured notes

Example document processing flow:

// src/main/services/FileParserService.ts
async function parseFile(filePath) {
  const loader = new PdfLoader(filePath);
  const text = await loader.load();
  return ChunkingService.chunkText(text);
}

Code Health & Issues

  • Testing: 41 test files present
  • Documentation: 11 doc files including architecture and design decisions
  • Configuration: Proper .gitignore and .prettierrc.yaml present

Measured analysis found no major structural issues. The project maintains good practices with:

  • TypeScript typing throughout
  • Clear separation of concerns
  • Comprehensive test coverage
  • Open source licensing (MIT)

The Bottom Line

KnowNote provides a solid local-first RAG solution for document analysis. It's well-architected with clear separation of components and comprehensive documentation. The Electron implementation ensures cross-platform compatibility while maintaining privacy. The project is actively developed with good testing practices. It's particularly suitable for researchers or professionals needing secure document analysis without cloud dependencies.