Skip to main content

Architecture

OpenPawz is a Tauri v2 desktop application with a Rust backend and TypeScript frontend.

System overview

Tauri Shell

TypeScript Frontend

Views · Feature Modules · IPC Bridge

↕ IPC (invoke / events)

Rust Engine

Agent Loop · Providers · Channels · Memory · Skills · Orchestrator · Sandbox

SQLite Database

sessions · messages · memories · tasks · skills · agents · projects · trades

Extensibility — Three-Tier System

Pawz has a three-tier extensibility architecture. Each tier adds more power over the previous.

Tier 3 — Extensions

Custom sidebar views · Dashboard widgets · Persistent data
pawz-skill.toml + [view] + [storage]

Tier 2 — Integrations

Credential vault · API access · CLI binaries · Widgets
pawz-skill.toml + [[credentials]] + [instructions]

Tier 1 — Skills

Prompt injection only · Zero config · SKILL.md format
skills.sh ecosystem · Agent-installable
TierFormatCapabilities
SkillSKILL.mdPrompt injection, zero config
Integrationpawz-skill.toml+ Credentials, binary detection, widgets
Extensionpawz-skill.toml + [view]/[storage]+ Custom sidebar views, persistent data

Skill loading pipeline

Agent prompt assembly

For full details: Skills · Integrations · Extensions · PawzHub

Frontend (src/)

Vanilla TypeScript with DOM manipulation — no framework. Each view is a module that renders into the main content area.

Views

ViewFilePurpose
Todayviews/today/Dashboard with quick actions
Agentsviews/agents/Create, edit, manage agents
Tasksviews/tasks/Kanban task board
Skillsviews/skills/Skill vault management
Researchviews/research/Research workflow
Orchestratorviews/orchestrator/Multi-agent projects
Memory Palaceviews/memory-palace/Memory browser/search
Mailviews/mail/Email integration
Tradingviews/trading/Trading dashboard
Automationsviews/automations/Cron task management
Settingsviews/settings-*/11 settings tabs

Feature modules (src/features/)

Atomic design pattern — each feature has atoms.ts (data/state), molecules.ts (UI components), and index.ts (exports).
ModulePurpose
agent-policiesTool allowlist/denylist per agent
browser-sandboxBrowser config and network policy
channel-routingMessage routing rules
container-sandboxDocker sandbox config
memory-intelligenceMemory search and config
prompt-injectionInjection detection patterns
session-compactionSession summarization
slash-commandsChat slash command definitions

IPC bridge (src/engine-bridge.ts)

All communication with the Rust backend goes through Tauri’s invoke() and event system. The bridge provides typed wrappers for every engine command.

Backend (src-tauri/src/engine/)

Rust async engine built on Tokio.

Core modules

ModulePurpose
agent_loop.rsMain agent conversation loop
providers.rsAI provider factory and routing
channels.rsChannel bridge message handler
memory.rsHybrid search (BM25 + vector + temporal)
skills.rsSkill catalog and credential vault
orchestrator.rsMulti-agent project execution
sandbox.rsDocker container execution
tool_executor.rsTool dispatch and execution
sessions.rsSession and message persistence
compaction.rsSession compaction/summarization
routing.rsChannel-to-agent routing
injection.rsPrompt injection detection

Channel bridges

Each channel has its own bridge module: telegram.rs · discord.rs · slack.rs · matrix.rs · irc.rs · mattermost.rs · nextcloud.rs · nostr.rs · twitch.rs · webchat.rs · whatsapp/

Provider implementations

ImplementationProviders
OpenAiProviderOpenAI, Ollama, OpenRouter, DeepSeek, Grok, Mistral, Moonshot, Custom
AnthropicProviderAnthropic
GoogleProviderGoogle Gemini

Database

Pawz uses two SQLite databases — one managed by the Rust engine, one by the TypeScript frontend.

Engine database (Rust — rusqlite)

TableContents
sessionsChat sessions per agent (id, label, model, system_prompt, agent_id, timestamps)
messagesAll messages with role, content, tool calls JSON, tool_call_id, name
engine_configKey-value configuration store for engine settings
agent_filesAgent personality files (SOUL.md, AGENTS.md, etc.) per agent
memoriesStored facts with embedding vectors, category, importance, timestamps
tasksKanban tasks with title, description, status, priority, cron schedule, model override
task_activityTask activity feed (created, assigned, status_change, agent_started, etc.)
task_agentsMulti-agent task assignments (agent_id, role: lead/collaborator)
projectsOrchestrator projects with title, goal, status, boss_agent
project_agentsProject agent assignments (role, specialty, status, current_task, model)
project_messagesInter-agent messages (delegation, progress, result, error)
trade_historyTrading records (trade, transfer, dex_swap) with amounts and status
positionsOpen trading positions with stop-loss/take-profit targets
skill_credentialsEncrypted API keys and secrets per skill
skill_stateEnabled/disabled state per skill
skill_custom_instructionsUser-edited skill instructions (overrides defaults)
community_skillsInstalled community skills from skills.sh ecosystem (name, description, instructions, source, enabled)

Frontend database (TypeScript — @tauri-apps/plugin-sql)

TableContents
agent_modesChat modes (General, Code Review, Quick Chat) with model, prompt, temperature
projectsUser workspace projects (build, research, create)
project_filesFiles within workspace projects (path, content, language)
automation_runsCron job execution history (job_id, status, output, error)
research_findingsResearch findings with title, content, source URL
content_documentsContent Studio documents (markdown, HTML, plaintext)
email_accountsEmail account configuration (IMAP/SMTP hosts, ports)
emailsCached emails with body, read/starred status, agent draft fields
credential_activity_logAudit trail for every credential access (action, tool, was_allowed)
security_audit_logSecurity events (exec_approval, config_change, auto_deny, etc.)
security_rulesUser-defined allow/deny patterns for command execution

Canvas database (Rust — rusqlite)

TableContents
canvasesCanvas workspaces (title, timestamps)
canvas_nodesNodes on a canvas (type, position, size, data)
canvas_edgesEdges connecting canvas nodes (source, target, label)
:::info Sensitive fields in the frontend database are encrypted with AES-256-GCM using a key stored in the OS keychain. Encrypted values are prefixed with enc: for identification. :::

IPC bridge architecture

All communication between the TypeScript frontend and Rust backend uses Tauri’s IPC system. The bridge (src/engine/molecules/ipc_client.ts) provides typed wrappers for every invoke command.

Invoke commands (Frontend → Backend)

Commands are called via invoke() and return Promises:
CategoryCommands
Chatengine_chat_send, engine_chat_history
Sessionsengine_sessions_list, engine_session_rename, engine_session_delete, engine_session_clear, engine_session_compact
Configengine_get_config, engine_set_config, engine_upsert_provider, engine_remove_provider, engine_status, engine_auto_setup
Agent filesengine_agent_file_list, engine_agent_file_get, engine_agent_file_set, engine_agent_file_delete
Memoryengine_memory_store, engine_memory_search, engine_memory_list, engine_memory_delete, engine_memory_stats, engine_get_memory_config, engine_set_memory_config, engine_test_embedding, engine_embedding_status, engine_embedding_pull_model, engine_ensure_embedding_ready, engine_memory_backfill
Skillsengine_skills_list, engine_skill_set_enabled, engine_skill_set_credential, engine_skill_delete_credential, engine_skill_revoke_all, engine_skill_get_instructions, engine_skill_set_instructions
Community Skillsengine_community_skills_list, engine_community_skills_browse, engine_community_skills_search, engine_community_skill_install, engine_community_skill_remove, engine_community_skill_set_enabled
Tasksengine_tasks_list, engine_task_create, engine_task_update, engine_task_delete, engine_task_move, engine_task_activity, engine_task_set_agents, engine_task_run, engine_tasks_cron_tick
TTS / STTengine_tts_speak, engine_tts_get_config, engine_tts_set_config, engine_tts_transcribe
Tradingengine_trading_history, engine_trading_summary, engine_trading_policy_get, engine_trading_policy_set, engine_positions_list, engine_position_close, engine_position_update_targets
Projectsengine_projects_list, engine_project_create, engine_project_update, engine_project_delete, engine_project_set_agents, engine_project_messages, engine_project_run
Agentsengine_list_all_agents, engine_create_agent, engine_delete_agent, engine_approve_tool
Browserengine_browser_get_config, engine_browser_set_config, engine_browser_create_profile, engine_browser_delete_profile
Screenshotsengine_screenshots_list, engine_screenshot_get, engine_screenshot_delete
Workspacesengine_workspaces_list, engine_workspace_files, engine_workspace_delete
Networkengine_network_get_policy, engine_network_set_policy, engine_network_check_url
Channelsengine_<channel>_start, engine_<channel>_stop, engine_<channel>_status, engine_<channel>_get_config, engine_<channel>_set_config, engine_<channel>_approve_user, engine_<channel>_deny_user, engine_<channel>_remove_user (for telegram, discord, irc, slack, matrix, mattermost, nextcloud, nostr, twitch)
Tailscaleengine_tailscale_status, engine_tailscale_get_config, engine_tailscale_set_config, engine_tailscale_serve_start, engine_tailscale_serve_stop, engine_tailscale_funnel_start, engine_tailscale_funnel_stop, engine_tailscale_connect, engine_tailscale_disconnect
Emailread_himalaya_config, write_himalaya_config, remove_himalaya_account, fetch_emails, fetch_email_content, send_email, move_email, delete_email
Securityget_db_encryption_key

Agent built-in tools

Every agent has access to these built-in tools (defined in tools.rs, executed in tool_executor.rs):
ToolParametersDescription
skill_searchquery (string)Search the skills.sh directory for community skills by keyword
skill_installsource (owner/repo), path (skills/id/SKILL.md)Install a community skill from GitHub
skill_listList all installed community skills with enabled/disabled status
These tools allow agents to discover, install, and manage community skills during conversations without requiring the user to visit the Skills tab.

Events (Backend → Frontend)

The engine communicates with the frontend via Tauri’s event system for real-time updates. The frontend subscribes using listen() and the backend emits events asynchronously.
EventPayloadPurpose
engine-eventEngineEventStreaming deltas, tool requests, tool results, completions, and errors
project-event{ project_id, agent_id, kind }Project/agent finished notifications
agent-profile-updated{ agent_id }Agent profile changes (name, avatar, bio)

EngineEvent kinds

The engine-event payload contains a kind field that determines the event type:
KindFieldsDescription
deltatext, session_id, run_idStreaming text chunk from the AI model
tool_requesttool_call (id, function name, arguments)Agent wants to call a tool — may require human approval
tool_resulttool_call_id, output, successResult of a tool execution
completetool_calls_count, usage (tokens), modelAgent turn completed
errormessageError during agent execution

Event flow

Build pipeline

Pawz uses a dual build pipeline — Vite for the frontend and Cargo for the Rust backend, orchestrated by Tauri:

Development

npm run tauri dev
  1. Vite dev server starts on http://localhost:1420 (HMR enabled)
  2. Cargo compiles the Rust backend in debug mode
  3. Tauri launches the app window pointing at the Vite dev server
  4. File changes in src/ trigger Vite HMR; changes in src-tauri/ trigger Cargo rebuild

Production build

npm run tauri build
  1. npm run build — Vite bundles TypeScript → dist/ (optimized, minified)
  2. cargo build --release — Compiles Rust backend with optimizations
  3. Tauri packages both into a native installer (.dmg, .AppImage, .msi)

Build configuration

Config filePurpose
vite.config.tsVite settings: port 1420, ignores src-tauri/, HMR on port 1421
src-tauri/tauri.conf.jsonTauri settings: beforeDevCommand, beforeBuildCommand, CSP policy, window config
src-tauri/Cargo.tomlRust dependencies and build profile
tsconfig.jsonTypeScript compiler options

Content Security Policy

The production CSP restricts the frontend:
default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline';
connect-src 'self' ws://127.0.0.1:* https://127.0.0.1:*;
img-src 'self' data: blob:; font-src 'self' data:;
object-src 'none'; frame-ancestors 'none'

Technology stack

LayerTechnology
ShellTauri v2
FrontendTypeScript, vanilla DOM
BackendRust, Tokio async
DatabaseSQLite (rusqlite + @tauri-apps/plugin-sql)
HTTPreqwest
Browserheadless_chrome (Chrome DevTools Protocol)
HTML parsingscraper (Rust)
Dockerbollard
Build (frontend)Vite
Build (backend)Cargo
IconsMaterial Symbols Outlined
FontsInter, JetBrains Mono