GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - d-oit/do-knowledge-studio: Local-first knowledge studio — rich notes, knowledge graph, mind maps, client-side search & AI harness

BranchesTags
Open more actions menu

Latest commit

 

History

1,237 Commits
1,237 Commits

Folders and files

NameName
Last commit message
Last commit date
.agents
.agents
 
 
.claude
.claude
 
 
.codacy
.codacy
 
 
.cursor
.cursor
 
 
.devcontainer
.devcontainer
 
 
.gemini
.gemini
 
 
.githooks
.githooks
 
 
.github
.github
 
 
.opencode
.opencode
 
 
.qwen
.qwen
 
 
.windsurf
.windsurf
 
 
agents-docs
agents-docs
 
 
docs
docs
 
 
e2e
e2e
 
 
packages
packages
 
 
plans
plans
 
 
public
public
 
 
scripts
scripts
 
 
src
src
 
 
tests
tests
 
 
.codacy.yml
.codacy.yml
 
 
.deepsource.toml
.deepsource.toml
 
 
.env.example
.env.example
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.gitleaks.toml
.gitleaks.toml
 
 
.ignore
.ignore
 
 
.nvmrc
.nvmrc
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
.trivyignore
.trivyignore
 
 
.yamllint.yml
.yamllint.yml
 
 
AGENTS.md
AGENTS.md
 
 
CLAUDE.md
CLAUDE.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
DESIGN-SYSTEM.md
DESIGN-SYSTEM.md
 
 
DESIGN.md
DESIGN.md
 
 
GEMINI.md
GEMINI.md
 
 
LICENSE
LICENSE
 
 
NOTICE
NOTICE
 
 
PRODUCT.md
PRODUCT.md
 
 
QWEN.md
QWEN.md
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
VERSION
VERSION
 
 
biome.json
biome.json
 
 
commitlint.config.cjs
commitlint.config.cjs
 
 
components.json
components.json
 
 
do-harness.toml
do-harness.toml
 
 
eslint.config.mjs
eslint.config.mjs
 
 
markdownlint.toml
markdownlint.toml
 
 
next.config.ts
next.config.ts
 
 
package.json
package.json
 
 
playwright.config.ts
playwright.config.ts
 
 
pnpm-lock.yaml
pnpm-lock.yaml
 
 
pnpm-workspace.yaml
pnpm-workspace.yaml
 
 
postcss.config.mjs
postcss.config.mjs
 
 
render.yaml
render.yaml
 
 
skills-lock.json
skills-lock.json
 
 
stryker.config.json
stryker.config.json
 
 
tsconfig.app.json
tsconfig.app.json
 
 
tsconfig.base.json
tsconfig.base.json
 
 
tsconfig.build.json
tsconfig.build.json
 
 
tsconfig.e2e.json
tsconfig.e2e.json
 
 
tsconfig.json
tsconfig.json
 
 
tsconfig.test.json
tsconfig.test.json
 
 
vercel.json
vercel.json
 
 
vitest.bench.config.ts
vitest.bench.config.ts
 
 
vitest.config.ts
vitest.config.ts
 
 

Repository files navigation

DO Knowledge Studio

A local-first knowledge studio for rich notes, knowledge graphs, mind maps, client-side semantic search, TRIZ inventive problem-solving, and AI-assisted synthesis — all inside your browser with zero server backend required.

The visual language follows Editorial Paper & Saffron: warm paper backgrounds, crisp ink typography, and a purposeful saffron accent. See DESIGN.md for the complete design token reference.

Knowledge Studio library and graph (wide)

Knowledge Studio on mobile (narrow)

Screenshots are generated by scripts/generate-readme-screenshots.mjs (Playwright, light/dark + desktop/mobile) so they do not go stale; see plans/206-onboarding-1064-2026-11-08.md.

Why local-first

Your notes stay in this browser (IndexedDB + a small localStorage envelope). No account, no server. Only opt-in flows leave the device: AI providers, web research, sync signaling and model downloads. Privacy details: ADR 045. Live demo: https://do-knowledge-studio.vercel.app


Key Capabilities

  • Local-First & Private: The canonical corpus (notes, entities, claims, graph, mind map, links and tags) persists in browser IndexedDB through Zustand. A small localStorage envelope carries schema metadata, recovery snapshots and quarantine copies; Yjs keeps a separate collaboration replica in IndexedDB. No remote backend or database setup needed.
  • Peer-to-Peer Multi-Device Sync (opt-in): Decentralized WebRTC synchronization powered by Yjs CRDTs, with QR-code room pairing, live presence and remote cursors. Joining a room is the only way library data reaches another peer.
  • Client-Side Search Engine: Browser-local BM25 keyword search and embedding-based semantic retrieval. Lexical search uses a Web Worker when available, with an in-browser fallback. Semantic indexing is incremental and cached by model, preprocessing and corpus fingerprints.
  • Knowledge Graph & Mind Map: Interactive SVG graph visualization with Force, Circular, and Hierarchical layouts, alongside expandable mind map tree navigation with depth filtering.
  • TRIZ Contradiction Matrix: Full interactive Altshuller 39×39 contradiction matrix with 40 inventive principles to systematically resolve engineering trade-offs without compromise.
  • Universal Export & Verified Backups: Export agent-readable Open Knowledge Format (OKF v0.2) ZIP bundles, password-encrypted standalone HTML readers, Markdown, JSON, HTML, DOCX, PDF, and a portable .dksb backup with SHA-256 checksums, optional AES-256-GCM passphrase encryption and previewed restore.
  • AI Assistant Harness (opt-in remote): Connect to OpenRouter, local Ollama instances, optional in-browser models, or enable web research for grounded citations and client-side tool-calling. Browser models download weights on first use; later inference can run offline while the browser retains those cached assets. OpenRouter and web research send prompts off-device.
  • Accessible & Responsive: Semantic, keyboard-accessible controls, the ? shortcuts palette, mobile drawer layout, and support for prefers-reduced-motion.

Tech Stack

Layer Technologies
Framework & UI Next.js 16 (App Router), React 19, Tailwind CSS 4 (@theme inline), shadcn/ui (Radix UI + CVA)
State & Storage Zustand with a canonical IndexedDB corpus, a small localStorage metadata/recovery envelope, and IndexedDB persistence for the Yjs sync replica; Zod schema boundaries
Sync & CRDT Yjs, WebRTC peer channels, tombstone tracking, three-way merge resolution
Search & Retrieval BM25 keyword search in a Web Worker and in-browser embedding-based semantic retrieval
Animations & Icons Framer Motion, Lucide React, Sonner toasts
Typography & Theme Newsreader (serif headings), Geist Sans (body), Geist Mono (code), next-themes (Light/Dark)
Testing & Quality Vitest (unit/integration), Playwright E2E, ESLint 10

The 12 Studio Views

View Description
Home Overview dashboard with entity metrics, recent activity timeline, and entity-type distribution badges.
Editor Rich markdown note and claim editor with floating formatting toolbar, tag selector, metadata editor, and link autocomplete.
Library Grid and list browser with real-time full-text search, type filtering, tag chips, and multiple sorting dimensions.
Graph Interactive knowledge graph supporting Force-directed, Circular, and Hierarchical layout algorithms with focus neighborhood mode.
Mind Map Hierarchical knowledge exploration with expandable root branches, depth slider controls, and subtree zooming.
Timeline Chronological view of entities and claims, grouped by month and day; selecting an item opens its entity in the editor.
Chat Local search chat assistant that answers queries with verifiable, clickable citations linked directly to your entities.
AI Harness Multi-provider playground with OpenRouter routers, Ollama, in-browser models, and client-side tool calls.
TRIZ Matrix 2-step inventive contradiction solver mapping 39 improving vs. 39 worsening engineering parameters to 40 Altshuller principles.
Export Backup and sharing suite: verified .dksb backups, OKF v0.2 ZIP bundles, password-encrypted HTML readers, Markdown, JSON, HTML, DOCX, and PDF.
Sync Peer-to-peer WebRTC rooms with QR pairing, presence, and conflict resolution.
Settings What the derived stores cost — semantic index documents, memory and budget, model cache files and bytes — with rebuild and clear actions.

Architecture: Skills → CLI → Shared Core

The canonical architecture document is plans/ARCHITECTURE.md; this section links to it instead of restating it. One layering rule ties the surfaces together:

Agent Skills (.agents/skills/, portable in OKF bundles)
             │  discover / invoke
             ▼
      dks CLI (packages/dks-cli)          dks-mcp (optional MCP adapter)
             │                                        │
             ▼                                        ▼
        dks-core (packages/dks-core) ── shared TypeScript domain core
  • Agent Skills are the primary reusable workflow/distribution layer.
  • The dks CLI is the primary executable interface for search, graph, import/export, validation, and automation.
  • dks-core is the single shared implementation of business logic, reused by the web app and the CLI.
  • MCP is optional interoperability — the adapter for MCP clients, never a required path.

Agent Skills

Skills package reusable agent workflows. Installation, discovery, and authoring conventions:

  • Repository skills live in .agents/skills/ — the canonical source. After cloning, run ./scripts/setup-skills.sh once to create the per-tool symlinks (Claude Code, Gemini CLI, Qwen Code, Cursor, Windsurf, OpenCode) and ./scripts/validate-skills.sh to verify them.
  • Discovery: the catalog is auto-generated at agents-docs/AVAILABLE_SKILLS.md; regenerate with ./scripts/generate-skills-docs.py after adding a skill.
  • Authoring: create .agents/skills/<skill-name>/SKILL.md with name and description frontmatter (name must equal the directory name, description is a single line within 300 characters) plus optional reference files beside it. Walkthrough: .agents/skills/README.md.
  • Portable skills in exports: an OKF bundle can carry an .agents/skills/ tree; dks skills list, dks skills validate [name] and dks skills test discover and validate them.

dks CLI

dks (packages/dks-cli) is a standalone, read-only operator CLI over an exported OKF v0.2 bundle: BM25 search, entity/claim/alias/relation inspection, graph neighborhoods and paths, bundle diagnostics, .dksb backup verification, and skills validation. It needs no server, browser, or network, which makes it suitable for agents, shell scripts, and CI.

pnpm install
pnpm --filter dks-cli build
node packages/dks-cli/dist/bin.js help
node packages/dks-cli/dist/bin.js doctor
node packages/dks-cli/dist/bin.js search "contradiction matrix"

Every command prints one envelope; --format json emits { ok, data | error, meta } to stdout with diagnostics on stderr, so pipelines can consume stdout directly. The full command table, flag reference, and exit codes: packages/dks-cli/README.md.


MCP Server (optional)

dks-mcp exposes the same exported OKF bundle to MCP clients (Claude Code, Cursor, Claude Desktop) over stdio — offline and read-only. MCP is an optional interoperability adapter, not a required path; prefer the dks CLI unless your client is MCP-only. Setup, tool list, and trust notes: packages/dks-mcp/README.md; decision record: ADR 050.


Getting Started

Prerequisites

  • Node.js: $\ge 22$ (pinned by .nvmrc and permitted by package.json engines)
  • pnpm: 12.17.0 (pinned by package.json packageManager)

Installation & Development

# Clone the repository
git clone https://github.com/d-oit/do-knowledge-studio.git
cd do-knowledge-studio

# Install dependencies and git hooks
pnpm install

# Start the local development server
pnpm run dev

The application is served at http://localhost:3000.

Available Scripts

pnpm run dev          # Start Next.js development server with hot reloading
pnpm run build        # Build the production bundle and regenerate the offline precache manifest
pnpm run start        # Start Next.js production server
pnpm run lint         # Run ESLint across all source files (zero-warning policy)
pnpm run typecheck    # Run TypeScript compiler type-checking without emitting
pnpm run test         # Run Vitest test suite with type-checking and assertions
pnpm run test:coverage # Run tests with v8 code coverage reporting
pnpm run test:e2e     # Run Playwright end-to-end browser tests
pnpm run test:e2e:offline # Run after `pnpm run build`; first-use offline view tests (Chromium)
pnpm run docs:check   # Verify public docs against source (scripts, views, storage, exports)
./scripts/minimal_quality_gate.sh # Fast-path local validation suite
./scripts/quality_gate.sh         # Complete pre-commit quality gate

Repository Structure

.
├── src/
│   ├── app/                 # Next.js App Router (layout, page shell, globals.css tokens)
│   ├── components/
│   │   ├── studio/          # Studio shell, topbar, sidebar, right panel, dialogs
│   │   │   ├── views/       # The 12 view implementations and view-specific handlers
│   │   │   └── ui/          # Shared studio UI primitives
│   │   └── ui/              # shadcn/ui accessible components (Radix primitives)
│   ├── hooks/               # Reusable React hooks (reduced motion, speech, keyboard)
│   ├── lib/
│   │   ├── ai/              # OpenRouter, Ollama, and in-browser model adapters, tools, and context
│   │   ├── export/          # Password-encrypted HTML export helpers
│   │   ├── okf/             # Open Knowledge Format bundle serialization and import
│   │   ├── search/          # Client BM25 retrieval engine & Web Worker client
│   │   ├── studio/          # Zustand store, schema, hydration, migrations, local recovery helpers
│   │   └── sync/            # WebRTC sync bridge, Yjs CRDT documents, presence, conflict logic
│   └── test/                # Test utilities, fixtures, and builder helpers
├── plans/                   # GOAP plans, research, task decomposition, and architecture decision records (ADRs)
├── packages/
│   ├── dks-core/            # Shared TypeScript domain core (single business-logic implementation)
│   ├── dks-cli/             # Standalone read-only `dks` operator CLI
│   └── dks-mcp/             # Optional MCP adapter over an exported OKF bundle
├── docs/                    # User-facing guides (self-hosting, cache inventory, bookmarklet)
├── scripts/                 # Reusable validation, quality gates, and automated repair scripts
├── agents-docs/             # Multi-agent coordination guides, rules, and hook documentation
└── public/                  # Static assets and PWA service worker manifest

AI Harness & OpenRouter Routers

The AI Harness integrates with OpenRouter for seamless access to top-tier LLMs, as well as first-class support for OpenRouter's smart Routers:

Router Purpose & Best Use Case
Auto Router (openrouter/auto) Automatically chooses the optimal model based on prompt complexity and length.
Free Models Router (openrouter/free) Routes exclusively to available free models for zero-cost experimentation.
Fusion Router (openrouter/fusion) Multi-model deliberation panel that synthesizes responses for complex research.
Pareto Router (openrouter/pareto) Balances speed, cost, and benchmark performance for fast agentic execution.
Latest Model Resolution (openrouter/flavor-latest) Dynamically resolves to the newest available model in a specific model family.

Local-First Philosophy & Design Rules

  1. Zero Required Backend: The canonical corpus uses browser-local Zustand + IndexedDB; metadata, recovery snapshots and quarantine copies stay in localStorage; Yjs persists a separate replica in IndexedDB. Nothing requires a database or server.
  2. Strict Quality Gates: Zero warnings tolerated in quality gates (pnpm run lint, typecheck, test, build).
  3. Max 500 LOC per File: Source files remain modular, composable, and single-responsibility.
  4. Privacy & Security: Cryptographic operations use WebCrypto (crypto.subtle, crypto.randomUUID()). No app backend receives library data. Joining a P2P room sends the library to connected peers; OpenRouter and web research send prompts off-device; local Ollama and in-browser models do not. Matching local snippets are included only when local-context augmentation is enabled.

Data Lifecycle, Backup & Trust Boundaries

Canonical storage. The live corpus is a validated Zustand envelope in IndexedDB (dks-canonical). A small metadata envelope in localStorage records the schema version and record counts; the legacy localStorage corpus is migrated atomically and is removed only after an IndexedDB read-back verification. A refused or unreadable corpus blocks writes for the page session and is preserved for download rather than replaced by demo data.

What can remove data. Browser storage is not a backup. Private browsing, "clear site data", storage pressure, and OS/browser eviction can remove IndexedDB and localStorage without warning. The app has no server copy and cannot recover evicted data. Import recovery snapshots expire after 24 hours and are bounded by localStorage quota; they are a one-step undo for imports, not a durable backup.

Backups. Export → Verifiable backup downloads a single .dksb archive with a versioned manifest, SHA-256 checksums for every payload file, and optional AES-256-GCM encryption (PBKDF2-HMAC-SHA256, 310,000 iterations). Restore verifies the format/schema version, ciphertext hash, payload hashes and references before a preview; nothing is written until you choose replace or merge. Checksums detect corruption; they are not a signature, so store an encrypted backup or an external copy of its hash if you need to detect deliberate tampering. An encrypted backup cannot be recovered without its passphrase.

Peer-sharing trust. Room passwords encrypt y-webrtc signaling payloads and BroadcastChannel messages; WebRTC data channels are additionally protected by DTLS. The signaling service still sees the room name, connection timing, message sizes and IP addresses. A password is a shared room secret, not peer identity: anyone with the room ID and password can join and edit. QR codes contain only the room ID. Rotate access by leaving the room and creating a new random room ID. See plans/ADRs/045-sync-threat-model.md.


License

MIT License. See LICENSE and NOTICE for details.

About

Local-first knowledge studio — rich notes, knowledge graph, mind maps, client-side search & AI harness

do-knowledge-studio.vercel.app

Topics

knowledge-graphknowledge-management

Resources

Readme
MIT license

Contributing

Contributing

Security policy

Security policy
Activity

Stars

5 stars

Watchers

0 watching

Forks

2 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.