Skip to content

onetimesecret/ots3

Repository files navigation

Personal Knowledge Graph

A Personal Knowledge Graph that lives entirely offline, lets you dump in raw notes, web clippings and PDFs, and—via local NLP—turns the mess into a queryable, visual graph you actually own.

Features

  • Offline-First: All data stays on your machine. Zero cloud dependencies.
  • Local NLP: Sentence transformers and NER running via ONNX—no API keys required.
  • Visual Graph: D3-force layout renders 5k+ nodes at 30+ fps with smooth zoom/pan.
  • Full-Text Search: Tantivy-powered sub-50ms search across 100k notes.
  • Multi-Format Import: Markdown, HTML, PDF, plain text.
  • Web Clipper: Browser extension companion posts to localhost endpoint.
  • Export Ready: GEXF (Gephi) and DOT (Graphviz) formats supported.
  • Privacy-First: No telemetry, no tracking, optional crash reports to self-hosted Sentry.

Stack

  • Frontend: SvelteKit + TypeScript + D3-force
  • Backend: Tauri + Rust
  • Storage: SQLite + Tantivy full-text index
  • NLP: ONNX Runtime (sentence-transformers, NER)
  • Targets: Windows 10+, macOS 12+, Linux (AppImage)

Quick Start

Prerequisites

  • Rust 1.80+
  • Node 22+
  • pnpm 9+

Installation

# Clone the repository
git clone https://github.com/yourid/personal-knowledge-graph.git
cd personal-knowledge-graph

# Install dependencies
pnpm install
cargo fetch

# Run in development mode
pnpm tauri dev

# Build for production
pnpm tauri build

Build Commands

# Frontend development server
pnpm dev

# Type checking
pnpm check

# Linting
pnpm lint

# Format code
pnpm format

# Unit tests
pnpm test:unit

# Build release bundles
pnpm tauri build

Architecture

src/
├── lib/
│   ├── db/               # SQLite + graph schema
│   ├── nlp/              # ONNX pipeline, entity linker
│   ├── search/           # Tantivy full-text index
│   └── graph/            # Graphology wrapper, D3-force layout
├── routes/               # SvelteKit file-system routing
├── components/           # Reusable Svelte components
└── stores/               # Svelte stores for global state

src-tauri/
├── src/
│   ├── main.rs           # Tauri bootstrap
│   ├── db.rs             # Database operations
│   ├── search.rs         # Full-text search
│   ├── nlp.rs            # NLP pipeline (ONNX)
│   ├── commands.rs       # Tauri commands
│   ├── menu.rs           # Native menu & shortcuts
│   └── clipper.rs        # Web clipper server
└── Cargo.toml

Usage

Creating Notes

  • Press Ctrl+K (or Cmd+K on macOS) to open the command palette
  • Select "New Note" or click the + button in the sidebar
  • Enter a title and content
  • Press "Save" to add the note to your knowledge graph

Importing Files

  • Use Ctrl+K → "Import File"
  • Select Markdown, HTML, PDF, or plain text files
  • Files are automatically processed and added to the graph

Searching

  • Type in the search box in the sidebar
  • Full-text search powered by Tantivy
  • Vector similarity search fallback

Graph Visualization

  • Pan: Click and drag on the canvas
  • Zoom: Use mouse wheel
  • Select Node: Click on any node to view details
  • Node colors represent entity types (person, place, concept)

Web Clipper

The application runs a local server on localhost:11416 for the web clipper extension.

POST to http://localhost:11416/clip with:

{
  "url": "https://example.com",
  "title": "Page Title",
  "content": "Page content",
  "html": "<optional html>"
}

Export

  • Ctrl+K → "Export as GEXF" for Gephi
  • Ctrl+K → "Export as DOT" for Graphviz

Security & Privacy

  • Zero telemetry by default
  • Local-only processing: All NLP runs on your machine
  • Encrypted storage: Supports encrypted APFS/BitLocker folders
  • No network calls except localhost web clipper
  • Signed updates via minisign

Contributing

See CONTRIBUTING.md for development guidelines.

Security

For security issues, see SECURITY.md.

License

MIT License - see LICENSE

Roadmap

  • ONNX model integration (sentence-transformers)
  • Named Entity Recognition (NER)
  • Coreference resolution
  • Plugin system
  • Collaborative LAN sync
  • Mobile companion app
  • Browser extension (Chrome, Firefox)
  • Advanced graph algorithms (PageRank, community detection)
  • Time-travel queries
  • Vault encryption

Acknowledgments

Built with:

About

No description, website, or topics provided.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Contributors 2

  •  
  •