Browso documentation

Backend

Overview

The Browso desktop process is the backend. All privileged operations are implemented there and reached through validated IPC.

IPC Contract

EventManager owns channel registration. Request schemas live in ipcSchemas.ts; unvalidated renderer input must not be passed to services.

Context

ChannelResult
browser-context-currentCurrent title, URL, selection, readable text, tab ID, timestamp
browser-context-tabsReadable context for every accessible open tab

Current-page text is capped at 50,000 characters. Multi-tab text is capped at 12,000 characters per tab at the service boundary and reduced again when added to prompts.

Modes

ChannelResult
agent-modes-listPublic mode definitions
ai-settings-updatePersists activeAgentMode and other AI settings

The mode registry is authoritative. Renderers should not hard-code mode instructions or tool permissions.

Knowledge

ChannelInputResult
knowledge-listnoneSaved pages, newest first
knowledge-save-currentoptional noteSaved or updated page
knowledge-searchquery and optional limitRanked pages with excerpts
knowledge-deletepage IDUpdated page list

Saved pages are stored in knowledge-store.json under Browso application data. Saving the same URL updates the existing record instead of duplicating it.

Chat And Automation

ChannelPurpose
sidebar-chat-messageStart a chat, local command, or routed browser task
computer-use-startStart a constrained browser automation session
computer-use-get-stateRead current and recent session state

Context Construction

The model prompt is assembled from independent sources:

  1. active mode policy
  2. current page title, URL, selection, and text
  3. open-tab context when research mode or a tab comparison is requested
  4. locally retrieved saved pages
  5. enabled user memory
  6. compacted conversation history

Webpage content is explicitly labeled untrusted. A page cannot grant itself tools or replace system instructions.

Persistence

All local data is written atomically at the service level as JSON under Browso's application data directory.

FileData
ai-settings.jsonprovider, model, browser defaults, active mode
memory-store.jsonuser preferences and instructions
knowledge-store.jsonexplicitly saved pages and notes

The current implementation is intentionally local and single-user. SQLite is a reasonable next storage backend when migrations, larger datasets, or concurrent writers are required.

Retrieval

Knowledge search is deterministic local ranking:

  • title matches: weight 8
  • note matches: weight 6
  • URL matches: weight 3
  • body matches: weight 1, capped per term

This works without a model or network connection. It is not semantic vector search. An embedding implementation should preserve the same result shape and retain a lexical fallback.

Error Handling

  • IPC input errors are rejected by Zod.
  • Page extraction failures return no context and are logged without page text.
  • Model errors are mapped to user-facing authentication, rate-limit, network, timeout, or generic failures.
  • Sensitive IPC channels do not write message or page content to logs.

Backend Rules

  1. Privileged logic belongs in the main process, not a renderer.
  2. Every renderer input is validated.
  3. Services return serializable data.
  4. Page content is untrusted and size-limited.
  5. Secrets are read only in the main process.
  6. Persistent stores remain separate by purpose.
  7. Consequential automation passes through safety policy before execution.
Edit this page on GitHub